@xuda.io/drive_module 1.1.1319 → 1.1.1321
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 +8 -6
- 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);
|
|
@@ -1074,7 +1074,9 @@ export const upload_drive_file = async (req, job_id, headers, file_obj) => {
|
|
|
1074
1074
|
|
|
1075
1075
|
let tags_arr = [];
|
|
1076
1076
|
try {
|
|
1077
|
-
if (tags)
|
|
1077
|
+
if (tags) {
|
|
1078
|
+
tags_arr = tags.split(',');
|
|
1079
|
+
}
|
|
1078
1080
|
} catch (error) {}
|
|
1079
1081
|
const ts = Date.now();
|
|
1080
1082
|
let doc = {
|
|
@@ -1097,7 +1099,7 @@ export const upload_drive_file = async (req, job_id, headers, file_obj) => {
|
|
|
1097
1099
|
size: stat.isFile() ? stat.size : 0,
|
|
1098
1100
|
public: make_public,
|
|
1099
1101
|
tags: tags_arr,
|
|
1100
|
-
|
|
1102
|
+
is_system,
|
|
1101
1103
|
};
|
|
1102
1104
|
doc = { ...doc, ...(await get_file_info(tempPath)) };
|
|
1103
1105
|
|