@xuda.io/drive_module 1.1.911 → 1.1.913

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.
Files changed (2) hide show
  1. package/index.js +10 -21
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1697,31 +1697,20 @@ exports.check_drive_file = async function (req, job_id, headers, file_obj) {
1697
1697
  };
1698
1698
 
1699
1699
  const ocr_drive_file = async function (doc) {
1700
- return;
1701
- const { drive_type, target_file } = doc;
1702
- var doc_ret;
1700
+ const { drive_type, target_file, app_id, uid } = doc;
1701
+
1703
1702
  try {
1704
1703
  doc.ocr_stat = 2;
1705
1704
  doc.ocr_stat_date = Date.now();
1706
- switch (drive_type) {
1707
- case "workspace":
1708
- case "studio":
1709
- const app_id_reference = await _common.get_project_app_id(doc.app_id);
1710
- await db_module.save_app_couch_doc(app_id_reference, doc);
1711
- doc_ret = await db_module.get_app_couch_doc(app_id_reference, doc._id);
1712
- break;
1713
-
1714
- case "user":
1715
- await db_module.save_couch_doc("xuda_drive", doc);
1716
- doc_ret = await db_module.get_couch_doc("xuda_drive", doc._id);
1717
- break;
1705
+ const save_ret = await save_drive_doc(drive_type, app_id, doc, file_path);
1718
1706
 
1719
- default:
1720
- throw new Error("drive_type error");
1721
- break;
1722
- }
1723
-
1724
- doc = await get_drive_doc("file", drive_type); //doc_ret.data;
1707
+ doc = await get_drive_doc(
1708
+ "file",
1709
+ drive_type,
1710
+ app_id,
1711
+ uid,
1712
+ path.join(file_path, originalname)
1713
+ );
1725
1714
 
1726
1715
  var ocr = "";
1727
1716
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.911",
3
+ "version": "1.1.913",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {