@xuda.io/account_module 1.2.1069 → 1.2.1070

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 +25 -1
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2483,6 +2483,30 @@ setTimeout(async () => {
2483
2483
  console.log(ret);
2484
2484
  }, 1000);
2485
2485
 
2486
+ export const get_pending_share_profile_in = async function (uid, _id) {
2487
+ let docs = [];
2488
+ const from_opt = { selector: { docType: 'team_request', access_type: 'profile', team_req_stat: 2, team_req_to_uid: uid }, fields: ['_id', 'team_req_date', 'sender_account_info.email', 'team_req_from_uid', 'share_item_id'] };
2489
+
2490
+ if (_id) {
2491
+ to_opt.selector._id = _id;
2492
+ }
2493
+
2494
+ const requests_from_res = await db_module.find_couch_query('xuda_team', from_opt);
2495
+
2496
+ for await (let e of requests_from_res.docs) {
2497
+ // let doc = { docType: 'contact', date_created: e.team_req_date, email: [e.sender_account_info.email], name: '', pending: true, contact_uid: e.team_req_from_uid, team_req_id: e._id };
2498
+ let doc = await db_module.get_couch_doc_native('xuda_contacts', e.share_item_id);
2499
+ delete doc.contact_mood_level;
2500
+ doc.shared_from_uid = e.team_req_from_uid;
2501
+ doc.pending = true;
2502
+ doc = await get_contact_info(uid, doc);
2503
+ doc.team_req_id = e._id;
2504
+
2505
+ docs.push(doc);
2506
+ }
2507
+ return docs;
2508
+ };
2509
+
2486
2510
  export const get_account_profile_info = async function (uid, contact_profile_doc, _id) {
2487
2511
  const ai_module = await import(`${module_path}/ai_module/index.mjs`);
2488
2512
  let doc = contact_profile_doc;
@@ -2657,7 +2681,7 @@ export const get_account_profiles = async function (req) {
2657
2681
 
2658
2682
  let profile_docs = { docs: [], total_docs: profiles.total_docs };
2659
2683
  for await (let doc of profiles.docs) {
2660
- doc = await get_contact_info(uid, doc);
2684
+ doc = await get_account_profile_info(uid, doc);
2661
2685
 
2662
2686
  profile_docs.docs.push(doc);
2663
2687
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1069",
3
+ "version": "1.2.1070",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {