@xuda.io/account_module 1.2.1705 → 1.2.1707

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 -20
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2134,24 +2134,26 @@ export const add_contact = async function (req, job_id, headers) {
2134
2134
  if (!_.isEmpty(cached_contact?.business_info)) {
2135
2135
  contact_obj.business_info = _.cloneDeep(cached_contact.business_info);
2136
2136
  } else {
2137
- if (account_type === 'business' && !is_spam) {
2138
- contact_obj.business_info = await ai_module.get_business_info(uid, contact_obj.name, contact_obj.email, account_profile_info);
2139
- save_xuda_cache(uid, 'contact', contact_obj.domain, null, contact_obj);
2140
-
2141
- // const business_info = await ai_module.get_business_info(uid, contact_obj.name, contact_obj.email, account_profile_info);
2142
- // if (business_info) {
2143
- // const { business_size, business_category, business_sub_category, business_country, business_bio, business_name } = business_info;
2144
- // contact_obj.mainCategory = business_category;
2145
- // contact_obj.subCategory = business_sub_category;
2146
- // contact_obj.business_size = business_size;
2147
- // contact_obj.country = business_country;
2148
- // contact_obj.bio = business_bio;
2149
- // contact_obj.business_name = business_name;
2150
-
2151
- // if (!contact_obj.name) {
2152
- // contact_obj.name = business_name;
2153
- // }
2154
- // }
2137
+ if (!is_spam) {
2138
+ if (account_type === 'business') {
2139
+ contact_obj.business_info = await ai_module.get_business_info(uid, contact_obj.name, contact_obj.email, account_profile_info);
2140
+ save_xuda_cache(uid, 'contact', contact_obj.domain, null, contact_obj);
2141
+
2142
+ // const business_info = await ai_module.get_business_info(uid, contact_obj.name, contact_obj.email, account_profile_info);
2143
+ // if (business_info) {
2144
+ // const { business_size, business_category, business_sub_category, business_country, business_bio, business_name } = business_info;
2145
+ // contact_obj.mainCategory = business_category;
2146
+ // contact_obj.subCategory = business_sub_category;
2147
+ // contact_obj.business_size = business_size;
2148
+ // contact_obj.country = business_country;
2149
+ // contact_obj.bio = business_bio;
2150
+ // contact_obj.business_name = business_name;
2151
+
2152
+ // if (!contact_obj.name) {
2153
+ // contact_obj.name = business_name;
2154
+ // }
2155
+ // }
2156
+ }
2155
2157
  } else {
2156
2158
  if (!contact_obj.name) {
2157
2159
  contact_obj.name = '';
@@ -2181,7 +2183,7 @@ export const add_contact = async function (req, job_id, headers) {
2181
2183
  save_xuda_cache(uid, 'contact', contact_obj.email, null, contact_obj);
2182
2184
 
2183
2185
  if (!contact_obj.is_spam && contact_obj.name) {
2184
- set_contact_profile_picture(uid, contact_obj._id, metadata, job_id, headers);
2186
+ // set_contact_profile_picture(uid, contact_obj._id, metadata, job_id, headers);
2185
2187
  }
2186
2188
 
2187
2189
  return save_ret;
@@ -2204,6 +2206,7 @@ const set_contact_profile_picture = async function (uid, contact_id, metadata, j
2204
2206
  throw new Error(`contact ${contact_id} not found`);
2205
2207
  }
2206
2208
  await update_contact_profile_picture_status(uid, contact_id, 2);
2209
+ ////// PROFILE PICTURE
2207
2210
  if (!contact_obj.profile_picture) {
2208
2211
  let cache = await get_xuda_cache(uid, 'profile_picture', contact_obj.email, 'file');
2209
2212
  if (!cache && contact_obj.business_name) {
@@ -2231,7 +2234,7 @@ const set_contact_profile_picture = async function (uid, contact_id, metadata, j
2231
2234
  const contact_save_ret = await db_module.save_app_couch_doc(account_profile_info.app_id, contact_obj);
2232
2235
  profile_picture = contact_obj.profile_picture;
2233
2236
  }
2234
-
2237
+ ////// PROFILE AVATAR
2235
2238
  if (!contact_obj.profile_avatar) {
2236
2239
  let cache = await get_xuda_cache(uid, 'profile_avatar', contact_obj.email, 'file');
2237
2240
  if (!cache && contact_obj.business_name) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1705",
3
+ "version": "1.2.1707",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {