@xuda.io/ai_module 1.1.4075 → 1.1.4077
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 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -5511,7 +5511,7 @@ const create_and_upload_image_to_drive = async function (drive_type, file_path,
|
|
|
5511
5511
|
}
|
|
5512
5512
|
};
|
|
5513
5513
|
|
|
5514
|
-
export const
|
|
5514
|
+
export const create_profile_avatar = async function (req, job_id, headers) {
|
|
5515
5515
|
async function normalizeBase64To1024(base64Image) {
|
|
5516
5516
|
const inputBuffer = Buffer.from(base64Image, 'base64');
|
|
5517
5517
|
|
|
@@ -5821,9 +5821,11 @@ export const convert_profile_image_to_avatar = async function (req, job_id, head
|
|
|
5821
5821
|
const save_ret = await db_module.save_couch_doc_native('xuda_accounts', db_doc);
|
|
5822
5822
|
console.log(save_ret);
|
|
5823
5823
|
await update_profile_avatar_status(uid, 3);
|
|
5824
|
+
return save_ret;
|
|
5824
5825
|
} else {
|
|
5826
|
+
return drive_ret;
|
|
5825
5827
|
}
|
|
5826
|
-
|
|
5828
|
+
|
|
5827
5829
|
// account_module.update_contacts_with_account_changes(db_doc._id, ['profile_avatar']);
|
|
5828
5830
|
} else {
|
|
5829
5831
|
throw new Error(drive_ret.data);
|
|
@@ -5956,7 +5958,7 @@ export const modify_profile_avatar = async function (req, job_id, headers) {
|
|
|
5956
5958
|
}
|
|
5957
5959
|
|
|
5958
5960
|
let account_obj = await db_module.get_couch_doc_native('xuda_accounts', uid);
|
|
5959
|
-
const ret = await
|
|
5961
|
+
const ret = await create_profile_avatar({ prompt, url: account_obj.account_info?.profile_avatar, uid, account_obj }, job_id, headers);
|
|
5960
5962
|
return ret;
|
|
5961
5963
|
} catch (err) {
|
|
5962
5964
|
return { code: -111, data: err.message };
|