@xuda.io/ai_module 1.1.3587 → 1.1.3589
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.
- package/index.mjs +17 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1878,7 +1878,7 @@ export const delete_ai_chat = async function (req) {
|
|
|
1878
1878
|
let conversation_doc = await db_module.get_app_couch_doc_native(app_id, conversation_id);
|
|
1879
1879
|
conversation_doc.stat = 4;
|
|
1880
1880
|
conversation_doc.ts = Date.now();
|
|
1881
|
-
const
|
|
1881
|
+
const save_ret = await db_module.save_app_couch_doc(app_id, conversation_doc);
|
|
1882
1882
|
|
|
1883
1883
|
client.conversations.delete(conversation_id);
|
|
1884
1884
|
|
|
@@ -1893,7 +1893,22 @@ export const delete_ai_chat = async function (req) {
|
|
|
1893
1893
|
if (conversation_doc?.chat_image?.[0]) {
|
|
1894
1894
|
drive_module.delete_drive_files({ uid, drive_type: 'user', files_arr: [{ type: 'file', file_path: path.join(conversation_doc.chat_image[0].file_path, conversation_doc.chat_image[0].filename) }] });
|
|
1895
1895
|
}
|
|
1896
|
-
return
|
|
1896
|
+
return save_ret;
|
|
1897
|
+
} catch (err) {
|
|
1898
|
+
return { code: -3, data: err.message };
|
|
1899
|
+
}
|
|
1900
|
+
};
|
|
1901
|
+
export const archive_ai_chat = async function (req) {
|
|
1902
|
+
let { conversation_id, uid } = req;
|
|
1903
|
+
|
|
1904
|
+
const app_id = await account_module.get_account_default_project_id(uid);
|
|
1905
|
+
try {
|
|
1906
|
+
let conversation_doc = await db_module.get_app_couch_doc_native(app_id, conversation_id);
|
|
1907
|
+
conversation_doc.stat = 5;
|
|
1908
|
+
conversation_doc.ts = Date.now();
|
|
1909
|
+
const save_ret = await db_module.save_app_couch_doc(app_id, conversation_doc);
|
|
1910
|
+
|
|
1911
|
+
return save_ret;
|
|
1897
1912
|
} catch (err) {
|
|
1898
1913
|
return { code: -3, data: err.message };
|
|
1899
1914
|
}
|