@xuda.io/account_module 1.2.1226 → 1.2.1228

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 -0
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2684,6 +2684,29 @@ export const get_account_profile_info = async function (uid, contact_profile_doc
2684
2684
  }
2685
2685
  return colour;
2686
2686
  };
2687
+ const get_members = async () => {
2688
+ let members = [];
2689
+ let selector = { docType: 'team_request', team_req_stat: 3, share_item_id: doc._id, access_type: 'account_profile', team_req_from_uid: uid };
2690
+ let ret = await db_module.find_couch_query('xuda_team', { selector });
2691
+ for (const req_obj of ret.docs) {
2692
+ const account_info_ret = await get_account_name({ uid_query: req_obj.team_req_to_uid });
2693
+ const info = await await get_contact_info(uid, account_info_ret.data);
2694
+ members.push(info);
2695
+ }
2696
+ return members;
2697
+ };
2698
+
2699
+ const get_user_account_profiles = async () => {
2700
+ let account_profiles = [];
2701
+ let selector = { docType: 'account_profile', team_req_stat: 3, share_item_id: doc._id, access_type: 'account_profile', team_req_from_uid: uid };
2702
+ let ret = await db_module.find_couch_query('xuda_team', { selector });
2703
+ for (const req_obj of ret.docs) {
2704
+ const account_info_ret = await get_account_name({ uid_query: req_obj.team_req_to_uid });
2705
+ const info = await await get_contact_info(uid, account_info_ret.data);
2706
+ members.push(info);
2707
+ }
2708
+ return members;
2709
+ };
2687
2710
 
2688
2711
  // Usage examples:
2689
2712
  console.log(stringToColour('User A')); // -> Consistent color for "User A"
@@ -2704,6 +2727,9 @@ export const get_account_profile_info = async function (uid, contact_profile_doc
2704
2727
 
2705
2728
  doc.card_background = `linear-gradient(145deg, #242480 0%, #060619 100%)`;
2706
2729
  // doc.border = get_contact_border(doc);
2730
+
2731
+ doc.members = await get_members();
2732
+
2707
2733
  debugger;
2708
2734
  const usage_ret = await get_account_ai_usage({ uid });
2709
2735
  doc.max_credits = usage_ret.data.credits.total;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1226",
3
+ "version": "1.2.1228",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {