@xuda.io/account_module 1.2.1934 → 1.2.1936
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 +26 -0
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2069,6 +2069,7 @@ setTimeout(async () => {
|
|
|
2069
2069
|
|
|
2070
2070
|
let ret;
|
|
2071
2071
|
|
|
2072
|
+
ret = await generate_contact_avatar({ uid, contact_id: 'cnt_c07049718613a11d164e90450d5f2742' });
|
|
2072
2073
|
// ret = await not_spam_contact({ uid, contact_id: 'cnt_c07049718613a11d164e90450d5f2742' });
|
|
2073
2074
|
// ret = await get_account_ai_usage({ uid });
|
|
2074
2075
|
// ret = await create_account_profile({ uid });
|
|
@@ -2844,6 +2845,31 @@ export const not_spam_contact = async function (req, job_id, headers) {
|
|
|
2844
2845
|
}
|
|
2845
2846
|
};
|
|
2846
2847
|
|
|
2848
|
+
export const generate_contact_avatar = async function (req, job_id, headers) {
|
|
2849
|
+
// const email_module = await import(`${module_path}/email_module/index.mjs`);
|
|
2850
|
+
// const ai_module = await import(`${module_path}/ai_module/index.mjs`);
|
|
2851
|
+
|
|
2852
|
+
const { contact_id, uid } = req;
|
|
2853
|
+
const account_profile_info = await get_active_account_profile_info(uid);
|
|
2854
|
+
try {
|
|
2855
|
+
var contact_doc = await get_contact(uid, contact_id);
|
|
2856
|
+
contact_doc.profile_picture_obj = null;
|
|
2857
|
+
contact_doc.profile_picture = null;
|
|
2858
|
+
contact_doc.profile_avatar_obj = null;
|
|
2859
|
+
contact_doc.profile_avatar = null;
|
|
2860
|
+
|
|
2861
|
+
const contact_save_ret = await save_contact(uid, contact_doc);
|
|
2862
|
+
await delete_xuda_cache(contact_doc);
|
|
2863
|
+
set_contact_profile_picture(uid, contact_doc._id, {}, job_id, headers, account_profile_info, true);
|
|
2864
|
+
|
|
2865
|
+
return contact_save_ret;
|
|
2866
|
+
} catch (err) {
|
|
2867
|
+
return {
|
|
2868
|
+
code: -24,
|
|
2869
|
+
data: err.message,
|
|
2870
|
+
};
|
|
2871
|
+
}
|
|
2872
|
+
};
|
|
2847
2873
|
//////// PROFILES //////////////
|
|
2848
2874
|
|
|
2849
2875
|
export const get_pending_share_profile_in = async function (uid, _id) {
|