@xuda.io/ai_module 1.1.3546 → 1.1.3548
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 +20 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1714,7 +1714,7 @@ export const get_chat_conversation = async function (req) {
|
|
|
1714
1714
|
};
|
|
1715
1715
|
|
|
1716
1716
|
export const get_ai_chats = async function (req, job_id, headers) {
|
|
1717
|
-
let { uid, reference_id, _id, search,
|
|
1717
|
+
let { uid, reference_id, _id, search, filter_type = 'all', conversation_type, limit, skip } = req;
|
|
1718
1718
|
|
|
1719
1719
|
const get_conversation_background = function (doc) {
|
|
1720
1720
|
let deg = 145;
|
|
@@ -1751,7 +1751,7 @@ export const get_ai_chats = async function (req, job_id, headers) {
|
|
|
1751
1751
|
|
|
1752
1752
|
try {
|
|
1753
1753
|
if (_id) return await get_ai_doc({ _id, uid });
|
|
1754
|
-
|
|
1754
|
+
//archived, pending, shared
|
|
1755
1755
|
let opt = {
|
|
1756
1756
|
selector: {
|
|
1757
1757
|
docType: 'chat_conversation',
|
|
@@ -1777,6 +1777,24 @@ export const get_ai_chats = async function (req, job_id, headers) {
|
|
|
1777
1777
|
opt.selector.shared_from_uid = { $gt: null };
|
|
1778
1778
|
}
|
|
1779
1779
|
|
|
1780
|
+
if (search) {
|
|
1781
|
+
opt.selector = {
|
|
1782
|
+
...opt.selector,
|
|
1783
|
+
$or: [
|
|
1784
|
+
{
|
|
1785
|
+
title: {
|
|
1786
|
+
$regex: `(?i)${search}`,
|
|
1787
|
+
},
|
|
1788
|
+
},
|
|
1789
|
+
{
|
|
1790
|
+
_id: {
|
|
1791
|
+
$regex: `(?i)${search}`,
|
|
1792
|
+
},
|
|
1793
|
+
},
|
|
1794
|
+
],
|
|
1795
|
+
};
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1780
1798
|
const app_id = await account_module.get_account_default_project_id(uid);
|
|
1781
1799
|
|
|
1782
1800
|
////// FROM - IN
|