@xuda.io/drive_module 1.1.564 → 1.1.565

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 +11 -27
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1567,35 +1567,19 @@ exports.check_drive_file = async function (req, job_id, headers, file_obj) {
1567
1567
  }
1568
1568
  case "workspace": {
1569
1569
  ref = await _common.get_project_app_id(req.app_id, true);
1570
- file_name =
1571
- "drv_" + ref + "_" + (await _common.xuda_get_uuid(drive_type)) + ext;
1572
-
1573
- // keep the original filename to support migration
1574
- if (file_obj.originalname.includes(`drv_${ref}`)) {
1575
- file_name = file_obj.originalname;
1576
- }
1577
-
1578
- doc.server_file_name = file_name;
1579
-
1580
- doc.app_id = app_id;
1581
- doc.app_id_reference = ref;
1582
1570
 
1583
1571
  /// check existing file
1584
- if (check_exist) {
1585
- const workspace_drive_res = await db_module.find_app_couch_query(
1586
- app_id,
1587
- {
1588
- selector: { docType: "workspace_drive", originalname, stat: 3 },
1589
- limit: 99,
1590
- }
1591
- );
1592
- if (workspace_drive_res.docs.length) {
1593
- return {
1594
- code: -762,
1595
- data: "file already exist",
1596
- duplicates: workspace_drive_res.docs,
1597
- };
1598
- }
1572
+
1573
+ const workspace_drive_res = await db_module.find_app_couch_query(app_id, {
1574
+ selector: { docType: "workspace_drive", originalname, stat: 3 },
1575
+ limit: 99,
1576
+ });
1577
+ if (workspace_drive_res.docs.length) {
1578
+ return {
1579
+ code: -762,
1580
+ data: "file already exist",
1581
+ duplicates: workspace_drive_res.docs,
1582
+ };
1599
1583
  }
1600
1584
 
1601
1585
  doc.bucket = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.564",
3
+ "version": "1.1.565",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {