@xuda.io/drive_module 1.1.844 → 1.1.846
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.js +23 -22
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1478,12 +1478,7 @@ exports.check_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1478
1478
|
const workspace_drive_res = await db_module.find_app_couch_query(
|
|
1479
1479
|
master_app_id,
|
|
1480
1480
|
{
|
|
1481
|
-
selector
|
|
1482
|
-
docType: "workspace_drive",
|
|
1483
|
-
originalname: path.basename(file_path),
|
|
1484
|
-
file_path: path.dirname(file_path),
|
|
1485
|
-
stat: 3,
|
|
1486
|
-
},
|
|
1481
|
+
selector,
|
|
1487
1482
|
limit: 99,
|
|
1488
1483
|
}
|
|
1489
1484
|
);
|
|
@@ -1500,13 +1495,7 @@ exports.check_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1500
1495
|
case "user": {
|
|
1501
1496
|
selector.docType = "user_drive";
|
|
1502
1497
|
const user_drive_res = await db_module.find_couch_query("xuda_drive", {
|
|
1503
|
-
selector
|
|
1504
|
-
docType: "user_drive",
|
|
1505
|
-
originalname: path.basename(file_path),
|
|
1506
|
-
file_path: path.dirname(file_path),
|
|
1507
|
-
uid,
|
|
1508
|
-
stat: 3,
|
|
1509
|
-
},
|
|
1498
|
+
selector,
|
|
1510
1499
|
limit: 99,
|
|
1511
1500
|
});
|
|
1512
1501
|
if (user_drive_res.docs.length) {
|
|
@@ -1732,6 +1721,17 @@ exports.search_drive_files = async function (req) {
|
|
|
1732
1721
|
|
|
1733
1722
|
const sort_by_obj = { name: "originalname", date: "date_created" };
|
|
1734
1723
|
|
|
1724
|
+
search_string.split(" ").reduce((ret, val) => {
|
|
1725
|
+
var tagKey = val.split(":")[0];
|
|
1726
|
+
var tagVal = val.split(":")[1];
|
|
1727
|
+
|
|
1728
|
+
if (!ret[tagKey]) ret[tagKey] = [];
|
|
1729
|
+
|
|
1730
|
+
ret[tagKey].push({ $or: tagVal });
|
|
1731
|
+
|
|
1732
|
+
return ret;
|
|
1733
|
+
}, {});
|
|
1734
|
+
|
|
1735
1735
|
try {
|
|
1736
1736
|
validate_drive_type(drive_type);
|
|
1737
1737
|
|
|
@@ -2222,15 +2222,6 @@ const get_file_url = function (drive_type, file_name, ref) {
|
|
|
2222
2222
|
return file_url;
|
|
2223
2223
|
};
|
|
2224
2224
|
|
|
2225
|
-
setTimeout(async function () {
|
|
2226
|
-
// console.log(
|
|
2227
|
-
// await exports.search_drive_files({
|
|
2228
|
-
// app_id: "prj3937cb6f9a31c8c7dea25055bba845b1",
|
|
2229
|
-
// drive_type: "workspace",
|
|
2230
|
-
// })
|
|
2231
|
-
// );
|
|
2232
|
-
}, 2000);
|
|
2233
|
-
|
|
2234
2225
|
const get_drive_doc = async function (
|
|
2235
2226
|
type,
|
|
2236
2227
|
drive_type,
|
|
@@ -2353,3 +2344,13 @@ const save_drive_doc = async function (drive_type, app_id, doc) {
|
|
|
2353
2344
|
|
|
2354
2345
|
return save_ret;
|
|
2355
2346
|
};
|
|
2347
|
+
|
|
2348
|
+
setTimeout(async function () {
|
|
2349
|
+
console.log(
|
|
2350
|
+
await exports.search_drive_files({
|
|
2351
|
+
app_id: "prj3937cb6f9a31c8c7dea25055bba845b1",
|
|
2352
|
+
drive_type: "workspace",
|
|
2353
|
+
search_string: "tag:mediucal tag:school name:dw name:dawdddaw d",
|
|
2354
|
+
})
|
|
2355
|
+
);
|
|
2356
|
+
}, 2000);
|