@xuda.io/account_module 1.2.2044 → 1.2.2046

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 +7 -20
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2450,8 +2450,7 @@ export const get_contacts = async function (req, job_id, headers) {
2450
2450
  export const archive_contact = async function (req) {
2451
2451
  const { uid, contact_id } = req;
2452
2452
  try {
2453
- const team_module = await import(`${module_path}/team_module/index.mjs`);
2454
- await team_module.validate_share_exist(uid, 'contact', contact_id);
2453
+ await team_ms.validate_share_exist(uid, 'contact', contact_id);
2455
2454
 
2456
2455
  var contact_doc = await get_contact(uid, contact_id);
2457
2456
 
@@ -2636,8 +2635,6 @@ export const unpin_contact = async function (req) {
2636
2635
  };
2637
2636
 
2638
2637
  export const not_spam_contact = async function (req, job_id, headers) {
2639
- const email_module = await import(`${module_path}/email_module/index.mjs`);
2640
-
2641
2638
  const { contact_id, uid } = req;
2642
2639
  const account_profile_info = await get_active_account_profile_info(uid);
2643
2640
  try {
@@ -2697,7 +2694,7 @@ export const not_spam_contact = async function (req, job_id, headers) {
2697
2694
  // summarized_body
2698
2695
  req.uid = email.uid;
2699
2696
  req.email_id = email._id;
2700
- await email_module.process_pending_email(req, job_id, headers);
2697
+ await email_ms.process_pending_email(req, job_id, headers);
2701
2698
  }
2702
2699
 
2703
2700
  return contact_save_ret;
@@ -3109,8 +3106,8 @@ export const archive_account_profile = async function (req) {
3109
3106
  const { uid, profile_id } = req;
3110
3107
  try {
3111
3108
  const app_id = await get_account_default_project_id(uid);
3112
- const team_module = await import(`${module_path}/team_module/index.mjs`);
3113
- await team_module.validate_share_exist(uid, 'account_profile', profile_id);
3109
+
3110
+ await team_ms.validate_share_exist(uid, 'account_profile', profile_id);
3114
3111
 
3115
3112
  var account_profile_doc = await db_module.get_app_couch_doc_native(app_id, profile_id);
3116
3113
 
@@ -3125,9 +3122,6 @@ export const archive_account_profile = async function (req) {
3125
3122
  const account_profile_save_ret = await db_module.save_app_couch_doc(app_id, account_profile_doc);
3126
3123
 
3127
3124
  return account_profile_save_ret;
3128
- // } else {
3129
- // return await team_module.change_account_profile_dependencies_status(account_profile_doc.team_req_id, 5);
3130
- // }
3131
3125
  } catch (err) {
3132
3126
  return {
3133
3127
  code: -22,
@@ -3164,7 +3158,7 @@ export const unarchive_account_profile = async function (req) {
3164
3158
  const { profile_id } = req;
3165
3159
  try {
3166
3160
  const app_id = await get_account_default_project_id(uid);
3167
- // const team_module = await import(`${module_path}/team_module/index.mjs`);
3161
+
3168
3162
  var account_profile_doc = await db_module.get_app_couch_doc_native(app_id, profile_id);
3169
3163
 
3170
3164
  if (account_profile_doc.stat !== 5) {
@@ -3179,9 +3173,6 @@ export const unarchive_account_profile = async function (req) {
3179
3173
 
3180
3174
  return account_profile_save_ret;
3181
3175
  }
3182
- // else {
3183
- // return await team_module.change_account_profile_dependencies_status(account_profile_doc.team_req_id, 3);
3184
- // }
3185
3176
  } catch (err) {
3186
3177
  return {
3187
3178
  code: -22,
@@ -3491,22 +3482,18 @@ export const archive_expire_ai_credits = async function () {
3491
3482
  };
3492
3483
 
3493
3484
  export const read_accounts_emails = async function () {
3494
- const email_module = await import(`${module_path}/email_module/index.mjs`);
3495
-
3496
3485
  const active_accounts = await db_module.find_couch_query('xuda_accounts', { selector: { stat: 3, docType: 'account' }, limit: 99999 });
3497
3486
  for await (let account_doc of active_accounts.docs) {
3498
3487
  if (!account_doc?.account_info?.active_account_profile_id) continue;
3499
- email_module.refresh_mailboxes({ uid: account_doc._id });
3488
+ email_ms.refresh_mailboxes({ uid: account_doc._id });
3500
3489
  }
3501
3490
  };
3502
3491
 
3503
3492
  export const process_accounts_emails = async function () {
3504
- const email_module = await import(`${module_path}/email_module/index.mjs`);
3505
-
3506
3493
  const active_accounts = await db_module.find_couch_query('xuda_accounts', { selector: { stat: 3, docType: 'account' }, limit: 99999 });
3507
3494
  for await (let account_doc of active_accounts.docs) {
3508
3495
  if (!account_doc?.account_info?.active_account_profile_id) continue;
3509
- email_module.process_emails({ uid: account_doc._id });
3496
+ email_ms.process_emails({ uid: account_doc._id });
3510
3497
  }
3511
3498
  };
3512
3499
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.2044",
3
+ "version": "1.2.2046",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {