@xuda.io/drive_module 1.1.1050 → 1.1.1051
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 +0 -75
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -346,12 +346,6 @@ exports.get_drive_files = async function (req) {
|
|
|
346
346
|
""
|
|
347
347
|
);
|
|
348
348
|
|
|
349
|
-
// if (type === "studio" || type === "user") {
|
|
350
|
-
// return `https://${process.env.XUDA_HOSTNAME}/${drive_type}-drive/${ref}/${file_path}`;
|
|
351
|
-
// } else {
|
|
352
|
-
// return `https://${process.env.XUDA_HOSTNAME}/${drive_type}-drive/${file_path}`;
|
|
353
|
-
// }
|
|
354
|
-
|
|
355
349
|
return `https://${process.env.XUDA_HOSTNAME}/studio-drive/${app_id_master}/${file_path}`;
|
|
356
350
|
};
|
|
357
351
|
|
|
@@ -427,19 +421,11 @@ exports.get_drive_files = async function (req) {
|
|
|
427
421
|
.slice(from, to + 1);
|
|
428
422
|
}
|
|
429
423
|
await drill(tree.children);
|
|
430
|
-
// tree.path = get_studio_path(tree.path, app_id_master, tree?.name || "");
|
|
431
|
-
// tree.file_path = path.join(tree.path, tree.name);
|
|
432
424
|
} else {
|
|
433
425
|
tree = {
|
|
434
426
|
children: [],
|
|
435
427
|
name: tree?.name,
|
|
436
428
|
size: 0,
|
|
437
|
-
// path: get_studio_path(directoryPath, app_id_master, tree?.name || ""), // directoryPath,
|
|
438
|
-
// file_path: get_studio_path(
|
|
439
|
-
// directoryPath,
|
|
440
|
-
// app_id_master,
|
|
441
|
-
// tree?.name || ""
|
|
442
|
-
// ),
|
|
443
429
|
};
|
|
444
430
|
}
|
|
445
431
|
|
|
@@ -822,67 +808,6 @@ exports.create_drive_folder = async function (req, job_id, headers) {
|
|
|
822
808
|
code: 200,
|
|
823
809
|
data: target_dir,
|
|
824
810
|
};
|
|
825
|
-
|
|
826
|
-
// if (!(await file_exists(target_dir))) {
|
|
827
|
-
// try {
|
|
828
|
-
// await create_directory(target_dir, 0o775, true);
|
|
829
|
-
|
|
830
|
-
// // const job_info = await db_module.get_job_info(job_id);
|
|
831
|
-
// var doc = {
|
|
832
|
-
// _id: folder_id,
|
|
833
|
-
|
|
834
|
-
// docType: `${drive_type}_drive`,
|
|
835
|
-
// stat: 3,
|
|
836
|
-
// folder_name,
|
|
837
|
-
// uid,
|
|
838
|
-
// date_created: Date.now(),
|
|
839
|
-
// ip: headers?.["cf-connecting-ip"],
|
|
840
|
-
// country: headers?.["cf-ipcountry"],
|
|
841
|
-
// is_folder: true,
|
|
842
|
-
// type: "directory",
|
|
843
|
-
// file_path: req.path,
|
|
844
|
-
// };
|
|
845
|
-
// if (drive_type === "studio" || drive_type === "workspace") {
|
|
846
|
-
// doc.app_id = await _common.get_project_app_id(app_id);
|
|
847
|
-
// doc.app_id_reference = await _common.get_project_app_id(app_id, true);
|
|
848
|
-
// }
|
|
849
|
-
|
|
850
|
-
// let save_ret;
|
|
851
|
-
|
|
852
|
-
// switch (drive_type) {
|
|
853
|
-
// case "workspace":
|
|
854
|
-
// case "studio":
|
|
855
|
-
// const app_id_reference = await _common.get_project_app_id(app_id);
|
|
856
|
-
// save_ret = await db_module.save_app_couch_doc(
|
|
857
|
-
// app_id_reference,
|
|
858
|
-
// doc
|
|
859
|
-
// );
|
|
860
|
-
// break;
|
|
861
|
-
|
|
862
|
-
// case "user":
|
|
863
|
-
// save_ret = await db_module.save_couch_doc("xuda_drive", doc);
|
|
864
|
-
// break;
|
|
865
|
-
|
|
866
|
-
// default:
|
|
867
|
-
// break;
|
|
868
|
-
// }
|
|
869
|
-
|
|
870
|
-
// if (save_ret.code < 0) {
|
|
871
|
-
// return save_ret;
|
|
872
|
-
// }
|
|
873
|
-
// } catch (err) {
|
|
874
|
-
// return { code: -1, data: err.message };
|
|
875
|
-
// }
|
|
876
|
-
|
|
877
|
-
// return {
|
|
878
|
-
// code: 200,
|
|
879
|
-
// data: target_dir,
|
|
880
|
-
// };
|
|
881
|
-
// }
|
|
882
|
-
// return {
|
|
883
|
-
// code: -200,
|
|
884
|
-
// data: target_dir + " folder exist",
|
|
885
|
-
// };
|
|
886
811
|
} catch (err) {
|
|
887
812
|
return {
|
|
888
813
|
code: -200,
|