@xuda.io/ai_module 1.1.4916 → 1.1.4918

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 +12 -14
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -69,6 +69,8 @@ const db_module = await import(`${module_path}/db_module/index.mjs`);
69
69
  const account_ms = await import(`${module_path}/account_module/index_ms.mjs`);
70
70
  const drive_ms = await import(`${module_path}/drive_module/index_ms.mjs`);
71
71
  const jobs_ms = await import(`${module_path}/jobs_module/index_ms.mjs`);
72
+ const team_ms = await import(`${module_path}/team_module/index_ms.mjs`);
73
+ const email_ms = await import(`${module_path}/email_module/index_ms.mjs`);
72
74
 
73
75
  var open_ai_status = {};
74
76
  const report_ai_status = function (model, err) {
@@ -1372,8 +1374,8 @@ export const delete_ai_chat = async function (req) {
1372
1374
 
1373
1375
  if (conversation_doc.shared_from_uid) {
1374
1376
  // delete the share , the doc will delete by the remove_team_member
1375
- const team_module = await import(`${module_path}/team_module/index.mjs`);
1376
- save_ret = await team_module.remove_team_member({ team_req_id: conversation_doc.team_req_id });
1377
+
1378
+ save_ret = await team_ms.remove_team_member({ team_req_id: conversation_doc.team_req_id });
1377
1379
  } else {
1378
1380
  conversation_doc.stat = 4;
1379
1381
  conversation_doc.ts = Date.now();
@@ -1405,8 +1407,7 @@ export const archive_ai_chat = async function (req) {
1405
1407
  const account_profile_info = await account_ms.get_active_account_profile_info(uid);
1406
1408
 
1407
1409
  try {
1408
- const team_module = await import(`${module_path}/team_module/index.mjs`);
1409
- await team_module.validate_share_exist(uid, 'chat', conversation_id);
1410
+ await team_ms.validate_share_exist(uid, 'chat', conversation_id);
1410
1411
 
1411
1412
  let conversation_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, conversation_id);
1412
1413
 
@@ -2021,8 +2022,8 @@ export const delete_ai_agent = async function (req) {
2021
2022
  let save_ret;
2022
2023
  if (prog_doc.studio_meta.shared_from_uid) {
2023
2024
  // delete the share , the doc will delete by the remove_team_member
2024
- const team_module = await import(`${module_path}/team_module/index.mjs`);
2025
- save_ret = await team_module.remove_team_member({ team_req_id: prog_doc.studio_meta.team_req_id });
2025
+
2026
+ save_ret = await team_ms.remove_team_member({ team_req_id: prog_doc.studio_meta.team_req_id });
2026
2027
  } else {
2027
2028
  let agent_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, agent_id);
2028
2029
  agent_doc.stat = 4;
@@ -2095,8 +2096,7 @@ export const archive_ai_agent = async function (req) {
2095
2096
  const account_profile_info = await account_ms.get_active_account_profile_info(uid);
2096
2097
 
2097
2098
  try {
2098
- const team_module = await import(`${module_path}/team_module/index.mjs`);
2099
- await team_module.validate_share_exist(uid, 'ai_agent', agent_id);
2099
+ await team_ms.validate_share_exist(uid, 'ai_agent', agent_id);
2100
2100
 
2101
2101
  let agent_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, agent_id);
2102
2102
 
@@ -2120,8 +2120,7 @@ export const archive_mini_app = async function (req) {
2120
2120
  const account_profile_info = await account_ms.get_active_account_profile_info(uid);
2121
2121
 
2122
2122
  try {
2123
- const team_module = await import(`${module_path}/team_module/index.mjs`);
2124
- await team_module.validate_share_exist(uid, 'miniapp', prog_id);
2123
+ await team_ms.validate_share_exist(uid, 'miniapp', prog_id);
2125
2124
 
2126
2125
  let prog_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, prog_id);
2127
2126
 
@@ -2176,8 +2175,8 @@ export const delete_mini_app = async function (req) {
2176
2175
  let save_ret;
2177
2176
  if (prog_doc.studio_meta.shared_from_uid) {
2178
2177
  // delete the share , the doc will delete by the remove_team_member
2179
- const team_module = await import(`${module_path}/team_module/index.mjs`);
2180
- save_ret = await team_module.remove_team_member({ team_req_id: prog_doc.studio_meta.team_req_id });
2178
+
2179
+ save_ret = await team_ms.remove_team_member({ team_req_id: prog_doc.studio_meta.team_req_id });
2181
2180
  } else {
2182
2181
  prog_doc.stat = 4;
2183
2182
  prog_doc.ts = Date.now();
@@ -3839,8 +3838,7 @@ const chat_email = async function (req, job_id, headers) {
3839
3838
  email_attachments.push(await save_drive_file_to_disk(attachment));
3840
3839
  }
3841
3840
 
3842
- const email_module = await import(`${module_path}/email_module/index.mjs`);
3843
- sent_email_result = await email_module.sendEmailFromAccount(email_account_doc, contact_info.email, subject, body, null, email_attachments);
3841
+ sent_email_result = await email_ms.sendEmailFromAccount(email_account_doc, contact_info.email, subject, body, null, email_attachments);
3844
3842
  if (!sent_email_result.success) {
3845
3843
  throw new Error('error sending email');
3846
3844
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4916",
3
+ "version": "1.1.4918",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",