@xuda.io/ai_module 1.1.4957 → 1.1.4959
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 +9 -11
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -48,12 +48,10 @@ import UglifyJS from 'uglify-js';
|
|
|
48
48
|
|
|
49
49
|
global._ = _;
|
|
50
50
|
|
|
51
|
-
// const { get_xuda_couch } = await import(`${module_path}/db_module/index.mjs`);
|
|
52
|
-
|
|
53
51
|
const _common = await import(path.join(process.env.XUDA_HOME, 'common', 'xuda_node_common.mjs'));
|
|
54
52
|
const _utils = await import(path.join(process.env.XUDA_HOME, 'common', 'xuda-cpi-utils.mjs'));
|
|
55
53
|
|
|
56
|
-
const { get_active_account_profile_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 } = await import(path.join(process.env.XUDA_HOME, 'common', 'cache_cpi.mjs'));
|
|
57
55
|
|
|
58
56
|
const { createDoc, valid_menuType } = await import(`${runtime_modules_path}/xuda-studio-doc-utils.mjs`);
|
|
59
57
|
const { xudaPrase } = await import(`${runtime_modules_path}/xuda-cli-plugin-html-parser-module.esm.mjs`);
|
|
@@ -1279,7 +1277,7 @@ export const get_ai_chats = async function (req, job_id, headers) {
|
|
|
1279
1277
|
let doc = { date_created: e.team_req_date, pending: true, uid: e.team_req_from_uid, team_req_id: e._id };
|
|
1280
1278
|
|
|
1281
1279
|
if (e.team_req_from_uid) {
|
|
1282
|
-
doc.user_contact = await
|
|
1280
|
+
doc.user_contact = await get_user_card(uid, e.team_req_from_uid);
|
|
1283
1281
|
}
|
|
1284
1282
|
|
|
1285
1283
|
//share_item_id
|
|
@@ -1341,7 +1339,7 @@ export const get_ai_chats = async function (req, job_id, headers) {
|
|
|
1341
1339
|
// }
|
|
1342
1340
|
// }
|
|
1343
1341
|
|
|
1344
|
-
doc.user_contact = await
|
|
1342
|
+
doc.user_contact = await get_user_card(uid, doc.uid);
|
|
1345
1343
|
|
|
1346
1344
|
doc.privilege = doc.uid === uid || doc?.account_profile_info?.uid === uid;
|
|
1347
1345
|
|
|
@@ -1817,7 +1815,7 @@ export const get_ai_agent_info = async function (uid, job_id, headers, doc, from
|
|
|
1817
1815
|
}
|
|
1818
1816
|
|
|
1819
1817
|
if (doc?.studio_meta?.createdByUid) {
|
|
1820
|
-
doc.user_contact = await
|
|
1818
|
+
doc.user_contact = await get_user_card(uid, doc.studio_meta.createdByUid);
|
|
1821
1819
|
}
|
|
1822
1820
|
if (!from_marketplace) {
|
|
1823
1821
|
doc.interactions = 0;
|
|
@@ -1836,7 +1834,7 @@ export const get_ai_agent_info = async function (uid, job_id, headers, doc, from
|
|
|
1836
1834
|
|
|
1837
1835
|
if (!from_marketplace) {
|
|
1838
1836
|
if (doc?.reference_doc?.studio_meta?.shared_from_uid) {
|
|
1839
|
-
const shared_from_uid_ret = await
|
|
1837
|
+
const shared_from_uid_ret = await get_account_name({ uid_query: doc.reference_doc.studio_meta.shared_from_uid });
|
|
1840
1838
|
doc.icon_pattern = shared_from_uid_ret.data.profile_avatar;
|
|
1841
1839
|
}
|
|
1842
1840
|
}
|
|
@@ -1968,7 +1966,7 @@ export const get_ai_agents = async function (req, job_id, headers) {
|
|
|
1968
1966
|
let doc = { ts: e.team_req_date, pending: true, properties: {}, studio_meta: { createdByUid: e.team_req_from_uid }, team_req_id: e._id };
|
|
1969
1967
|
|
|
1970
1968
|
if (e.team_req_from_uid) {
|
|
1971
|
-
doc.user_contact = await
|
|
1969
|
+
doc.user_contact = await get_user_card(uid, e.team_req_from_uid);
|
|
1972
1970
|
doc.icon_pattern = doc.user_contact.profile_avatar;
|
|
1973
1971
|
}
|
|
1974
1972
|
|
|
@@ -2346,7 +2344,7 @@ export const get_apps = async function (req, job_id, headers) {
|
|
|
2346
2344
|
let doc = { ts: e.team_req_date, pending: true, properties: {}, studio_meta: { createdByUid: e.team_req_from_uid }, team_req_id: e._id };
|
|
2347
2345
|
|
|
2348
2346
|
if (e.team_req_from_uid) {
|
|
2349
|
-
doc.user_contact = await
|
|
2347
|
+
doc.user_contact = await get_user_card(uid, e.team_req_from_uid);
|
|
2350
2348
|
}
|
|
2351
2349
|
|
|
2352
2350
|
//share_item_id
|
|
@@ -2371,7 +2369,7 @@ export const get_apps = async function (req, job_id, headers) {
|
|
|
2371
2369
|
doc.reference_doc = reference_doc;
|
|
2372
2370
|
}
|
|
2373
2371
|
|
|
2374
|
-
doc.user_contact = await
|
|
2372
|
+
doc.user_contact = await get_user_card(uid, doc.studio_meta.createdByUid);
|
|
2375
2373
|
|
|
2376
2374
|
doc.privilege = doc.studio_meta.createdByUid === uid || doc?.studio_meta?.account_profile_info?.uid === uid;
|
|
2377
2375
|
|
|
@@ -3998,7 +3996,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
3998
3996
|
const app_id = await account_ms.get_account_default_project_id(uid);
|
|
3999
3997
|
const app_obj = await get_app_obj(account_profile_info.app_id);
|
|
4000
3998
|
const userName = await account_ms.get_user_name(uid);
|
|
4001
|
-
const account_info = (await
|
|
3999
|
+
const account_info = (await get_account_name({ uid })).data;
|
|
4002
4000
|
let context = { ...{ app_id: account_profile_info.app_id, uid, userName, account_info, app_obj, account_id: uid }, ...extractClientInfo(headers) };
|
|
4003
4001
|
const d = new Intl.DateTimeFormat('en-US').format(new Date());
|
|
4004
4002
|
if (!visitors[d]) {
|