@xuda.io/drive_module 1.1.910 → 1.1.912
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 +7 -21
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -98,7 +98,10 @@ exports.get_drive_files = async function (req) {
|
|
|
98
98
|
|
|
99
99
|
let { tags = [] } = req;
|
|
100
100
|
let tags_query = {};
|
|
101
|
-
const sort_by_obj = {
|
|
101
|
+
const sort_by_obj = {
|
|
102
|
+
name: type === "file" ? "originalname" : "folder_name",
|
|
103
|
+
date: "date_created",
|
|
104
|
+
};
|
|
102
105
|
|
|
103
106
|
try {
|
|
104
107
|
let opt = {
|
|
@@ -1694,29 +1697,12 @@ exports.check_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1694
1697
|
};
|
|
1695
1698
|
|
|
1696
1699
|
const ocr_drive_file = async function (doc) {
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
var doc_ret;
|
|
1700
|
+
const { drive_type, target_file, app_id } = doc;
|
|
1701
|
+
|
|
1700
1702
|
try {
|
|
1701
1703
|
doc.ocr_stat = 2;
|
|
1702
1704
|
doc.ocr_stat_date = Date.now();
|
|
1703
|
-
|
|
1704
|
-
case "workspace":
|
|
1705
|
-
case "studio":
|
|
1706
|
-
const app_id_reference = await _common.get_project_app_id(doc.app_id);
|
|
1707
|
-
await db_module.save_app_couch_doc(app_id_reference, doc);
|
|
1708
|
-
doc_ret = await db_module.get_app_couch_doc(app_id_reference, doc._id);
|
|
1709
|
-
break;
|
|
1710
|
-
|
|
1711
|
-
case "user":
|
|
1712
|
-
await db_module.save_couch_doc("xuda_drive", doc);
|
|
1713
|
-
doc_ret = await db_module.get_couch_doc("xuda_drive", doc._id);
|
|
1714
|
-
break;
|
|
1715
|
-
|
|
1716
|
-
default:
|
|
1717
|
-
throw new Error("drive_type error");
|
|
1718
|
-
break;
|
|
1719
|
-
}
|
|
1705
|
+
const save_ret = await save_drive_doc(drive_type, app_id, doc);
|
|
1720
1706
|
|
|
1721
1707
|
doc = await get_drive_doc("file", drive_type); //doc_ret.data;
|
|
1722
1708
|
|