@xuda.io/account_module 1.2.1475 → 1.2.1477
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 +4 -38
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1991,10 +1991,7 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
1991
1991
|
/////////////////
|
|
1992
1992
|
|
|
1993
1993
|
let is_spam = false;
|
|
1994
|
-
|
|
1995
|
-
let profile_avatar, profile_avatar_obj;
|
|
1996
|
-
let account_info_ret;
|
|
1997
|
-
let account_info;
|
|
1994
|
+
|
|
1998
1995
|
let account_type;
|
|
1999
1996
|
if (contact_uid) {
|
|
2000
1997
|
let { code: account_code, data: account_obj } = await db_module.get_couch_doc('xuda_accounts', contact_uid);
|
|
@@ -2003,13 +2000,7 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2003
2000
|
if (account_code < 0) {
|
|
2004
2001
|
throw new Error(`account ${contact_uid} not found`);
|
|
2005
2002
|
}
|
|
2006
|
-
|
|
2007
|
-
// account_info.profile_picture_obj = await ai_module.get_profile_picture(uid, account_type, name, { email, context, metadata, account_info }, account_profile_info, job_id, headers);
|
|
2008
|
-
// account_info.profile_picture = account_info.profile_picture_obj.file_url;
|
|
2009
|
-
// // account_info.profile_picture_obj = profile_picture_obj;
|
|
2010
|
-
// // account_info.profile_picture = profile_picture;
|
|
2011
|
-
// const account_save_ret = await db_module.save_couch_doc('xuda_accounts', account_obj);
|
|
2012
|
-
// }
|
|
2003
|
+
|
|
2013
2004
|
set_account_profile_picture(uid, contact_uid, metadata, job_id, headers);
|
|
2014
2005
|
} else {
|
|
2015
2006
|
// contact without use account
|
|
@@ -2052,10 +2043,7 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2052
2043
|
team_req_id,
|
|
2053
2044
|
metadata,
|
|
2054
2045
|
is_spam,
|
|
2055
|
-
|
|
2056
|
-
// profile_picture_obj,
|
|
2057
|
-
// profile_avatar,
|
|
2058
|
-
// profile_avatar_obj,
|
|
2046
|
+
|
|
2059
2047
|
account_profiles: [account_profile_obj._id],
|
|
2060
2048
|
account_type,
|
|
2061
2049
|
};
|
|
@@ -2074,19 +2062,7 @@ export const add_contact = async function (req, job_id, headers) {
|
|
|
2074
2062
|
if (!is_spam) {
|
|
2075
2063
|
set_contact_profile_picture(uid, contact_obj._id, metadata, job_id, headers);
|
|
2076
2064
|
}
|
|
2077
|
-
|
|
2078
|
-
// const ai_module = await import(`${module_path}/ai_module/index.mjs`);
|
|
2079
|
-
// if (account_info_ret?.data?.profile_picture) {
|
|
2080
|
-
// ai_module.get_profile_avatar({ url: account_obj.profile_picture, uid, account_obj: { _id: contact_uid, account_info: account_info_ret.data }, account_profile_info }, job_id, headers);
|
|
2081
|
-
// } else {
|
|
2082
|
-
// if (!doc.profile_avatar) {
|
|
2083
|
-
// // create factual avatar
|
|
2084
|
-
// if (!is_spam) {
|
|
2085
|
-
// ai_module.update_thumbnail('contact', doc, account_profile_info.app_id, uid, job_id, headers, null, [email, doc._id, 'contact', account_profile_info.app_id], account_profile_info);
|
|
2086
|
-
// }
|
|
2087
|
-
// }
|
|
2088
|
-
// }
|
|
2089
|
-
// }
|
|
2065
|
+
|
|
2090
2066
|
return save_ret;
|
|
2091
2067
|
} catch (err) {
|
|
2092
2068
|
return { code: -1, data: err.message };
|
|
@@ -2208,17 +2184,7 @@ const set_contact_profile_picture = async function (uid, contact_id, metadata, j
|
|
|
2208
2184
|
profile_picture = contact_obj.profile_picture;
|
|
2209
2185
|
}
|
|
2210
2186
|
|
|
2211
|
-
// get business info
|
|
2212
|
-
|
|
2213
2187
|
if (!contact_obj.profile_avatar) {
|
|
2214
|
-
// const business_info = await get_business_info(uid, contact_obj.name, contact_obj.email, account_profile_info);
|
|
2215
|
-
// const { business_size, business_category, business_sub_category, business_country, business_bio } = business_info;
|
|
2216
|
-
// contact_obj.mainCategory = business_category;
|
|
2217
|
-
// contact_obj.subCategory = business_sub_category;
|
|
2218
|
-
// contact_obj.business_size = business_size;
|
|
2219
|
-
// contact_obj.country = business_country;
|
|
2220
|
-
// contact_obj.bio = business_bio;
|
|
2221
|
-
|
|
2222
2188
|
const file_ret = await ai_module.get_profile_avatar(
|
|
2223
2189
|
contact_obj.profile_picture,
|
|
2224
2190
|
uid,
|