@xuda.io/ai_module 1.1.4092 → 1.1.4094

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 +7 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1920,7 +1920,7 @@ export const delete_ai_chat = async function (req) {
1920
1920
  let conversation_doc = await db_module.get_app_couch_doc_native(app_id, conversation_id);
1921
1921
 
1922
1922
  if (conversation_doc.stat !== 5) {
1923
- throw new Error('document must be archived before deleting');
1923
+ throw new Error('A document can only be deleted after it has been archived');
1924
1924
  }
1925
1925
 
1926
1926
  let save_ret;
@@ -2554,6 +2554,11 @@ export const delete_ai_agent = async function (req) {
2554
2554
 
2555
2555
  try {
2556
2556
  let prog_doc = await db_module.get_app_couch_doc_native(app_id, agent_id);
2557
+
2558
+ if (prog_doc.stat !== 5) {
2559
+ throw new Error('A document can only be deleted after it has been archived');
2560
+ }
2561
+
2557
2562
  let save_ret;
2558
2563
  if (prog_doc.studio_meta.shared_from_uid) {
2559
2564
  // delete the share , the doc will delete by the remove_team_member
@@ -2693,7 +2698,7 @@ export const delete_mini_app = async function (req) {
2693
2698
  let prog_doc = await db_module.get_app_couch_doc_native(app_id, prog_id);
2694
2699
 
2695
2700
  if (prog_doc.stat !== 5) {
2696
- throw new Error('document must be archived before deleting');
2701
+ throw new Error('A document can only be deleted after it has been archived');
2697
2702
  }
2698
2703
 
2699
2704
  let save_ret;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4092",
3
+ "version": "1.1.4094",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",