@xuda.io/drive_module 1.1.565 → 1.1.567
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 +9 -40
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1558,11 +1558,6 @@ exports.check_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1558
1558
|
};
|
|
1559
1559
|
}
|
|
1560
1560
|
|
|
1561
|
-
return {
|
|
1562
|
-
code: 764,
|
|
1563
|
-
data: "ok",
|
|
1564
|
-
};
|
|
1565
|
-
|
|
1566
1561
|
break;
|
|
1567
1562
|
}
|
|
1568
1563
|
case "workspace": {
|
|
@@ -1576,26 +1571,12 @@ exports.check_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1576
1571
|
});
|
|
1577
1572
|
if (workspace_drive_res.docs.length) {
|
|
1578
1573
|
return {
|
|
1579
|
-
code: -
|
|
1580
|
-
data: "file
|
|
1574
|
+
code: -764,
|
|
1575
|
+
data: "file exist",
|
|
1581
1576
|
duplicates: workspace_drive_res.docs,
|
|
1582
1577
|
};
|
|
1583
1578
|
}
|
|
1584
1579
|
|
|
1585
|
-
doc.bucket = {
|
|
1586
|
-
[`${process.env.XUDA_HOSTNAME}`]: await upload_file_to_spaces(
|
|
1587
|
-
tempPath,
|
|
1588
|
-
ref,
|
|
1589
|
-
drive_type,
|
|
1590
|
-
file_name
|
|
1591
|
-
),
|
|
1592
|
-
};
|
|
1593
|
-
doc._id = file_name;
|
|
1594
|
-
save_ret = await db_module.save_app_couch_doc(
|
|
1595
|
-
await _common.get_project_app_id(req.app_id),
|
|
1596
|
-
doc
|
|
1597
|
-
);
|
|
1598
|
-
misc_module.rsync_drive_resources_to_remote_servers("workspace", app_id);
|
|
1599
1580
|
break;
|
|
1600
1581
|
}
|
|
1601
1582
|
case "user": {
|
|
@@ -1606,35 +1587,23 @@ exports.check_drive_file = async function (req, job_id, headers, file_obj) {
|
|
|
1606
1587
|
});
|
|
1607
1588
|
if (user_drive_res.docs.length) {
|
|
1608
1589
|
return {
|
|
1609
|
-
code: -
|
|
1610
|
-
data: "file
|
|
1590
|
+
code: -764,
|
|
1591
|
+
data: "file exist",
|
|
1611
1592
|
duplicates: user_drive_res.docs,
|
|
1612
1593
|
};
|
|
1613
1594
|
}
|
|
1614
1595
|
|
|
1615
|
-
ref = uid;
|
|
1616
|
-
file_name =
|
|
1617
|
-
"drv_" + ref + "_" + (await _common.xuda_get_uuid(drive_type)) + ext;
|
|
1618
|
-
|
|
1619
|
-
doc.server_file_name = file_name;
|
|
1620
|
-
|
|
1621
|
-
doc.bucket = {
|
|
1622
|
-
[`${process.env.XUDA_HOSTNAME}`]: await upload_file_to_spaces(
|
|
1623
|
-
tempPath,
|
|
1624
|
-
ref,
|
|
1625
|
-
drive_type,
|
|
1626
|
-
file_name
|
|
1627
|
-
),
|
|
1628
|
-
};
|
|
1629
|
-
doc._id = file_name;
|
|
1630
|
-
save_ret = await db_module.save_couch_doc("xuda_drive", doc);
|
|
1631
|
-
misc_module.rsync_drive_resources_to_remote_servers("user", uid);
|
|
1632
1596
|
break;
|
|
1633
1597
|
}
|
|
1634
1598
|
|
|
1635
1599
|
default:
|
|
1636
1600
|
break;
|
|
1637
1601
|
}
|
|
1602
|
+
|
|
1603
|
+
return {
|
|
1604
|
+
code: 764,
|
|
1605
|
+
data: "ok",
|
|
1606
|
+
};
|
|
1638
1607
|
};
|
|
1639
1608
|
const ocr_drive_file = async function (doc) {
|
|
1640
1609
|
const { drive_type, target_file } = doc;
|