@xuda.io/drive_module 1.1.541 → 1.1.543

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 -12
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -712,9 +712,8 @@ exports.update_drive_file = async function (req, job_id, headers, file_obj) {
712
712
  return {
713
713
  code: 760,
714
714
  data: {
715
- server_file_name: `https://${process.env.XUDA_HOSTNAME}/${
716
- req.drive_type === "studio" ? "uploads" : "drive"
717
- }${req.file_name}`,
715
+ server_file_name: `https://${process.env.XUDA_HOSTNAME}/${req.drive_type === "studio" ? "uploads" : "drive"
716
+ }${req.file_name}`,
718
717
  filename: file_obj.originalname,
719
718
  },
720
719
  };
@@ -1288,7 +1287,7 @@ exports.extract_drive_file = async function (req, job_id, headers) {
1288
1287
 
1289
1288
  try {
1290
1289
  await db_module.save_app_couch_doc(app_id_reference, file_doc);
1291
- } catch (error) {}
1290
+ } catch (error) { }
1292
1291
  })
1293
1292
  .on("close", () => {
1294
1293
  console.log("Extraction complete.");
@@ -1483,13 +1482,12 @@ exports.upload_drive_file = async function (req, job_id, headers, file_obj) {
1483
1482
  break;
1484
1483
  }
1485
1484
 
1486
- let file_url = `https://${
1487
- process.env.XUDA_HOSTNAME
1488
- }/${drive_type}-drive/${ref}${
1489
- file_name.substr(0, 1) === "" ? "/" : ""
1490
- }${file_name}`;
1485
+ let file_url = `https://${process.env.XUDA_HOSTNAME
1486
+ }/${drive_type}-drive/${ref}${file_name.substr(0, 1) !== "/" ? "/" : ""
1487
+ }${file_name}`;
1491
1488
  if (["workspace"].includes(req.drive_type)) {
1492
- file_url = `https://${process.env.XUDA_HOSTNAME}/workspace-drive/${file_name}`;
1489
+ file_url = `https://${process.env.XUDA_HOSTNAME}/workspace-drive${file_name.substr(0, 1) !== "/" ? "/" : ""
1490
+ }${file_name}`;
1493
1491
  }
1494
1492
 
1495
1493
  await fs_module.unlink(tempPath);
@@ -2045,7 +2043,7 @@ const get_file_info = async function (file_path) {
2045
2043
  const sizeOf = require("image-size");
2046
2044
  const dimensions = sizeOf(file_path);
2047
2045
  doc.dimensions = `${dimensions.width}x${dimensions.height}`;
2048
- } catch (error) {}
2046
+ } catch (error) { }
2049
2047
  return doc;
2050
2048
  };
2051
2049
 
@@ -2104,4 +2102,4 @@ const get_folder_docs = async function (dir, drive_type, app_id) {
2104
2102
  return docs;
2105
2103
  };
2106
2104
 
2107
- setTimeout(function () {}, 2000);
2105
+ setTimeout(function () { }, 2000);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.541",
3
+ "version": "1.1.543",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {