@xuda.io/drive_module 1.1.1318 → 1.1.1320
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 -5
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -483,7 +483,7 @@ export const delete_drive_files = async (req, job_id, headers) => {
|
|
|
483
483
|
for await (const file of files_arr) {
|
|
484
484
|
let doc = await get_drive_doc(file.type, drive_type, app_id, uid, file.file_path, headers);
|
|
485
485
|
|
|
486
|
-
if (doc.
|
|
486
|
+
if (doc.is_system) {
|
|
487
487
|
throw new Error(`${doc.type} protected`);
|
|
488
488
|
}
|
|
489
489
|
|
|
@@ -665,7 +665,7 @@ export const update_drive_file = async (req, job_id, headers, file_obj) => {
|
|
|
665
665
|
|
|
666
666
|
export const create_drive_folder = async (req, job_id, headers) => {
|
|
667
667
|
try {
|
|
668
|
-
const { drive_type, app_id, folder_name, uid,
|
|
668
|
+
const { drive_type, app_id, folder_name, uid, is_system, path: file_path } = req;
|
|
669
669
|
validate_drive_type(drive_type);
|
|
670
670
|
|
|
671
671
|
let folder_id;
|
|
@@ -686,7 +686,7 @@ export const create_drive_folder = async (req, job_id, headers) => {
|
|
|
686
686
|
is_folder: true,
|
|
687
687
|
type: 'directory',
|
|
688
688
|
file_path,
|
|
689
|
-
|
|
689
|
+
is_system,
|
|
690
690
|
};
|
|
691
691
|
|
|
692
692
|
let check_req = {
|
|
@@ -1050,7 +1050,7 @@ export const delete_file_bulk = async (req) => {
|
|
|
1050
1050
|
|
|
1051
1051
|
export const upload_drive_file = async (req, job_id, headers, file_obj) => {
|
|
1052
1052
|
try {
|
|
1053
|
-
const { drive_type, app_id, uid, make_public, tags = '',
|
|
1053
|
+
const { drive_type, app_id, uid, make_public, tags = '', is_system, path: file_path } = req;
|
|
1054
1054
|
|
|
1055
1055
|
/// validations
|
|
1056
1056
|
validate_drive_type(drive_type);
|
|
@@ -1097,7 +1097,7 @@ export const upload_drive_file = async (req, job_id, headers, file_obj) => {
|
|
|
1097
1097
|
size: stat.isFile() ? stat.size : 0,
|
|
1098
1098
|
public: make_public,
|
|
1099
1099
|
tags: tags_arr,
|
|
1100
|
-
|
|
1100
|
+
is_system,
|
|
1101
1101
|
};
|
|
1102
1102
|
doc = { ...doc, ...(await get_file_info(tempPath)) };
|
|
1103
1103
|
|
|
@@ -1246,6 +1246,7 @@ export const check_drive_file = async (req, job_id, headers, file_obj) => {
|
|
|
1246
1246
|
type,
|
|
1247
1247
|
file_path: path.dirname(file_path),
|
|
1248
1248
|
stat: 3,
|
|
1249
|
+
uid,
|
|
1249
1250
|
};
|
|
1250
1251
|
|
|
1251
1252
|
if (type === 'file') {
|