@xuda.io/account_module 1.2.1834 → 1.2.1836

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 +6 -3
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2785,14 +2785,16 @@ export const unpin_contact = async function (req) {
2785
2785
  }
2786
2786
  };
2787
2787
 
2788
- export const not_spam_contact = async function (req) {
2788
+ export const not_spam_contact = async function (req, job_id, headers) {
2789
2789
  const { contact_id, uid } = req;
2790
+ const account_profile_info = await get_active_account_profile_info(uid);
2790
2791
  try {
2791
2792
  var contact_doc = await get_contact(uid, contact_id);
2792
2793
  contact_doc.is_spam = false;
2793
2794
 
2794
2795
  const contact_save_ret = await save_contact(uid, contact_doc);
2795
- delete_xuda_cache(contact_doc);
2796
+ await delete_xuda_cache(contact_doc);
2797
+ set_contact_profile_picture(uid, contact_doc._id, {}, job_id, headers, account_profile_info);
2796
2798
 
2797
2799
  return contact_save_ret;
2798
2800
  } catch (err) {
@@ -3371,7 +3373,7 @@ export const save_cache_hit = async function (_id) {
3371
3373
  }
3372
3374
  };
3373
3375
 
3374
- export const record_ai_usage = async function (uid, input_tokens, output_tokens, source, prompt, model, metadata = {}, account_profile_info) {
3376
+ export const record_ai_usage = async function (uid, input_tokens, output_tokens, source, prompt, model, metadata = {}, account_profile_info, tools) {
3375
3377
  try {
3376
3378
  if (!account_profile_info) throw new Error('missing account_profile_info');
3377
3379
 
@@ -3395,6 +3397,7 @@ export const record_ai_usage = async function (uid, input_tokens, output_tokens,
3395
3397
  model,
3396
3398
  cost,
3397
3399
  account_profile_info,
3400
+ tools,
3398
3401
  };
3399
3402
  const save_ret = await db_module.save_couch_doc('xuda_usage', usage_doc);
3400
3403
  // console.log(save_ret);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1834",
3
+ "version": "1.2.1836",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {