@xuda.io/drive_module 1.1.1384 → 1.1.1386

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.
Files changed (2) hide show
  1. package/index.mjs +4 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1103,6 +1103,7 @@ export const upload_drive_file = async (req, job_id, headers, file_obj) => {
1103
1103
  }
1104
1104
  }
1105
1105
  } catch (error) {}
1106
+
1106
1107
  const ts = Date.now();
1107
1108
  let doc = {
1108
1109
  docType: `${drive_type}_drive`,
@@ -1115,7 +1116,7 @@ export const upload_drive_file = async (req, job_id, headers, file_obj) => {
1115
1116
  ip: headers['cf-connecting-ip'],
1116
1117
  country: headers['cf-ipcountry'],
1117
1118
  file_ext: ext,
1118
- is_archive: _conf.archive_drive_ext.includes(ext) ? true : false,
1119
+ is_archive: validation_ret.valid && validation_ret.category === 'archive' ? true : false,
1119
1120
  drive_type,
1120
1121
  mime: file_obj.mimetype,
1121
1122
  ocr_stat: ['image', 'application', 'text'].includes(file_obj.mimetype.split('/')[0]) ? 1 : 0,
@@ -1803,6 +1804,7 @@ const get_drive_doc = async (type, drive_type, app_id, uid, file_path, headers)
1803
1804
  break;
1804
1805
  }
1805
1806
 
1807
+ const validation_ret = file_upload_validator(file_name);
1806
1808
  if (doc_ret.code < 0) {
1807
1809
  if (drive_type === 'studio') {
1808
1810
  const app_id_reference = await _common.get_project_app_id(app_id);
@@ -1822,7 +1824,7 @@ const get_drive_doc = async (type, drive_type, app_id, uid, file_path, headers)
1822
1824
  ip: headers?.['cf-connecting-ip'],
1823
1825
  country: headers?.['cf-ipcountry'],
1824
1826
  file_ext: ext,
1825
- is_archive: _conf.archive_drive_ext.includes(ext) ? true : false,
1827
+ is_archive: validation_ret.valid && validation_ret.category === 'archive' ? true : false,
1826
1828
  drive_type,
1827
1829
  app_id: await _common.get_project_app_id(app_id),
1828
1830
  app_id_reference: await _common.get_project_app_id(app_id, true),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.1384",
3
+ "version": "1.1.1386",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {