@xuda.io/drive_module 1.1.1242 → 1.1.1243
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 +17 -16
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -40,21 +40,21 @@ const get_studio_path = (raw_path, ref, file_name) => {
|
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
// Helper to get S3 Client
|
|
43
|
-
const getS3Client = (region) => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
};
|
|
43
|
+
// const getS3Client = (region) => {
|
|
44
|
+
// const endpoint = _conf.storage_bucket[region || process.env.XUDA_HOSTNAME].endpoint;
|
|
45
|
+
// // AWS SDK v3 requires protocol in endpoint, v2 didn't always strict check
|
|
46
|
+
// const formattedEndpoint = endpoint.startsWith('http') ? endpoint : `https://${endpoint}`;
|
|
47
|
+
|
|
48
|
+
// return new S3Client({
|
|
49
|
+
// endpoint: formattedEndpoint,
|
|
50
|
+
// region: _conf.storage_bucket[region || process.env.XUDA_HOSTNAME].region,
|
|
51
|
+
// credentials: {
|
|
52
|
+
// accessKeyId: _conf.digitalocean.spaces_access_key,
|
|
53
|
+
// secretAccessKey: _conf.digitalocean.spaces_secret_key,
|
|
54
|
+
// },
|
|
55
|
+
// forcePathStyle: false, // DigitalOcean Spaces supports virtual-hosted style
|
|
56
|
+
// });
|
|
57
|
+
// };
|
|
58
58
|
|
|
59
59
|
export const get_drive_files = async (req) => {
|
|
60
60
|
try {
|
|
@@ -1001,7 +1001,7 @@ export const delete_file_bulk = async (req) => {
|
|
|
1001
1001
|
|
|
1002
1002
|
export const upload_drive_file = async (req, job_id, headers, file_obj) => {
|
|
1003
1003
|
try {
|
|
1004
|
-
const { drive_type, app_id, uid, make_public, tags = '' } = req;
|
|
1004
|
+
const { drive_type, app_id, uid, make_public, tags = '', reserve } = req;
|
|
1005
1005
|
|
|
1006
1006
|
/// validations
|
|
1007
1007
|
validate_drive_type(drive_type);
|
|
@@ -1048,6 +1048,7 @@ export const upload_drive_file = async (req, job_id, headers, file_obj) => {
|
|
|
1048
1048
|
size: stat.isFile() ? stat.size : 0,
|
|
1049
1049
|
public: make_public,
|
|
1050
1050
|
tags: tags_arr,
|
|
1051
|
+
reserve,
|
|
1051
1052
|
};
|
|
1052
1053
|
doc = { ...doc, ...(await get_file_info(tempPath)) };
|
|
1053
1054
|
|