@xuda.io/account_module 1.2.1600 → 1.2.1602

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 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1931,8 +1931,8 @@ setTimeout(async () => {
1931
1931
 
1932
1932
  export const add_contact = async function (req, job_id, headers) {
1933
1933
  try {
1934
- const { uid, email, name, stat, contact_uid, context, source, team_req_id, metadata = {} } = req;
1935
- const account_profile_info = await get_active_account_profile_info(uid);
1934
+ const { profile_id, uid, email, name, stat, contact_uid, context, source, team_req_id, metadata = {} } = req;
1935
+ const account_profile_info = await get_active_account_profile_info(uid, profile_id);
1936
1936
  const { account_profile_obj } = account_profile_info;
1937
1937
 
1938
1938
  const ai_module = await import(`${module_path}/ai_module/index.mjs`);
@@ -3163,3 +3163,13 @@ export const read_accounts_emails = async function () {
3163
3163
  email_module.refresh_mailboxes({ uid: account_doc._id });
3164
3164
  }
3165
3165
  };
3166
+
3167
+ export const process_accounts_emails = async function () {
3168
+ const email_module = await import(`${module_path}/email_module/index.mjs`);
3169
+
3170
+ const active_accounts = await db_module.find_couch_query('xuda_accounts', { selector: { stat: 3, docType: 'account' }, limit: 99999 });
3171
+ for await (let account_doc of active_accounts.docs) {
3172
+ if (!account_doc?.account_info?.active_account_profile_id) continue;
3173
+ email_module.process_emails({ uid: account_doc._id });
3174
+ }
3175
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1600",
3
+ "version": "1.2.1602",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {