@xuda.io/account_module 1.2.1274 → 1.2.1276

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 +11 -11
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1218,7 +1218,7 @@ export const merge_contact = async function (req) {
1218
1218
  contact_doc.stat = 4;
1219
1219
  contact_doc.stat_ts = Date.now();
1220
1220
  contact_doc.stat_reason = 'merge';
1221
- await await save_contact(uid, contact_doc);
1221
+ await save_contact(uid, contact_doc);
1222
1222
  } catch (error) {}
1223
1223
  }
1224
1224
 
@@ -1432,7 +1432,7 @@ export const get_contact_info = async function (uid, contact_doc, _id) {
1432
1432
  try {
1433
1433
  let contact_doc = await get_contact(uid, doc._id);
1434
1434
  contact_doc.team_req_id = '';
1435
- await db_module.save_couch_doc('xuda_contacts', contact_doc);
1435
+ await save_contact(uid, contact_doc);
1436
1436
  } catch (error) {}
1437
1437
  }
1438
1438
  doc.connection_stat = 0;
@@ -1606,7 +1606,7 @@ export const update_contact = async function (req) {
1606
1606
  doc.profile_avatar = account_obj.account_info.profile_avatar;
1607
1607
  }
1608
1608
 
1609
- return await db_module.save_couch_doc('xuda_contacts', doc);
1609
+ return await save_contact(uid, doc);
1610
1610
  }
1611
1611
  return { code: -1, data: 'contact not found' };
1612
1612
  };
@@ -2015,7 +2015,7 @@ export const ts_contact = async function (contact_id) {
2015
2015
  try {
2016
2016
  const contact_doc = await get_contact(uid, contact_id);
2017
2017
  contact_doc.ts = Date.now();
2018
- const save_ret = await db_module.save_couch_doc('xuda_contacts', contact_doc);
2018
+ const save_ret = await save_contact(uid, contact_doc);
2019
2019
  return save_ret;
2020
2020
  } catch (err) {
2021
2021
  console.error(err);
@@ -2157,7 +2157,7 @@ export const add_contact = async function (req, job_id, headers) {
2157
2157
  profile_avatar_obj,
2158
2158
  account_profile_info,
2159
2159
  };
2160
- const ret = await db_module.save_couch_doc('xuda_contacts', doc);
2160
+ const ret = await save_contact(uid, doc);
2161
2161
 
2162
2162
  if (!account_info_ret?.data?.profile_avatar) {
2163
2163
  const app_id = await get_account_default_project_id(uid);
@@ -2341,7 +2341,7 @@ export const archive_contact = async function (req) {
2341
2341
  contact_doc.stat_ts = Date.now();
2342
2342
  contact_doc.stat_reason = 'archived by the user';
2343
2343
 
2344
- const contact_save_ret = await db_module.save_couch_doc('xuda_contacts', contact_doc);
2344
+ const contact_save_ret = await save_contact(uid, contact_doc);
2345
2345
 
2346
2346
  return contact_save_ret;
2347
2347
  } catch (err) {
@@ -2363,7 +2363,7 @@ export const delete_contact = async function (req, job_id, headers) {
2363
2363
  contact_doc.stat_ts = Date.now();
2364
2364
  contact_doc.stat_reason = 'deleted by the user';
2365
2365
 
2366
- const contact_save_ret = await db_module.save_couch_doc('xuda_contacts', contact_doc);
2366
+ const contact_save_ret = await save_contact(uid, contact_doc);
2367
2367
  const ai_module = await import(`${module_path}/ai_module/index.mjs`);
2368
2368
  ai_module.delete_depended_chats(uid, contact_id);
2369
2369
  return contact_save_ret;
@@ -2388,7 +2388,7 @@ export const unarchive_contact = async function (req) {
2388
2388
  contact_doc.stat_ts = Date.now();
2389
2389
  contact_doc.stat_reason = 'archived by the user';
2390
2390
 
2391
- const contact_save_ret = await db_module.save_couch_doc('xuda_contacts', contact_doc);
2391
+ const contact_save_ret = await save_contact(uid, contact_doc);
2392
2392
 
2393
2393
  return contact_save_ret;
2394
2394
  } catch (err) {
@@ -2413,7 +2413,7 @@ export const unfriend_contact = async function (req) {
2413
2413
  await db_module.get_couch_doc_native('xuda_team', contact_doc.team_req_id);
2414
2414
 
2415
2415
  contact_doc.team_req_id = null;
2416
- const contact_save_ret = await db_module.save_couch_doc('xuda_contacts', contact_doc);
2416
+ const contact_save_ret = await save_contact(uid, contact_doc);
2417
2417
 
2418
2418
  const req_save_ret = await db_module.save_couch_doc('xuda_team', req_doc);
2419
2419
 
@@ -2432,7 +2432,7 @@ export const pin_contact = async function (req) {
2432
2432
  var contact_doc = await get_contact(uid, contact_id);
2433
2433
  contact_doc.pinned = true;
2434
2434
 
2435
- const contact_save_ret = await db_module.save_couch_doc('xuda_contacts', contact_doc);
2435
+ const contact_save_ret = await save_contact(uid, contact_doc);
2436
2436
 
2437
2437
  global[`_account_module_ch`].sendToQueue(
2438
2438
  'ws_dashboard_module',
@@ -2463,7 +2463,7 @@ export const unpin_contact = async function (req) {
2463
2463
  var contact_doc = await get_contact(uid, contact_id);
2464
2464
  contact_doc.pinned = false;
2465
2465
 
2466
- const contact_save_ret = await db_module.save_couch_doc('xuda_contacts', contact_doc);
2466
+ const contact_save_ret = await save_contact(uid, contact_doc);
2467
2467
 
2468
2468
  global[`_account_module_ch`].sendToQueue(
2469
2469
  'ws_dashboard_module',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1274",
3
+ "version": "1.2.1276",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {