@xuda.io/ai_module 1.1.3547 → 1.1.3549
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 +12 -3
- 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',
|
|
@@ -1762,8 +1762,17 @@ export const get_ai_chats = async function (req, job_id, headers) {
|
|
|
1762
1762
|
skip: skip || 0,
|
|
1763
1763
|
};
|
|
1764
1764
|
|
|
1765
|
+
switch (filter_type) {
|
|
1766
|
+
case '': {
|
|
1767
|
+
break;
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
default:
|
|
1771
|
+
break;
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1765
1774
|
if (archived) {
|
|
1766
|
-
opt.selector.stat =
|
|
1775
|
+
opt.selector.stat = 0;
|
|
1767
1776
|
}
|
|
1768
1777
|
|
|
1769
1778
|
if (conversation_type) {
|