@xuda.io/ai_module 1.1.4219 → 1.1.4221

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 -5
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2417,7 +2417,7 @@ export const get_ai_agents = async function (req, job_id, headers) {
2417
2417
  };
2418
2418
 
2419
2419
  if (!account_profile_info.is_main) {
2420
- opt.selector.studio_meta.account_profiles = { $in: [account_profile_info.account_profile_id] };
2420
+ opt.selector['studio_meta.account_profiles'] = { $in: [account_profile_info.account_profile_id] };
2421
2421
  }
2422
2422
 
2423
2423
  switch (filter_type) {
@@ -2817,8 +2817,8 @@ export const update_ai_agent = async function (req, job_id, headers) {
2817
2817
  // };
2818
2818
 
2819
2819
  export const get_apps = async function (req, job_id, headers) {
2820
- let { uid, _id, search, filter_type = 'all', limit, skip, mini_app_id } = req;
2821
-
2820
+ let { uid, _id, search, filter_type = 'all', limit, skip, mini_app_id, profile_id } = req;
2821
+ const account_profile_info = await account_module.get_active_account_profile_info(uid, profile_id);
2822
2822
  try {
2823
2823
  if (_id) return await get_studio_doc({ _id, uid });
2824
2824
  ///////////////
@@ -2833,6 +2833,10 @@ export const get_apps = async function (req, job_id, headers) {
2833
2833
  sort: [{ ts: 'desc' }],
2834
2834
  };
2835
2835
 
2836
+ if (!account_profile_info.is_main) {
2837
+ opt.selector['studio_meta.account_profiles'] = { $in: [account_profile_info.account_profile_id] };
2838
+ }
2839
+
2836
2840
  switch (filter_type) {
2837
2841
  case 'archived': {
2838
2842
  opt.selector.stat = 5;
@@ -2881,8 +2885,8 @@ export const get_apps = async function (req, job_id, headers) {
2881
2885
  opt.selector._id = mini_app_id;
2882
2886
  }
2883
2887
  //////////////
2884
- const account_profile_info = await account_module.get_active_account_profile_info(uid);
2885
- const app_id = await account_module.get_account_default_project_id(uid);
2888
+
2889
+ // const app_id = await account_module.get_account_default_project_id(uid);
2886
2890
 
2887
2891
  let user_apps = { docs: [], total_docs: 0 };
2888
2892
  if (filter_type !== 'pending') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4219",
3
+ "version": "1.1.4221",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",