@xuda.io/account_module 1.2.1059 → 1.2.1061

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 +47 -47
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2593,14 +2593,14 @@ export const get_account_profiles = async function (req) {
2593
2593
  export const archive_account_profile = async function (req) {
2594
2594
  const { profile_id } = req;
2595
2595
  try {
2596
- var contact_profile_doc = await db_module.get_couch_doc_native('xuda_accounts', profile_id);
2597
- contact_profile_doc.stat = 5;
2598
- contact_profile_doc.stat_ts = Date.now();
2599
- contact_profile_doc.stat_reason = 'archived by the user';
2596
+ var account_profile_doc = await db_module.get_couch_doc_native('xuda_accounts', profile_id);
2597
+ account_profile_doc.stat = 5;
2598
+ account_profile_doc.stat_ts = Date.now();
2599
+ account_profile_doc.stat_reason = 'archived by the user';
2600
2600
 
2601
- const contact_save_ret = await db_module.save_couch_doc('xuda_accounts', contact_profile_doc);
2601
+ const account_profile_save_ret = await db_module.save_couch_doc('xuda_accounts', account_profile_doc);
2602
2602
 
2603
- return contact_save_ret;
2603
+ return account_profile_save_ret;
2604
2604
  } catch (err) {
2605
2605
  return {
2606
2606
  code: -22,
@@ -2609,19 +2609,19 @@ export const archive_account_profile = async function (req) {
2609
2609
  }
2610
2610
  };
2611
2611
 
2612
- export const delete_profile = async function (req, job_id, headers) {
2612
+ export const delete_account_profile = async function (req, job_id, headers) {
2613
2613
  const { profile_id } = req;
2614
2614
  try {
2615
- var contact_profile_doc = await db_module.get_couch_doc_native('xuda_accounts', profile_id);
2615
+ var account_profile_doc = await db_module.get_couch_doc_native('xuda_accounts', profile_id);
2616
2616
 
2617
- contact_profile_doc.stat = 4;
2618
- contact_profile_doc.stat_ts = Date.now();
2619
- contact_profile_doc.stat_reason = 'deleted by the user';
2617
+ account_profile_doc.stat = 4;
2618
+ account_profile_doc.stat_ts = Date.now();
2619
+ account_profile_doc.stat_reason = 'deleted by the user';
2620
2620
 
2621
- const contact_save_ret = await db_module.save_couch_doc('xuda_accounts', contact_profile_doc);
2621
+ const account_profile_save_ret = await db_module.save_couch_doc('xuda_accounts', account_profile_doc);
2622
2622
 
2623
2623
  ai_module.delete_depended_chats(uid, profile_id);
2624
- return contact_save_ret;
2624
+ return account_profile_save_ret;
2625
2625
  } catch (err) {
2626
2626
  return {
2627
2627
  code: -22,
@@ -2630,22 +2630,22 @@ export const delete_profile = async function (req, job_id, headers) {
2630
2630
  }
2631
2631
  };
2632
2632
 
2633
- export const unarchive_profile = async function (req) {
2633
+ export const unarchive_account_profile = async function (req) {
2634
2634
  const { profile_id } = req;
2635
2635
  try {
2636
- var contact_profile_doc = await db_module.get_couch_doc_native('xuda_accounts', profile_id);
2636
+ var account_profile_doc = await db_module.get_couch_doc_native('xuda_accounts', profile_id);
2637
2637
 
2638
- if (contact_profile_doc.stat !== 5) {
2638
+ if (account_profile_doc.stat !== 5) {
2639
2639
  throw new Error('contact is not archived');
2640
2640
  }
2641
2641
 
2642
- contact_profile_doc.stat = 3;
2643
- contact_profile_doc.stat_ts = Date.now();
2644
- contact_profile_doc.stat_reason = 'archived by the user';
2642
+ account_profile_doc.stat = 3;
2643
+ account_profile_doc.stat_ts = Date.now();
2644
+ account_profile_doc.stat_reason = 'archived by the user';
2645
2645
 
2646
- const contact_save_ret = await db_module.save_couch_doc('xuda_accounts', contact_profile_doc);
2646
+ const account_profile_save_ret = await db_module.save_couch_doc('xuda_accounts', account_profile_doc);
2647
2647
 
2648
- return contact_save_ret;
2648
+ return account_profile_save_ret;
2649
2649
  } catch (err) {
2650
2650
  return {
2651
2651
  code: -22,
@@ -2654,33 +2654,33 @@ export const unarchive_profile = async function (req) {
2654
2654
  }
2655
2655
  };
2656
2656
 
2657
- export const unfriend_profile = async function (req) {
2658
- const { profile_id } = req;
2659
- try {
2660
- const contact_ret = await db_module.get_couch_doc('xuda_accounts', profile_id);
2661
- if (contact_ret.code < 0) {
2662
- throw new Error(contact_ret.data);
2663
- }
2664
- var contact_profile_doc = contact_ret.data;
2657
+ // export const unfriend_account_profile = async function (req) {
2658
+ // const { profile_id } = req;
2659
+ // try {
2660
+ // const contact_ret = await db_module.get_couch_doc('xuda_accounts', profile_id);
2661
+ // if (contact_ret.code < 0) {
2662
+ // throw new Error(contact_ret.data);
2663
+ // }
2664
+ // var account_profile_doc = contact_ret.data;
2665
2665
 
2666
- if (!contact_profile_doc.team_req_id) {
2667
- throw new Error('no friend relationship found');
2668
- }
2669
- let req_doc = await db_module.get_couch_doc_native('xuda_team', contact_profile_doc.team_req_id);
2670
- req_doc.team_req_stat = 4;
2671
- req_doc.team_req_stat_desc = 'unfriend by the user';
2672
- await db_module.get_couch_doc_native('xuda_team', contact_profile_doc.team_req_id);
2666
+ // if (!account_profile_doc.team_req_id) {
2667
+ // throw new Error('no friend relationship found');
2668
+ // }
2669
+ // let req_doc = await db_module.get_couch_doc_native('xuda_team', account_profile_doc.team_req_id);
2670
+ // req_doc.team_req_stat = 4;
2671
+ // req_doc.team_req_stat_desc = 'unfriend by the user';
2672
+ // await db_module.get_couch_doc_native('xuda_team', account_profile_doc.team_req_id);
2673
2673
 
2674
- contact_profile_doc.team_req_id = null;
2675
- const contact_save_ret = await db_module.save_couch_doc('xuda_accounts', contact_profile_doc);
2674
+ // account_profile_doc.team_req_id = null;
2675
+ // const account_profile_save_ret = await db_module.save_couch_doc('xuda_accounts', account_profile_doc);
2676
2676
 
2677
- const req_save_ret = await db_module.save_couch_doc('xuda_team', req_doc);
2677
+ // const req_save_ret = await db_module.save_couch_doc('xuda_team', req_doc);
2678
2678
 
2679
- return req_save_ret;
2680
- } catch (err) {
2681
- return {
2682
- code: -21,
2683
- data: err.message,
2684
- };
2685
- }
2686
- };
2679
+ // return req_save_ret;
2680
+ // } catch (err) {
2681
+ // return {
2682
+ // code: -21,
2683
+ // data: err.message,
2684
+ // };
2685
+ // }
2686
+ // };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1059",
3
+ "version": "1.2.1061",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {