@xuda.io/drive_module 1.1.1045 → 1.1.1047

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 +9 -8
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -190,12 +190,13 @@ exports.get_drive_files = async function (req) {
190
190
  else return (bytes / 1073741824).toFixed(2) + " GB";
191
191
  }
192
192
 
193
- const get_drive_files = async function (
193
+ const fetch_drive_files = async function (
194
194
  ret,
195
195
  file_doc,
196
196
  app_id_reference,
197
197
  uid,
198
- datasource_id
198
+ datasource_id,
199
+ domain = process.env.XUDA_HOSTNAME
199
200
  ) {
200
201
  let files = {
201
202
  path: req.path || "/",
@@ -215,9 +216,9 @@ exports.get_drive_files = async function (req) {
215
216
  size: formatBytes(doc.size),
216
217
  extension: doc?.file_ext?.substr(1),
217
218
  type: doc.type,
218
- access_link: `https://${
219
- process.env.XUDA_HOSTNAME
220
- }/${drive_type}-drive/${datasource_id || app_id}/${doc._id}`,
219
+ access_link: `https://${domain}/${drive_type}-drive/${
220
+ datasource_id || app_id
221
+ }/${doc._id}`,
221
222
  is_archive: doc.is_archive,
222
223
  public: doc.public,
223
224
  path: doc.file_path,
@@ -274,7 +275,7 @@ exports.get_drive_files = async function (req) {
274
275
 
275
276
  return {
276
277
  code: 1,
277
- data: await get_drive_files(
278
+ data: await fetch_drive_files(
278
279
  ret,
279
280
  file_doc,
280
281
  app_id_reference,
@@ -289,7 +290,7 @@ exports.get_drive_files = async function (req) {
289
290
 
290
291
  return {
291
292
  code: 1,
292
- data: await get_drive_files(ret, file_doc, null, uid),
293
+ data: await fetch_drive_files(ret, file_doc, null, uid),
293
294
  };
294
295
  };
295
296
  const get_studio_files = async function () {
@@ -305,7 +306,7 @@ exports.get_drive_files = async function (req) {
305
306
 
306
307
  return {
307
308
  code: 1,
308
- data: await get_drive_files(ret, file_doc, app_id_reference, null),
309
+ data: await fetch_drive_files(ret, file_doc, app_id_reference, null),
309
310
  };
310
311
  }
311
312
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.1045",
3
+ "version": "1.1.1047",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {