@xuda.io/drive_module 1.1.997 → 1.1.999
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 +14 -37
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -840,25 +840,10 @@ exports.delete_drive_files = async function (req, job_id, headers) {
|
|
|
840
840
|
if (doc.type === "file") {
|
|
841
841
|
await module.exports.delete_file_from_bucket(doc.bucket);
|
|
842
842
|
}
|
|
843
|
-
// if (doc_ret.data.type === "directory") {
|
|
844
|
-
// const docs = await get_folder_docs(
|
|
845
|
-
// path.basename(file.path),
|
|
846
|
-
// drive_type,
|
|
847
|
-
// app_id_reference
|
|
848
|
-
// );
|
|
849
|
-
// for await (let doc of docs) {
|
|
850
|
-
// if (doc.type === "file") {
|
|
851
|
-
// await module.exports.delete_file_from_bucket(doc.bucket);
|
|
852
|
-
// }
|
|
853
|
-
// doc.ts = Date.now();
|
|
854
|
-
// doc.stat = 4;
|
|
855
|
-
// await db_module.save_app_couch_doc(app_id_reference, doc);
|
|
856
|
-
// }
|
|
857
|
-
// }
|
|
858
843
|
|
|
859
844
|
doc.ts = Date.now();
|
|
860
845
|
doc.stat = 4;
|
|
861
|
-
save_ret = await
|
|
846
|
+
save_ret = await save_drive_doc(drive_type, app_id, doc);
|
|
862
847
|
|
|
863
848
|
misc_module.rsync_drive_resources_to_remote_servers(
|
|
864
849
|
"workspace",
|
|
@@ -868,28 +853,12 @@ exports.delete_drive_files = async function (req, job_id, headers) {
|
|
|
868
853
|
}
|
|
869
854
|
|
|
870
855
|
case "user": {
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
await module.exports.delete_file_from_bucket(doc_ret.data.bucket);
|
|
874
|
-
}
|
|
875
|
-
if (doc_ret.data.type === "directory") {
|
|
876
|
-
const docs = await get_folder_docs(
|
|
877
|
-
path.basename(file.path),
|
|
878
|
-
drive_type,
|
|
879
|
-
null
|
|
880
|
-
);
|
|
881
|
-
for await (let doc of docs) {
|
|
882
|
-
if (doc.type === "file") {
|
|
883
|
-
await module.exports.delete_file_from_bucket(doc.bucket);
|
|
884
|
-
}
|
|
885
|
-
doc.ts = Date.now();
|
|
886
|
-
doc.stat = 4;
|
|
887
|
-
await db_module.save_couch_doc("xuda_drive", doc);
|
|
888
|
-
}
|
|
856
|
+
if (doc.type === "file") {
|
|
857
|
+
await module.exports.delete_file_from_bucket(doc.bucket);
|
|
889
858
|
}
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
save_ret = await
|
|
859
|
+
doc.ts = Date.now();
|
|
860
|
+
doc.stat = 4;
|
|
861
|
+
save_ret = await save_drive_doc(drive_type, app_id, doc);
|
|
893
862
|
|
|
894
863
|
misc_module.rsync_drive_resources_to_remote_servers(
|
|
895
864
|
"user",
|
|
@@ -902,6 +871,14 @@ exports.delete_drive_files = async function (req, job_id, headers) {
|
|
|
902
871
|
}
|
|
903
872
|
}
|
|
904
873
|
|
|
874
|
+
switch (drive_type) {
|
|
875
|
+
case "studio": {
|
|
876
|
+
break;
|
|
877
|
+
}
|
|
878
|
+
default:
|
|
879
|
+
break;
|
|
880
|
+
}
|
|
881
|
+
|
|
905
882
|
return {
|
|
906
883
|
code: 200,
|
|
907
884
|
data: req.files_arr,
|