@xuda.io/ai_module 1.1.4188 → 1.1.4190

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 -12
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2081,16 +2081,6 @@ const get_studio_doc = async function (req) {
2081
2081
  } catch (err) {
2082
2082
  return { code: -7, data: err.message };
2083
2083
  }
2084
-
2085
- // const db = get_xuda_couch('xuda_contacts');
2086
-
2087
- // try {
2088
- // let data = await db.get(_id);
2089
- // if (!['ai_agent', 'chat_conversation'].includes(data.docType)) throw new Error('doctype not supported');
2090
- // return { code: 1, data };
2091
- // } catch (err) {
2092
- // return { code: -1, data: err.message };
2093
- // }
2094
2084
  };
2095
2085
 
2096
2086
  export const get_ai_agent_info = async function (uid, job_id, headers, doc, from_marketplace) {
@@ -2661,7 +2651,7 @@ export const archive_ai_agent = async function (req) {
2661
2651
 
2662
2652
  let agent_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, agent_id);
2663
2653
 
2664
- if (agent_doc.uid !== uid && agent_doc?.account_profile_info?.uid !== uid) {
2654
+ if (agent_doc.studio_meta.createdByUid !== uid && agent_doc?.studio_meta?.account_profile_info?.uid !== uid) {
2665
2655
  throw new Error('Operation not allowed');
2666
2656
  }
2667
2657
 
@@ -2686,7 +2676,7 @@ export const archive_mini_app = async function (req) {
2686
2676
 
2687
2677
  let prog_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, prog_id);
2688
2678
 
2689
- if (prog_doc.uid !== uid && prog_doc?.account_profile_info?.uid !== uid) {
2679
+ if (agent_doc.studio_meta.createdByUid !== uid && agent_doc?.studio_meta?.account_profile_info?.uid !== uid) {
2690
2680
  throw new Error('Operation not allowed');
2691
2681
  }
2692
2682
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4188",
3
+ "version": "1.1.4190",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",