@xuda.io/drive_module 1.1.1281 → 1.1.1282
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.mjs +6 -6
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -476,7 +476,7 @@ export const delete_drive_files = async (req, job_id, headers) => {
|
|
|
476
476
|
for await (const file of files_arr) {
|
|
477
477
|
let doc = await get_drive_doc(file.type, drive_type, app_id, uid, file.file_path, headers);
|
|
478
478
|
|
|
479
|
-
if (doc.
|
|
479
|
+
if (doc.is_protected) {
|
|
480
480
|
throw new Error(`${doc.type} protected`);
|
|
481
481
|
}
|
|
482
482
|
|
|
@@ -650,7 +650,7 @@ export const update_drive_file = async (req, job_id, headers, file_obj) => {
|
|
|
650
650
|
|
|
651
651
|
export const create_drive_folder = async (req, job_id, headers) => {
|
|
652
652
|
try {
|
|
653
|
-
const { drive_type, app_id, folder_name, uid,
|
|
653
|
+
const { drive_type, app_id, folder_name, uid, is_protected, path: file_path } = req;
|
|
654
654
|
validate_drive_type(drive_type);
|
|
655
655
|
|
|
656
656
|
let folder_id;
|
|
@@ -671,7 +671,7 @@ export const create_drive_folder = async (req, job_id, headers) => {
|
|
|
671
671
|
is_folder: true,
|
|
672
672
|
type: 'directory',
|
|
673
673
|
file_path,
|
|
674
|
-
|
|
674
|
+
is_protected,
|
|
675
675
|
};
|
|
676
676
|
|
|
677
677
|
let check_req = {
|
|
@@ -688,7 +688,7 @@ export const create_drive_folder = async (req, job_id, headers) => {
|
|
|
688
688
|
if (check_existing_file_ret.code < 0) {
|
|
689
689
|
throw new Error(check_existing_file_ret.data);
|
|
690
690
|
}
|
|
691
|
-
|
|
691
|
+
debugger;
|
|
692
692
|
switch (drive_type) {
|
|
693
693
|
case 'studio': {
|
|
694
694
|
folder_id = req.folder_name;
|
|
@@ -1022,7 +1022,7 @@ export const delete_file_bulk = async (req) => {
|
|
|
1022
1022
|
|
|
1023
1023
|
export const upload_drive_file = async (req, job_id, headers, file_obj) => {
|
|
1024
1024
|
try {
|
|
1025
|
-
const { drive_type, app_id, uid, make_public, tags = '',
|
|
1025
|
+
const { drive_type, app_id, uid, make_public, tags = '', is_protected, path: file_path } = req;
|
|
1026
1026
|
|
|
1027
1027
|
/// validations
|
|
1028
1028
|
validate_drive_type(drive_type);
|
|
@@ -1069,7 +1069,7 @@ export const upload_drive_file = async (req, job_id, headers, file_obj) => {
|
|
|
1069
1069
|
size: stat.isFile() ? stat.size : 0,
|
|
1070
1070
|
public: make_public,
|
|
1071
1071
|
tags: tags_arr,
|
|
1072
|
-
|
|
1072
|
+
is_protected,
|
|
1073
1073
|
};
|
|
1074
1074
|
doc = { ...doc, ...(await get_file_info(tempPath)) };
|
|
1075
1075
|
|