@xuda.io/account_module 1.2.1429 → 1.2.1431

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 +26 -22
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1940,6 +1940,7 @@ setTimeout(async () => {
1940
1940
  // let _design = await db_module.get_app_couch_doc_native(app_id, '_design/xuda');
1941
1941
  // ret = _design.views.ai_chat_usage;
1942
1942
  // console.log(_design.views.ai_chat_usage);
1943
+ ret = await set_contact_profile_picture(uid, 'cnt_2d21d55f8f0cdaf65a7a69f696166840', {}, null, {});
1943
1944
  console.log(ret);
1944
1945
  }, 1000);
1945
1946
 
@@ -2013,10 +2014,11 @@ export const add_contact = async function (req, job_id, headers) {
2013
2014
  // profile_avatar_obj == contact.value.profile_avatar_obj;
2014
2015
  // }
2015
2016
  // }
2016
- if (!is_spam) {
2017
- profile_picture_obj = await ai_module.get_profile_picture(uid, account_type, name, { email, context, metadata }, account_profile_info, job_id, headers);
2018
- profile_picture = profile_picture_obj.url;
2019
- }
2017
+
2018
+ // if (!is_spam) {
2019
+ // profile_picture_obj = await ai_module.get_profile_picture(uid, account_type, name, { email, context, metadata }, account_profile_info, job_id, headers);
2020
+ // profile_picture = profile_picture_obj.url;
2021
+ // }
2020
2022
  }
2021
2023
  const d = Date.now();
2022
2024
  const doc = {
@@ -2036,28 +2038,30 @@ export const add_contact = async function (req, job_id, headers) {
2036
2038
  team_req_id,
2037
2039
  metadata,
2038
2040
  is_spam,
2039
- profile_picture,
2040
- profile_picture_obj,
2041
- profile_avatar,
2042
- profile_avatar_obj,
2041
+ // profile_picture,
2042
+ // profile_picture_obj,
2043
+ // profile_avatar,
2044
+ // profile_avatar_obj,
2043
2045
  account_profiles: [account_profile_obj._id],
2044
2046
  account_type,
2045
2047
  };
2046
2048
  const save_ret = await save_contact(uid, doc);
2047
-
2048
- if (!account_info.profile_avatar) {
2049
- const ai_module = await import(`${module_path}/ai_module/index.mjs`);
2050
- if (account_info_ret?.data?.profile_picture) {
2051
- 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);
2052
- } else {
2053
- if (!doc.profile_avatar) {
2054
- // create factual avatar
2055
- if (!is_spam) {
2056
- 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);
2057
- }
2058
- }
2059
- }
2060
- }
2049
+ if (!is_spam) {
2050
+ await set_contact_profile_picture(uid, doc._id, metadata, job_id, headers);
2051
+ }
2052
+ // if (!account_info.profile_avatar) {
2053
+ // const ai_module = await import(`${module_path}/ai_module/index.mjs`);
2054
+ // if (account_info_ret?.data?.profile_picture) {
2055
+ // 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);
2056
+ // } else {
2057
+ // if (!doc.profile_avatar) {
2058
+ // // create factual avatar
2059
+ // if (!is_spam) {
2060
+ // 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);
2061
+ // }
2062
+ // }
2063
+ // }
2064
+ // }
2061
2065
  return save_ret;
2062
2066
  } catch (err) {
2063
2067
  return { code: -1, data: err.message };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1429",
3
+ "version": "1.2.1431",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {