@xuda.io/ai_module 1.1.4451 → 1.1.4453

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.
Files changed (2) hide show
  1. package/index.mjs +23 -13
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -5796,18 +5796,20 @@ export const conversation_actions = async function (req, job_id, headers) {
5796
5796
  }
5797
5797
  };
5798
5798
 
5799
- const update_profile_avatar_status = async function (uid, stat) {
5800
- try {
5801
- let doc = await db_module.get_couch_doc_native('xuda_accounts', uid);
5802
- doc.account_info.profile_avatar_stat = stat;
5803
- const save_ret = await db_module.save_couch_doc_native('xuda_accounts', doc);
5804
- } catch (err) {
5805
- console.error(err);
5806
- }
5807
- };
5799
+ // const update_profile_avatar_status = async function (uid, stat) {
5800
+ // try {
5801
+ // let doc = await db_module.get_couch_doc_native('xuda_accounts', uid);
5802
+ // doc.account_info.profile_avatar_stat = stat;
5803
+ // const save_ret = await db_module.save_couch_doc_native('xuda_accounts', doc);
5804
+ // } catch (err) {
5805
+ // console.error(err);
5806
+ // }
5807
+ // };
5808
5808
 
5809
5809
  export const modify_profile_avatar = async function (req, job_id, headers) {
5810
- const { methods = [], uid } = req;
5810
+ const { methods = [], docType, uid, url, _id, name, account_type } = req;
5811
+ let { metadata } = req;
5812
+ const account_profile_info = await account_module.get_active_account_profile_info(uid);
5811
5813
 
5812
5814
  try {
5813
5815
  let prompt = '';
@@ -5845,9 +5847,17 @@ export const modify_profile_avatar = async function (req, job_id, headers) {
5845
5847
  }
5846
5848
  }
5847
5849
 
5848
- let account_obj = await db_module.get_couch_doc_native('xuda_accounts', uid);
5849
- const ret = await get_profile_avatar({ prompt, url: account_obj.account_info?.profile_avatar, uid, account_obj, account_profile_info }, job_id, headers);
5850
- return ret;
5850
+ const account_obj = await db_module.get_couch_doc_native('xuda_accounts', uid);
5851
+ const account_info = account_obj.account_info;
5852
+ if (!metadata) {
5853
+ metadata = account_info;
5854
+ }
5855
+
5856
+ // let account_obj = await db_module.get_couch_doc_native('xuda_accounts', uid);
5857
+ // const ret = await get_profile_avatar({ prompt, url: account_obj.account_info?.profile_avatar, uid, account_obj, account_profile_info }, job_id, headers);
5858
+ // return ret;
5859
+
5860
+ return await get_profile_avatar(url, uid, prompt, account_profile_info, account_type, docType, _id, metadata, account_info, name, account_info.email, job_id, headers);
5851
5861
  } catch (err) {
5852
5862
  return { code: -111, data: err.message };
5853
5863
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4451",
3
+ "version": "1.1.4453",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",