@xuda.io/ai_module 1.1.4091 → 1.1.4093

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 +10 -0
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1918,6 +1918,11 @@ export const delete_ai_chat = async function (req) {
1918
1918
 
1919
1919
  const app_id = await account_module.get_account_default_project_id(uid);
1920
1920
  let conversation_doc = await db_module.get_app_couch_doc_native(app_id, conversation_id);
1921
+
1922
+ if (conversation_doc.stat !== 5) {
1923
+ throw new Error('document must be archived before deleting');
1924
+ }
1925
+
1921
1926
  let save_ret;
1922
1927
  try {
1923
1928
  if (conversation_doc.shared_from_uid) {
@@ -2549,6 +2554,11 @@ export const delete_ai_agent = async function (req) {
2549
2554
 
2550
2555
  try {
2551
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('document must be archived before deleting');
2560
+ }
2561
+
2552
2562
  let save_ret;
2553
2563
  if (prog_doc.studio_meta.shared_from_uid) {
2554
2564
  // delete the share , the doc will delete by the remove_team_member
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4091",
3
+ "version": "1.1.4093",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",