@xuda.io/drive_module 1.1.1346 → 1.1.1350
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 +13 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -242,7 +242,7 @@ export const get_drive_files = async (req) => {
|
|
|
242
242
|
size: formatBytes(sizeInBytes),
|
|
243
243
|
name: doc.folder_name,
|
|
244
244
|
path: doc.file_path, //'/' + doc._id,
|
|
245
|
-
file_path: doc.file_path
|
|
245
|
+
file_path: path.join(doc.file_path, doc.folder_name), //'/' + doc._id,
|
|
246
246
|
type: doc.type,
|
|
247
247
|
is_folder: true,
|
|
248
248
|
date_created: doc.date_created,
|
|
@@ -2097,6 +2097,18 @@ export const getExtensionFromUrl = function (imageUrl) {
|
|
|
2097
2097
|
}
|
|
2098
2098
|
};
|
|
2099
2099
|
|
|
2100
|
+
export const get_user_drive_file = async function (uid, contact_id) {
|
|
2101
|
+
const app_id = await account_module.get_account_default_project_id(uid);
|
|
2102
|
+
const contact_ret = await db_module.get_app_couch_doc_native(account_profile_info.app_id, contact_id);
|
|
2103
|
+
return contact_ret;
|
|
2104
|
+
};
|
|
2105
|
+
|
|
2106
|
+
export const save_user_drive_file = async function (uid, contact_doc) {
|
|
2107
|
+
const app_id = await account_module.get_account_default_project_id(uid);
|
|
2108
|
+
const contact_ret = await db_module.save_app_couch_doc(account_profile_info.app_id, contact_doc);
|
|
2109
|
+
return contact_ret;
|
|
2110
|
+
};
|
|
2111
|
+
|
|
2100
2112
|
function getExtensionFromString(str) {
|
|
2101
2113
|
// Extract extension using regex
|
|
2102
2114
|
const match = str.match(/\.([a-zA-Z0-9]+)(?:[?#].*)?$/);
|