@xuda.io/account_module 1.2.1540 → 1.2.1542

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 +14 -3
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -55,7 +55,7 @@ export const update_account_info = async function (req, job_id, headers) {
55
55
 
56
56
  // delete data.profile_avatar;
57
57
 
58
- const account_profile_info = await get_active_account_profile_info(uid);
58
+ // const account_profile_info = await get_active_account_profile_info(uid);
59
59
 
60
60
  function validate_input(string, max_length, is_mandatory, is_pass) {
61
61
  if (!/^[a-zA-Z0-9,.@ ]*$/.test(string) && !is_pass) {
@@ -84,7 +84,9 @@ export const update_account_info = async function (req, job_id, headers) {
84
84
  let val = data[key];
85
85
  if (typeof val === 'undefined') continue;
86
86
  if (account_obj.account_info[key] !== val) {
87
- change += ' from ' + account_obj.account_info[key] + ' to ' + val;
87
+ if (!key.includes('obj')) {
88
+ change += ' from ' + account_obj.account_info[key] + ' to ' + val;
89
+ }
88
90
  account_info_changes_arr.push(key);
89
91
 
90
92
  if (key === 'profile_picture') {
@@ -3048,7 +3050,16 @@ export const record_ai_usage = async function (uid, input_tokens, output_tokens,
3048
3050
 
3049
3051
  export const record_ai_credit = async function (uid, credits = 0, source, details, credited_uid) {
3050
3052
  try {
3051
- // if (!account_profile_info) throw new Error('missing account_profile_info');
3053
+ var dup = await db_module.find_app_couch_query(app_id, {
3054
+ selector: {
3055
+ docType: 'ai_credit',
3056
+ credited_uid,
3057
+ details,
3058
+ },
3059
+ fields: ['message.seq'],
3060
+ limit: 1,
3061
+ sort: [{ 'message.seq': 'desc' }],
3062
+ });
3052
3063
 
3053
3064
  const t = Date.now();
3054
3065
  let credit_doc = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1540",
3
+ "version": "1.2.1542",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {