@xuda.io/account_module 1.2.1309 → 1.2.1311

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 +30 -27
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -488,6 +488,9 @@ export const get_account_data = async function (req) {
488
488
  _design = await db_module.get_app_couch_doc_native(acc_obj.account_project_id, '_design/xuda');
489
489
  }
490
490
 
491
+ if (!account_doc.account_profile_id) {
492
+ }
493
+
491
494
  var ret = { code: 1 };
492
495
  ret.data = {
493
496
  _id: acc_obj._id,
@@ -1995,40 +1998,40 @@ export const onboarding_completed = async function (req, job_id, headers) {
1995
1998
  throw new Error(`missing profile_avatar`);
1996
1999
  }
1997
2000
 
1998
- if (!account_doc.account_project_id) {
1999
- const app_module = await import(`${module_path}/app_module/index.mjs`);
2001
+ // if (!account_doc.account_project_id) {
2002
+ // const app_module = await import(`${module_path}/app_module/index.mjs`);
2000
2003
 
2001
- const ret = await app_module.create_project({ token_ret: req.token_ret, uid, data: { app_name: `Account ${uid} main project`, is_account_project: true, app_plugins_purchased: [' @xuda.io/xuda-dbs-plugin-xuda', '@xuda.io/xuda-framework-plugin-tailwind'] } }, job_id, headers);
2002
- if (ret.code > -1) {
2003
- account_doc.account_project_id = ret.data;
2004
- const drive_module = await import(`${module_path}/drive_module/index.mjs`);
2005
- let drive_req = { app_id: account_doc.account_project_id, uid, path: '/' };
2006
- await drive_module.create_drive_folder_user({ ...drive_req, ...{ folder_name: 'Profile Images', is_system: true } }, job_id, headers);
2007
- await drive_module.create_drive_folder_user({ ...drive_req, ...{ folder_name: 'Chat Thumbnails', is_system: true } }, job_id, headers);
2008
- await drive_module.create_drive_folder_user({ ...drive_req, ...{ folder_name: 'Chat Attachments', is_system: true } }, job_id, headers);
2009
- }
2010
- }
2004
+ // const ret = await app_module.create_project({ token_ret: req.token_ret, uid, data: { app_name: `Account ${uid} main project`, is_account_project: true, app_plugins_purchased: [' @xuda.io/xuda-dbs-plugin-xuda', '@xuda.io/xuda-framework-plugin-tailwind'] } }, job_id, headers);
2005
+ // if (ret.code > -1) {
2006
+ // account_doc.account_project_id = ret.data;
2007
+ // const drive_module = await import(`${module_path}/drive_module/index.mjs`);
2008
+ // let drive_req = { app_id: account_doc.account_project_id, uid, path: '/' };
2009
+ // await drive_module.create_drive_folder_user({ ...drive_req, ...{ folder_name: 'Profile Images', is_system: true } }, job_id, headers);
2010
+ // await drive_module.create_drive_folder_user({ ...drive_req, ...{ folder_name: 'Chat Thumbnails', is_system: true } }, job_id, headers);
2011
+ // await drive_module.create_drive_folder_user({ ...drive_req, ...{ folder_name: 'Chat Attachments', is_system: true } }, job_id, headers);
2012
+ // }
2013
+ // }
2011
2014
 
2012
2015
  account_doc.account_info.full_name = `${account_doc.account_info.first_name} ${account_doc.account_info.last_name}`;
2013
2016
 
2014
- if (!account_doc.ai_workspace_plan) {
2015
- account_doc.ai_workspace_plan = 'free_ai_workspace';
2016
- }
2017
+ // if (!account_doc.ai_workspace_plan) {
2018
+ // account_doc.ai_workspace_plan = 'free_ai_workspace';
2019
+ // }
2017
2020
 
2018
2021
  //// validate account_profile_id
2019
2022
 
2020
- if (!account_doc.account_profile_id) {
2021
- const account_profile_ret = await create_account_profile({ uid, profile_name: account_doc.account_info.full_name, main: true });
2022
- account_doc.account_profile_id = account_profile_ret.data.id;
2023
- account_doc.account_info.active_account_profile_id = account_doc.account_profile_id;
2024
- } else {
2025
- let account_profile_ret = await db_module.get_app_couch_doc(account_doc.account_project_id, account_doc.account_profile_id);
2026
- if (account_profile_ret.code < 0) {
2027
- const account_profile_ret = await create_account_profile({ uid, profile_name: account_doc.account_info.full_name, main: true });
2028
- account_doc.account_profile_id = account_profile_ret.data.id;
2029
- account_doc.account_info.active_account_profile_id = account_doc.account_profile_id;
2030
- }
2031
- }
2023
+ // if (!account_doc.account_profile_id) {
2024
+ // const account_profile_ret = await create_account_profile({ uid, profile_name: account_doc.account_info.full_name, main: true });
2025
+ // account_doc.account_profile_id = account_profile_ret.data.id;
2026
+ // account_doc.account_info.active_account_profile_id = account_doc.account_profile_id;
2027
+ // } else {
2028
+ // let account_profile_ret = await db_module.get_app_couch_doc(account_doc.account_project_id, account_doc.account_profile_id);
2029
+ // if (account_profile_ret.code < 0) {
2030
+ // const account_profile_ret = await create_account_profile({ uid, profile_name: account_doc.account_info.full_name, main: true });
2031
+ // account_doc.account_profile_id = account_profile_ret.data.id;
2032
+ // account_doc.account_info.active_account_profile_id = account_doc.account_profile_id;
2033
+ // }
2034
+ // }
2032
2035
  account_doc.boarded_info = { headers, date_ts: Date.now() };
2033
2036
  account_doc.isBoarded = true;
2034
2037
  const save_ret = await db_module.save_couch_doc('xuda_accounts', account_doc);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1309",
3
+ "version": "1.2.1311",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {