@xuda.io/drive_module 1.1.831 → 1.1.833

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.js +35 -5
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -510,7 +510,14 @@ exports.get_drive_file_info = async function (req, job_id, headers) {
510
510
  try {
511
511
  const { type, drive_type, uid, app_id, file_path } = req;
512
512
 
513
- let doc = await get_drive_doc(drive_type, app_id, uid, file_path, headers);
513
+ let doc = await get_drive_doc(
514
+ type,
515
+ drive_type,
516
+ app_id,
517
+ uid,
518
+ file_path,
519
+ headers
520
+ );
514
521
 
515
522
  delete doc._id;
516
523
  delete doc._rev;
@@ -860,7 +867,14 @@ exports.update_drive_file = async function (req, job_id, headers, file_obj) {
860
867
  return { code: -4, data: "file data missing" };
861
868
  }
862
869
 
863
- let doc = await get_drive_doc(drive_type, app_id, uid, file_path, headers);
870
+ let doc = await get_drive_doc(
871
+ type,
872
+ drive_type,
873
+ app_id,
874
+ uid,
875
+ file_path,
876
+ headers
877
+ );
864
878
 
865
879
  var target_file = file_path;
866
880
  const master_id = await _common.get_project_app_id(app_id, true);
@@ -1102,7 +1116,14 @@ exports.rename_drive_file = async function (req, job_id, headers) {
1102
1116
  const { drive_type, app_id, file_name_to, file_path } = req;
1103
1117
  validate_drive_type(drive_type);
1104
1118
 
1105
- let doc = await get_drive_doc(drive_type, app_id, uid, file_path, headers);
1119
+ let doc = await get_drive_doc(
1120
+ "file",
1121
+ drive_type,
1122
+ app_id,
1123
+ uid,
1124
+ file_path,
1125
+ headers
1126
+ );
1106
1127
 
1107
1128
  if (drive_type === "studio") {
1108
1129
  await fs_module.rename(file_path, file_name_to);
@@ -2592,11 +2613,18 @@ const get_folder_docs = async function (dir, drive_type, app_id) {
2592
2613
 
2593
2614
  exports.update_drive_file_tags = async function (req, job_id, headers) {
2594
2615
  try {
2595
- const { drive_type, app_id, uid, file_path, tags = [] } = req;
2616
+ const { type, drive_type, app_id, uid, file_path, tags = [] } = req;
2596
2617
  const file_name = path.basename(file_path);
2597
2618
  validate_drive_type(drive_type);
2598
2619
 
2599
- let doc = await get_drive_doc(drive_type, app_id, uid, file_path, headers);
2620
+ let doc = await get_drive_doc(
2621
+ type,
2622
+ drive_type,
2623
+ app_id,
2624
+ uid,
2625
+ file_path,
2626
+ headers
2627
+ );
2600
2628
 
2601
2629
  doc.date_modified = Date.now();
2602
2630
  doc.tags = tags;
@@ -2634,10 +2662,12 @@ setTimeout(async function () {
2634
2662
  }, 2000);
2635
2663
 
2636
2664
  const get_drive_doc = async function (
2665
+ type,
2637
2666
  drive_type,
2638
2667
  app_id,
2639
2668
  uid,
2640
2669
  file_path,
2670
+
2641
2671
  headers
2642
2672
  ) {
2643
2673
  let check_req = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.831",
3
+ "version": "1.1.833",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {