@xuda.io/account_module 1.2.2039 → 1.2.2041

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 +2 -61
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -194,23 +194,12 @@ export const update_account_info = async function (req, job_id, headers) {
194
194
 
195
195
  const save_ret = await db_module.save_couch_doc('xuda_accounts', account_obj);
196
196
 
197
- // const ai_module = await import(`${module_path}/ai_module/index.mjs`);
198
-
199
197
  if (account_obj.account_info?.profile_picture) {
200
198
  if (!account_obj.account_info?.profile_avatar && account_obj.account_info.profile_avatar_stat !== 2) {
201
199
  debugger;
202
200
  set_account_profile_picture(uid, uid, account_obj.account_info, job_id, headers, account_profile_info);
203
201
  }
204
202
  }
205
- // if (account_obj.account_info?.profile_picture) {
206
- // if (!account_obj.account_info?.profile_avatar) {
207
- // ai_module.get_profile_avatar({ url: account_obj.account_info?.profile_picture, uid, account_obj, account_profile_info }, job_id, headers);
208
- // }
209
- // } else {
210
- // ai_module.update_thumbnail('account', account_obj, account_obj.account_project_id, uid, job_id, headers, 'xuda_accounts');
211
- // }
212
-
213
- // update_contacts_with_account_changes(account_obj._id, account_info_changes_arr);
214
203
 
215
204
  if (save_ret.code > 0) {
216
205
  return { code: 1300, data: 'ok' };
@@ -1413,17 +1402,6 @@ export const get_contact_info = async function (uid, contact_doc, _id) {
1413
1402
  doc.notifications = contact_chat_conversation_count_ret - contact_chat_conversation_read_ret;
1414
1403
  doc.chats = doc.interactions;
1415
1404
 
1416
- // const chats_ret = await ai_module.get_ai_chats({ uid, reference_id: doc._id });
1417
- // for (let chat_doc of chats_ret.data.docs) {
1418
- // doc.notifications += chat_doc.notifications;
1419
-
1420
- // doc.chats++;
1421
- // if (chat_doc.interactions) {
1422
- // doc.interactions += chat_doc.interactions;
1423
- // }
1424
- // doc.contact_mood_level = chat_doc.mood_level || 0;
1425
- // }
1426
- // console.log('contact_mood_level', doc._id, doc.contact_mood_level);
1427
1405
  doc.card_background = get_contact_background(doc);
1428
1406
 
1429
1407
  doc.border = get_contact_border(doc);
@@ -1579,18 +1557,6 @@ export const update_contact = async function (req) {
1579
1557
  }
1580
1558
  return { code: -1, data: 'contact not found' };
1581
1559
  };
1582
- // export const invite_user = async function (req) {
1583
- // const { email, name, uid } = req;
1584
-
1585
- // const team_module = await import(`${module_path}/team_module/index.mjs`);
1586
- // const ret = await team_module.create_team_request({
1587
- // email,
1588
- // access_type: 'contact',
1589
- // uid,
1590
- // });
1591
-
1592
- // // return { code: -1, data: "contact already exist active or deleted" };
1593
- // };
1594
1560
 
1595
1561
  export const get_account_rt_info = async function (uid) {
1596
1562
  const doc_ret = await db_module.get_couch_doc('xuda_accounts', uid);
@@ -1797,29 +1763,6 @@ export const get_user_card = async function (uid, uid_query) {
1797
1763
  return user_contact_obj;
1798
1764
  };
1799
1765
 
1800
- // export const generate_user_avatar = async function (req, job_id, headers) {
1801
- // const { uid, account_info } = req;
1802
- // try {
1803
- // const ai_module = await import(`${module_path}/ai_module/index.mjs`);
1804
-
1805
- // ai_module.get_profile_avatar({ url: account_info?.profile_picture, uid, account_obj }, job_id, headers);
1806
-
1807
- // // const account_info = await get_account_name({ uid });
1808
- // // let username = 'unknown';
1809
- // // if (account_info) {
1810
- // // username = account_info.first_name + ' ' + account_info.last_name;
1811
-
1812
- // // if (!username) {
1813
- // // username = +account_info.email;
1814
- // // }
1815
- // // }
1816
-
1817
- // // return username;
1818
- // } catch (err) {
1819
- // return 'unknown';
1820
- // }
1821
- // };
1822
-
1823
1766
  export const onboarding_completed = async function (req, job_id, headers) {
1824
1767
  const { uid } = req;
1825
1768
  try {
@@ -1939,8 +1882,6 @@ export const get_account_ai_usage = async function (req, job_id, headers) {
1939
1882
  };
1940
1883
 
1941
1884
  const set_account_profile_picture = async function (uid, account_uid, metadata, job_id, headers, account_profile_info) {
1942
- const ai_module = await import(`${module_path}/ai_module/index.mjs`);
1943
- // const account_profile_info = await get_active_account_profile_info(uid);
1944
1885
  await update_account_profile_picture_status(account_uid, 1);
1945
1886
  try {
1946
1887
  let profile_picture;
@@ -1956,7 +1897,7 @@ const set_account_profile_picture = async function (uid, account_uid, metadata,
1956
1897
 
1957
1898
  await update_account_profile_picture_status(account_uid, 2);
1958
1899
  if (!account_info.profile_picture) {
1959
- const file_ret = await ai_module.get_profile_picture(uid, account_info.account_type, name, { email: account_info.email, metadata, account_info }, account_profile_info, job_id, headers);
1900
+ const file_ret = await ai_ms.get_profile_picture(uid, account_info.account_type, name, { email: account_info.email, metadata, account_info }, account_profile_info, job_id, headers);
1960
1901
 
1961
1902
  let { code: account_code, data: account_obj2 } = await db_module.get_couch_doc('xuda_accounts', account_uid);
1962
1903
  account_obj = account_obj2;
@@ -2008,7 +1949,7 @@ const set_account_profile_picture = async function (uid, account_uid, metadata,
2008
1949
 
2009
1950
  const { bio, country, mainCategory, subCategory } = account_info;
2010
1951
 
2011
- const file_ret = await ai_module.get_profile_avatar(account_info.profile_picture, uid, '', account_profile_info, account_info.account_type, 'account', account_uid, { bio, country, mainCategory, subCategory, is_user: true }, business_size, name, account_info.email, job_id, headers);
1952
+ const file_ret = await ai_ms.get_profile_avatar(account_info.profile_picture, uid, '', account_profile_info, account_info.account_type, 'account', account_uid, { bio, country, mainCategory, subCategory, is_user: true }, business_size, name, account_info.email, job_id, headers);
2012
1953
  if (file_ret.code < 0) {
2013
1954
  throw new Error(file_ret.data);
2014
1955
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.2039",
3
+ "version": "1.2.2041",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {