@xuda.io/ai_module 1.1.5547 → 1.1.5548

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 +13 -0
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1221,6 +1221,19 @@ export const get_ai_chats = async function (req, job_id, headers) {
1221
1221
 
1222
1222
  if (!account_profile_info.is_main) {
1223
1223
  opt.selector.account_profiles = { $in: [account_profile_info.account_profile_id] };
1224
+ } else {
1225
+ const active_profiles = await db_module.find_app_couch_query(account_profile_info.app_id, {
1226
+ selector: {
1227
+ docType: 'account_profile',
1228
+ uid: account_profile_info.uid,
1229
+ stat: { $lt: 4 },
1230
+ },
1231
+ fields: ['_id'],
1232
+ limit: 9999,
1233
+ });
1234
+
1235
+ const active_profile_ids = active_profiles.docs.map((profile) => profile._id).filter(Boolean);
1236
+ opt.selector.account_profiles = { $in: active_profile_ids.length ? active_profile_ids : [account_profile_info.account_profile_id] };
1224
1237
  }
1225
1238
 
1226
1239
  switch (filter_type) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.5547",
3
+ "version": "1.1.5548",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",