@xuda.io/account_module 1.2.2058 → 1.2.2060

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.
@@ -0,0 +1,21 @@
1
+ const db_module = await import(`${module_path}/db_module/index.mjs`);
2
+
3
+ export const get_active_account_profile_info = async function (uid, profile_id) {
4
+ try {
5
+ const acc_obj = await db_module.get_couch_doc_native('xuda_accounts', uid);
6
+
7
+ let active_account_profile_id = profile_id || acc_obj.account_info.active_account_profile_id;
8
+
9
+ const account_profile_obj = await db_module.get_app_couch_doc_native(acc_obj.account_project_id, active_account_profile_id);
10
+ if (account_profile_obj.share_item_id) {
11
+ // set the original profile id if shared
12
+ active_account_profile_id = account_profile_obj.share_item_id;
13
+ }
14
+ const app_id = await get_account_default_project_id(account_profile_obj.shared_from_uid || account_profile_obj.uid);
15
+
16
+ return { uid: account_profile_obj.shared_from_uid || uid, account_profile_id: active_account_profile_id, app_id, is_main: active_account_profile_id === acc_obj.account_profile_id, account_profile_obj };
17
+ } catch (err) {
18
+ console.error('**** get_active_account_profile_info', err);
19
+ debugger;
20
+ }
21
+ };
package/index_ms.mjs CHANGED
@@ -6,7 +6,6 @@
6
6
 
7
7
  import path from 'node:path';
8
8
 
9
- //const _ms_broker = await import(path.join(process.env.XUDA_HOME, 'common', 'ms_broker.mjs'));
10
9
  const { MessageBroker } = await import(path.join(process.env.XUDA_HOME, 'common', 'ms_broker.mjs'));
11
10
 
12
11
  const broker = new MessageBroker();
@@ -16,7 +15,6 @@
16
15
  module_in: global.module_in
17
16
  });
18
17
 
19
- //_ms_broker.init({queueName:'account_module'})
20
18
 
21
19
 
22
20
  export const update_account_info = async function (...args) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.2058",
3
+ "version": "1.2.2060",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {