@xuda.io/drive_module 1.1.809 → 1.1.810
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 +2 -30
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1394,12 +1394,7 @@ exports.extract_drive_file = async function (req, job_id, headers) {
|
|
|
1394
1394
|
const app_id_master = await _common.get_project_app_id(app_id, true);
|
|
1395
1395
|
const app_id_reference = await _common.get_project_app_id(app_id);
|
|
1396
1396
|
|
|
1397
|
-
|
|
1398
|
-
return {
|
|
1399
|
-
code: -400,
|
|
1400
|
-
data: "error - file_path unauthorized",
|
|
1401
|
-
};
|
|
1402
|
-
}
|
|
1397
|
+
let doc = await get_drive_doc(drive_type, app_id, uid, file_path, headers);
|
|
1403
1398
|
|
|
1404
1399
|
const ext = path.extname(file_path).toLowerCase();
|
|
1405
1400
|
|
|
@@ -1412,30 +1407,7 @@ exports.extract_drive_file = async function (req, job_id, headers) {
|
|
|
1412
1407
|
}
|
|
1413
1408
|
|
|
1414
1409
|
try {
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
switch (drive_type) {
|
|
1418
|
-
case "workspace":
|
|
1419
|
-
case "studio":
|
|
1420
|
-
const app_id_reference = await _common.get_project_app_id(app_id);
|
|
1421
|
-
doc_ret = await db_module.get_app_couch_doc(app_id_reference, file_id);
|
|
1422
|
-
break;
|
|
1423
|
-
|
|
1424
|
-
case "user":
|
|
1425
|
-
doc_ret = await db_module.get_couch_doc("xuda_drive", file_id);
|
|
1426
|
-
break;
|
|
1427
|
-
|
|
1428
|
-
default:
|
|
1429
|
-
break;
|
|
1430
|
-
}
|
|
1431
|
-
|
|
1432
|
-
if (doc_ret.code < 0) {
|
|
1433
|
-
return doc_ret;
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
const doc = doc_ret.data;
|
|
1437
|
-
|
|
1438
|
-
const extract_dir = file_path.replace(file_id, "");
|
|
1410
|
+
const extract_dir = path.dirname(file_path);
|
|
1439
1411
|
|
|
1440
1412
|
fs.createReadStream(file_path)
|
|
1441
1413
|
.pipe(unzipper.Parse())
|