@xuda.io/account_module 1.2.2171 → 1.2.2173

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 +9 -3
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -3389,8 +3389,14 @@ export const get_account_ai_usage = async function (req, job_id, headers) {
3389
3389
  try {
3390
3390
  const app_id = await get_account_default_project_id(uid);
3391
3391
 
3392
- const timestamp_from = new Date(Number(year_from) || year, (Number(month_from) || month) - 1, Number(day_from) || day).getTime();
3393
- const timestamp_to = new Date(Number(year_to) || year, (Number(month_to) || month) - 1, Number(day_to) || day).getTime();
3392
+ // const timestamp_from = new Date(Number(year_from) || year, (Number(month_from) || month) - 1, Number(day_from) || day).getTime();
3393
+ // const timestamp_to = new Date(Number(year_to) || year, (Number(month_to) || month) - 1, Number(day_to) || day).getTime();
3394
+
3395
+ // BEGINNING OF DAY (00:00:00.000)
3396
+ const timestamp_from = new Date(Number(year_from) || year, (Number(month_from) || month) - 1, Number(day_from) || day).setHours(0, 0, 0, 0);
3397
+
3398
+ // END OF DAY (23:59:59.999)
3399
+ const timestamp_to = new Date(Number(year_to) || year, (Number(month_to) || month) - 1, Number(day_to) || day).setHours(23, 59, 59, 999);
3394
3400
 
3395
3401
  const query = {
3396
3402
  // include_docs: true,
@@ -3575,7 +3581,7 @@ export const record_ai_usage = async function (uid, input_tokens, output_tokens,
3575
3581
  tools,
3576
3582
  };
3577
3583
  const save_ret = await db_module.save_couch_doc('xuda_usage', usage_doc);
3578
- // console.log(save_ret);
3584
+ console.log(save_ret);
3579
3585
  } catch (err) {
3580
3586
  console.error(err);
3581
3587
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.2171",
3
+ "version": "1.2.2173",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {