@xuda.io/drive_module 1.1.770 → 1.1.772

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 +46 -8
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -947,7 +947,7 @@ exports.rename_drive_file = async function (req) {
947
947
  check_req
948
948
  );
949
949
 
950
- var target_file = file_name;
950
+ // var target_file = file_name;
951
951
 
952
952
  let doc_ret;
953
953
 
@@ -2534,12 +2534,50 @@ const get_file_url = function (drive_type, file_name, ref) {
2534
2534
  };
2535
2535
 
2536
2536
  setTimeout(async function () {
2537
- console.log(
2538
- await exports.search_drive_files({
2539
- app_id: "prj3937cb6f9a31c8c7dea25055bba845b1",
2540
- drive_type: "workspace",
2541
- })
2542
- );
2537
+ // console.log(
2538
+ // await exports.search_drive_files({
2539
+ // app_id: "prj3937cb6f9a31c8c7dea25055bba845b1",
2540
+ // drive_type: "workspace",
2541
+ // })
2542
+ // );
2543
2543
  }, 2000);
2544
2544
 
2545
- const get_drive_doc = function (drive_type, ref, file_path) {};
2545
+ const get_drive_doc = async function (drive_type, app_id, uid, file_path) {
2546
+ let check_req = {
2547
+ app_id,
2548
+ uid,
2549
+ drive_type,
2550
+ file_path,
2551
+ };
2552
+ const check_existing_file_ret = await module.exports.check_drive_file(
2553
+ check_req
2554
+ );
2555
+
2556
+ let doc_ret;
2557
+
2558
+ switch (drive_type) {
2559
+ case "studio": {
2560
+ const app_id_reference = await _common.get_project_app_id(app_id);
2561
+ doc_ret = await db_module.get_app_couch_doc(app_id_reference, file_path);
2562
+ break;
2563
+ }
2564
+ case "user":
2565
+ doc_ret = await db_module.get_couch_doc(
2566
+ "xuda_drive",
2567
+ check_existing_file_ret.duplicates[0]._id
2568
+ );
2569
+ break;
2570
+
2571
+ case "workspace": {
2572
+ const app_id_reference = await _common.get_project_app_id(app_id);
2573
+ doc_ret = await db_module.get_app_couch_doc(
2574
+ app_id_reference,
2575
+ check_existing_file_ret.duplicates[0]._id
2576
+ );
2577
+
2578
+ break;
2579
+ }
2580
+ default:
2581
+ break;
2582
+ }
2583
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.770",
3
+ "version": "1.1.772",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {