@xuda.io/account_module 1.2.1310 → 1.2.1312

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 +28 -28
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -504,7 +504,7 @@ export const get_account_data = async function (req) {
504
504
  ai_workspace_plan: acc_obj.ai_workspace_plan,
505
505
  storage_plan_changed: acc_obj.storage_plan_changed,
506
506
  account_project_id: acc_obj.account_project_id,
507
- is_boarded: acc_obj.account_profile_id && acc_obj.account_project_id && acc_obj.ai_workspace_plan && _design.views.ai_chat_usage ? true : false, //acc_obj.isBoarded,
507
+ is_boarded: acc_obj.isBoarded, // acc_obj.account_profile_id && acc_obj.account_project_id && acc_obj.ai_workspace_plan && _design.views.ai_chat_usage ? true : false, //acc_obj.isBoarded,
508
508
 
509
509
  prices_info: acc_obj.prices_info,
510
510
  activity_usage: acc_obj.activity_usage,
@@ -1998,40 +1998,40 @@ export const onboarding_completed = async function (req, job_id, headers) {
1998
1998
  throw new Error(`missing profile_avatar`);
1999
1999
  }
2000
2000
 
2001
- if (!account_doc.account_project_id) {
2002
- 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`);
2003
2003
 
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
- }
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
+ // }
2014
2014
 
2015
2015
  account_doc.account_info.full_name = `${account_doc.account_info.first_name} ${account_doc.account_info.last_name}`;
2016
2016
 
2017
- if (!account_doc.ai_workspace_plan) {
2018
- account_doc.ai_workspace_plan = 'free_ai_workspace';
2019
- }
2017
+ // if (!account_doc.ai_workspace_plan) {
2018
+ // account_doc.ai_workspace_plan = 'free_ai_workspace';
2019
+ // }
2020
2020
 
2021
2021
  //// validate account_profile_id
2022
2022
 
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
- }
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
+ // }
2035
2035
  account_doc.boarded_info = { headers, date_ts: Date.now() };
2036
2036
  account_doc.isBoarded = true;
2037
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.1310",
3
+ "version": "1.2.1312",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {