@xuda.io/drive_module 1.1.760 → 1.1.762
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 +32 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1140,21 +1140,48 @@ exports.rename_drive_folder = async function (req) {
|
|
|
1140
1140
|
exports.update_drive_file_sharing_mode = async function (req, job_id, headers) {
|
|
1141
1141
|
try {
|
|
1142
1142
|
const { drive_type, uid, app_id, file_id, is_public } = req;
|
|
1143
|
+
|
|
1143
1144
|
validate_drive_type(drive_type);
|
|
1144
1145
|
|
|
1146
|
+
const file_name = path.basename(file_path);
|
|
1147
|
+
|
|
1148
|
+
let check_req = {
|
|
1149
|
+
app_id,
|
|
1150
|
+
uid,
|
|
1151
|
+
drive_type,
|
|
1152
|
+
file_path,
|
|
1153
|
+
};
|
|
1154
|
+
const check_existing_file_ret = await module.exports.check_drive_file(
|
|
1155
|
+
check_req
|
|
1156
|
+
);
|
|
1157
|
+
|
|
1145
1158
|
let doc_ret;
|
|
1146
1159
|
|
|
1147
1160
|
switch (drive_type) {
|
|
1148
|
-
case "
|
|
1149
|
-
case "studio":
|
|
1161
|
+
case "studio": {
|
|
1150
1162
|
const app_id_reference = await _common.get_project_app_id(app_id);
|
|
1151
|
-
doc_ret = await db_module.get_app_couch_doc(
|
|
1163
|
+
doc_ret = await db_module.get_app_couch_doc(
|
|
1164
|
+
app_id_reference,
|
|
1165
|
+
file_path
|
|
1166
|
+
);
|
|
1152
1167
|
break;
|
|
1153
|
-
|
|
1168
|
+
}
|
|
1154
1169
|
case "user":
|
|
1155
|
-
doc_ret = await db_module.get_couch_doc(
|
|
1170
|
+
doc_ret = await db_module.get_couch_doc(
|
|
1171
|
+
"xuda_drive",
|
|
1172
|
+
check_existing_file_ret.duplicates[0]._id
|
|
1173
|
+
);
|
|
1156
1174
|
break;
|
|
1157
1175
|
|
|
1176
|
+
case "workspace": {
|
|
1177
|
+
const app_id_reference = await _common.get_project_app_id(app_id);
|
|
1178
|
+
doc_ret = await db_module.get_app_couch_doc(
|
|
1179
|
+
app_id_reference,
|
|
1180
|
+
check_existing_file_ret.duplicates[0]._id
|
|
1181
|
+
);
|
|
1182
|
+
|
|
1183
|
+
break;
|
|
1184
|
+
}
|
|
1158
1185
|
default:
|
|
1159
1186
|
break;
|
|
1160
1187
|
}
|