@xuda.io/drive_module 1.1.880 → 1.1.882
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 +28 -23
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -87,15 +87,17 @@ exports.get_drive_files = async function (req) {
|
|
|
87
87
|
try {
|
|
88
88
|
let opt = {
|
|
89
89
|
selector: {
|
|
90
|
-
docType: "workspace_drive",
|
|
91
90
|
stat: 3,
|
|
92
91
|
type,
|
|
93
|
-
file_path: req.path,
|
|
94
92
|
},
|
|
95
93
|
limit: to - from,
|
|
96
94
|
skip: from,
|
|
97
95
|
};
|
|
98
96
|
|
|
97
|
+
if (req.path) {
|
|
98
|
+
opt.selector.file_path = req.path;
|
|
99
|
+
}
|
|
100
|
+
|
|
99
101
|
validate_drive_type(drive_type);
|
|
100
102
|
|
|
101
103
|
function formatBytes(bytes) {
|
|
@@ -108,16 +110,17 @@ exports.get_drive_files = async function (req) {
|
|
|
108
110
|
const get_workspace_files = async function () {
|
|
109
111
|
const app_id_reference = await _common.get_project_app_id(app_id);
|
|
110
112
|
opt.selector = "workspace_drive";
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
113
|
+
|
|
114
|
+
// var opt = {
|
|
115
|
+
// selector: {
|
|
116
|
+
// docType: "workspace_drive",
|
|
117
|
+
// stat: 3,
|
|
118
|
+
// type,
|
|
119
|
+
// file_path: req.path,
|
|
120
|
+
// },
|
|
121
|
+
// limit: to - from,
|
|
122
|
+
// skip: from,
|
|
123
|
+
// };
|
|
121
124
|
|
|
122
125
|
if (date) {
|
|
123
126
|
opt.sort = [{ date_created: "desc" }];
|
|
@@ -188,17 +191,19 @@ exports.get_drive_files = async function (req) {
|
|
|
188
191
|
return { code: 1, data: files };
|
|
189
192
|
};
|
|
190
193
|
const get_user_files = async function () {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
194
|
+
opt.selector = "user_drive";
|
|
195
|
+
opt.uid = uid;
|
|
196
|
+
// var opt = {
|
|
197
|
+
// selector: {
|
|
198
|
+
// docType: "user_drive",
|
|
199
|
+
// stat: 3,
|
|
200
|
+
// uid,
|
|
201
|
+
// type,
|
|
202
|
+
// file_path: req.path,
|
|
203
|
+
// },
|
|
204
|
+
// limit: to - from,
|
|
205
|
+
// skip: from,
|
|
206
|
+
// };
|
|
202
207
|
|
|
203
208
|
if (date) {
|
|
204
209
|
opt.sort = [{ date_created: "desc" }];
|