@xuda.io/account_module 1.2.2220 → 1.2.2222

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 -1
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2716,7 +2716,13 @@ export const generate_contact_avatar = async function (req, job_id, headers) {
2716
2716
  const { contact_id, uid } = req;
2717
2717
  const account_profile_info = await get_active_account_profile_info(uid);
2718
2718
  try {
2719
+ const account_doc = await db_module.get_couch_doc_native('xuda_accounts', uid);
2720
+ if (account_doc.membership_plan == 'free' && account_doc.ai_workspace_plan == 'free_ai_workspace') {
2721
+ throw new Error('cannot read emails for free account');
2722
+ }
2723
+
2719
2724
  var contact_doc = await get_contact(uid, contact_id);
2725
+
2720
2726
  contact_doc.profile_picture_obj = null;
2721
2727
  contact_doc.profile_picture = null;
2722
2728
  contact_doc.profile_avatar_obj = null;
@@ -3656,7 +3662,7 @@ export const record_ai_credit = async function (uid, credits = 0, source, detail
3656
3662
  // console.log(save_ret);
3657
3663
  return save_ret;
3658
3664
  } catch (err) {
3659
- if (!err.message?.includes('already credited!')) {
3665
+ if (!err?.message?.includes('already credited!')) {
3660
3666
  console.error(err);
3661
3667
  }
3662
3668
  return { code: -78, data: err.message };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.2220",
3
+ "version": "1.2.2222",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {