@xuda.io/drive_module 1.1.799 → 1.1.801
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 +11 -62
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1107,80 +1107,29 @@ exports.rename_drive_file = async function (req, job_id, headers) {
|
|
|
1107
1107
|
delete doc._rev;
|
|
1108
1108
|
}
|
|
1109
1109
|
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
doc_ret = await db_module.get_app_couch_doc(app_id_master, file_path);
|
|
1114
|
-
await fs_module.rename(file_path, file_name_to);
|
|
1115
|
-
if (doc_ret.code > -1) {
|
|
1116
|
-
doc_ret.data._delete = true;
|
|
1117
|
-
save_ret = await db_module.save_app_couch_doc(
|
|
1118
|
-
app_id_master,
|
|
1119
|
-
doc_ret.data
|
|
1120
|
-
);
|
|
1110
|
+
doc.date_modified = Date.now();
|
|
1111
|
+
doc.originalname = file_name_to;
|
|
1112
|
+
let save_ret;
|
|
1121
1113
|
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
misc_module.rsync_drive_resources_to_remote_servers(
|
|
1126
|
-
"studio",
|
|
1127
|
-
app_id_master
|
|
1128
|
-
);
|
|
1129
|
-
break;
|
|
1130
|
-
}
|
|
1131
|
-
case "workspace": {
|
|
1114
|
+
switch (drive_type) {
|
|
1115
|
+
case "workspace":
|
|
1116
|
+
case "studio":
|
|
1132
1117
|
const app_id_reference = await _common.get_project_app_id(app_id);
|
|
1133
|
-
|
|
1134
|
-
app_id_reference,
|
|
1135
|
-
check_existing_file_ret.duplicates[0]._id
|
|
1136
|
-
);
|
|
1137
|
-
if (doc_ret.code < 0) {
|
|
1138
|
-
throw new Error(doc_ret.data);
|
|
1139
|
-
}
|
|
1140
|
-
|
|
1118
|
+
save_ret = await db_module.save_app_couch_doc(app_id_reference, doc);
|
|
1141
1119
|
break;
|
|
1142
|
-
}
|
|
1143
1120
|
|
|
1144
1121
|
case "user":
|
|
1145
|
-
|
|
1146
|
-
"xuda_drive",
|
|
1147
|
-
check_existing_file_ret.duplicates[0]._id
|
|
1148
|
-
);
|
|
1149
|
-
if (doc_ret.code < 0) {
|
|
1150
|
-
throw new Error(doc_ret.data);
|
|
1151
|
-
}
|
|
1152
|
-
|
|
1122
|
+
save_ret = await db_module.save_couch_doc("xuda_drive", doc);
|
|
1153
1123
|
break;
|
|
1154
1124
|
|
|
1155
1125
|
default:
|
|
1156
1126
|
break;
|
|
1157
1127
|
}
|
|
1158
1128
|
|
|
1159
|
-
if (
|
|
1160
|
-
|
|
1161
|
-
doc.date_modified = Date.now();
|
|
1162
|
-
doc.originalname = file_name_to;
|
|
1163
|
-
let save_ret;
|
|
1164
|
-
|
|
1165
|
-
switch (drive_type) {
|
|
1166
|
-
case "workspace":
|
|
1167
|
-
case "studio":
|
|
1168
|
-
const app_id_reference = await _common.get_project_app_id(app_id);
|
|
1169
|
-
save_ret = await db_module.save_app_couch_doc(app_id_reference, doc);
|
|
1170
|
-
break;
|
|
1171
|
-
|
|
1172
|
-
case "user":
|
|
1173
|
-
save_ret = await db_module.save_couch_doc("xuda_drive", doc);
|
|
1174
|
-
break;
|
|
1175
|
-
|
|
1176
|
-
default:
|
|
1177
|
-
break;
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
if (save_ret.code < 0) {
|
|
1181
|
-
throw new Error(save_ret.data);
|
|
1182
|
-
}
|
|
1129
|
+
if (save_ret.code < 0) {
|
|
1130
|
+
throw new Error(save_ret.data);
|
|
1183
1131
|
}
|
|
1132
|
+
|
|
1184
1133
|
return {
|
|
1185
1134
|
code: 200,
|
|
1186
1135
|
data: file_name_to,
|