@xuda.io/ai_module 1.1.4960 → 1.1.4961
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 +14 -14
- 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, get_contact_info } = 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, get_account_default_project_id } = 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`);
|
|
@@ -1281,7 +1281,7 @@ export const get_ai_chats = async function (req, job_id, headers) {
|
|
|
1281
1281
|
}
|
|
1282
1282
|
|
|
1283
1283
|
//share_item_id
|
|
1284
|
-
const app_id = await
|
|
1284
|
+
const app_id = await get_account_default_project_id(e.team_req_from_uid);
|
|
1285
1285
|
const chat_ret = await db_module.get_app_couch_doc_native(app_id, e.share_item_id);
|
|
1286
1286
|
doc.title = chat_ret.title;
|
|
1287
1287
|
doc.chat_image = chat_ret.chat_image;
|
|
@@ -1361,7 +1361,7 @@ export const delete_ai_chat = async function (req) {
|
|
|
1361
1361
|
|
|
1362
1362
|
const account_profile_info = await get_active_account_profile_info(uid);
|
|
1363
1363
|
|
|
1364
|
-
const app_id = await
|
|
1364
|
+
const app_id = await get_account_default_project_id(uid);
|
|
1365
1365
|
let conversation_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, conversation_id);
|
|
1366
1366
|
|
|
1367
1367
|
let save_ret;
|
|
@@ -1524,7 +1524,7 @@ const get_studio_doc = async function (req) {
|
|
|
1524
1524
|
let { uid, _id } = req;
|
|
1525
1525
|
const account_profile_info = await get_active_account_profile_info(uid);
|
|
1526
1526
|
|
|
1527
|
-
const app_id = await
|
|
1527
|
+
const app_id = await get_account_default_project_id(uid);
|
|
1528
1528
|
try {
|
|
1529
1529
|
let data = await db_module.get_app_couch_doc_native(account_profile_info.app_id, _id);
|
|
1530
1530
|
|
|
@@ -1971,7 +1971,7 @@ export const get_ai_agents = async function (req, job_id, headers) {
|
|
|
1971
1971
|
}
|
|
1972
1972
|
|
|
1973
1973
|
//share_item_id
|
|
1974
|
-
const app_id = await
|
|
1974
|
+
const app_id = await get_account_default_project_id(e.team_req_from_uid);
|
|
1975
1975
|
const ai_agent_doc = await db_module.get_app_couch_doc_native(app_id, e.share_item_id);
|
|
1976
1976
|
doc.properties.menuName = ai_agent_doc.properties.menuName;
|
|
1977
1977
|
doc.studio_meta.agent_image = ai_agent_doc.studio_meta.agent_image;
|
|
@@ -2348,7 +2348,7 @@ export const get_apps = async function (req, job_id, headers) {
|
|
|
2348
2348
|
}
|
|
2349
2349
|
|
|
2350
2350
|
//share_item_id
|
|
2351
|
-
const app_id = await
|
|
2351
|
+
const app_id = await get_account_default_project_id(e.team_req_from_uid);
|
|
2352
2352
|
const miniapp_ret = await db_module.get_app_couch_doc_native(app_id, e.share_item_id);
|
|
2353
2353
|
doc.properties.menuName = miniapp_ret.properties.menuName;
|
|
2354
2354
|
doc.studio_meta.agent_image = miniapp_ret.studio_meta.agent_image;
|
|
@@ -3437,7 +3437,7 @@ export const create_conversation = async function (req, job_id, headers) {
|
|
|
3437
3437
|
recipient_contact_id = contact_doc.connection_contact_id;
|
|
3438
3438
|
recipient_uid = contact_doc.connection_uid;
|
|
3439
3439
|
|
|
3440
|
-
const app_id = await
|
|
3440
|
+
const app_id = await get_account_default_project_id(recipient_uid);
|
|
3441
3441
|
const save_ret = await db_module.save_app_couch_doc(app_id, { ...conversation_doc, ...{ uid: recipient_uid, reference_id: recipient_contact_id } });
|
|
3442
3442
|
}
|
|
3443
3443
|
|
|
@@ -3671,7 +3671,7 @@ const contact_chat_conversation = async function (req, job_id, headers) {
|
|
|
3671
3671
|
const conversation_id = conversation_doc._id;
|
|
3672
3672
|
|
|
3673
3673
|
const receiver_contact_doc = await get_contact_info(uid, null, conversation_doc.reference_id);
|
|
3674
|
-
const receiver_app_id = await
|
|
3674
|
+
const receiver_app_id = await 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
3677
|
const sender_contact_doc = await get_contact_info(uid, null, conversation_doc.reference_id);
|
|
@@ -3734,7 +3734,7 @@ const chat_note = async function (req, job_id, headers) {
|
|
|
3734
3734
|
try {
|
|
3735
3735
|
const conversation_id = conversation_doc._id;
|
|
3736
3736
|
|
|
3737
|
-
const sender_app_id = account_profile_info.app_id; //await
|
|
3737
|
+
const sender_app_id = account_profile_info.app_id; //await get_account_default_project_id(uid);
|
|
3738
3738
|
let sender_conversation_doc = await db_module.get_app_couch_doc_native(sender_app_id, conversation_id);
|
|
3739
3739
|
|
|
3740
3740
|
await attachment_handler(uid, sender_app_id, conversation_id, attachments, account_profile_info);
|
|
@@ -3993,7 +3993,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
3993
3993
|
};
|
|
3994
3994
|
|
|
3995
3995
|
try {
|
|
3996
|
-
const app_id = await
|
|
3996
|
+
const app_id = await get_account_default_project_id(uid);
|
|
3997
3997
|
const app_obj = await get_app_obj(account_profile_info.app_id);
|
|
3998
3998
|
const userName = await account_ms.get_user_name(uid);
|
|
3999
3999
|
const account_info = (await get_account_name({ uid })).data;
|
|
@@ -4153,12 +4153,12 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4153
4153
|
ai_agent_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, agent_id);
|
|
4154
4154
|
if (ai_agent_doc.studio_meta.shared_from_uid) {
|
|
4155
4155
|
const reference_doc = _.cloneDeep(ai_agent_doc);
|
|
4156
|
-
const app_id = await
|
|
4156
|
+
const app_id = await get_account_default_project_id(ai_agent_doc.studio_meta.shared_from_uid);
|
|
4157
4157
|
ai_agent_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, ai_agent_doc.studio_meta.share_item_id);
|
|
4158
4158
|
ai_agent_doc.reference_doc = reference_doc;
|
|
4159
4159
|
} else if (ai_agent_doc.studio_meta.installed_from_uid) {
|
|
4160
4160
|
const reference_doc = _.cloneDeep(ai_agent_doc);
|
|
4161
|
-
const app_id = await
|
|
4161
|
+
const app_id = await get_account_default_project_id(ai_agent_doc.studio_meta.installed_from_uid);
|
|
4162
4162
|
ai_agent_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, ai_agent_doc.studio_meta.share_item_id);
|
|
4163
4163
|
ai_agent_doc.reference_doc = reference_doc;
|
|
4164
4164
|
}
|
|
@@ -5979,7 +5979,7 @@ export const create_mini_app = async function (req, job_id, headers) {
|
|
|
5979
5979
|
export const pin_ai_agent = async function (req, job_id, headers) {
|
|
5980
5980
|
const { uid, agent_id } = req;
|
|
5981
5981
|
try {
|
|
5982
|
-
const app_id = await
|
|
5982
|
+
const app_id = await get_account_default_project_id(uid);
|
|
5983
5983
|
const ai_agent_doc = await db_module.get_app_couch_doc_native(app_id, agent_id);
|
|
5984
5984
|
|
|
5985
5985
|
ai_agent_doc.studio_meta.pinned = true;
|
|
@@ -6003,7 +6003,7 @@ export const pin_ai_agent = async function (req, job_id, headers) {
|
|
|
6003
6003
|
export const unpin_ai_agent = async function (req, job_id, headers) {
|
|
6004
6004
|
const { uid, agent_id } = req;
|
|
6005
6005
|
try {
|
|
6006
|
-
const app_id = await
|
|
6006
|
+
const app_id = await get_account_default_project_id(uid);
|
|
6007
6007
|
const ai_agent_doc = await db_module.get_app_couch_doc_native(app_id, agent_id);
|
|
6008
6008
|
|
|
6009
6009
|
ai_agent_doc.studio_meta.pinned = false;
|