@xuda.io/account_module 1.2.1530 → 1.2.1532

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 +2 -4
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -3046,7 +3046,7 @@ export const record_ai_usage = async function (uid, input_tokens, output_tokens,
3046
3046
  }
3047
3047
  };
3048
3048
 
3049
- export const record_ai_credit = async function (uid, credits, source, account_profile_info) {
3049
+ export const record_ai_credit = async function (uid, credits = 0, source, account_profile_info) {
3050
3050
  try {
3051
3051
  if (!account_profile_info) throw new Error('missing account_profile_info');
3052
3052
 
@@ -3058,12 +3058,10 @@ export const record_ai_credit = async function (uid, credits, source, account_pr
3058
3058
  date_created_ts: t,
3059
3059
  uid,
3060
3060
  source,
3061
-
3062
3061
  stat: 3,
3063
-
3064
3062
  account_profile_info,
3065
3063
  };
3066
- const save_ret = await db_module.save_couch_doc('xuda_usage', usage_doc);
3064
+ const save_ret = await db_module.save_couch_doc('xuda_billing', usage_doc);
3067
3065
  // console.log(save_ret);
3068
3066
  } catch (err) {
3069
3067
  console.error(err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.1530",
3
+ "version": "1.2.1532",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {