@xuda.io/drive_module 1.1.1204 → 1.1.1206

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 -46
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const path = require('path');
2
2
  global._conf = require(path.join(process.env.XUDA_HOME, process.env.XUDA_CONFIG));
3
- console.log('drive module loaded..');
3
+ console.log('Drive Module loaded...');
4
4
 
5
5
  const _common = require(path.join(process.env.XUDA_HOME, 'common', 'xuda_node_common.js'));
6
6
  const _utils = require(path.join(process.env.XUDA_HOME, 'common', 'xuda-cpi-utils.js'));
@@ -1722,31 +1722,31 @@ exports.delete_file_from_bucket = async function (bucket) {
1722
1722
  }
1723
1723
  };
1724
1724
 
1725
- const get_folder_docs = async function (dir, drive_type, app_id) {
1726
- var docs = [];
1727
- const get_docs = async function (dirPath) {
1728
- const opt = {
1729
- selector: {
1730
- docType: `${drive_type}_drive`,
1731
- stat: 3,
1732
- file_path: path.join('/', dirPath),
1733
- },
1734
- limit: 99999,
1735
- };
1736
- const ret = drive_type === 'user' ? await db_module.find_couch_query('xuda_drive', opt) : await db_module.find_app_couch_query(app_id, opt);
1737
- for await (let doc of ret.docs) {
1738
- if (doc.type === 'directory') {
1739
- await get_docs(path.join('/', doc._id));
1740
- } else {
1741
- docs.push(doc);
1742
- }
1743
- }
1744
- };
1745
-
1746
- await get_docs(dir);
1747
-
1748
- return docs;
1749
- };
1725
+ // const get_folder_docs = async function (dir, drive_type, app_id) {
1726
+ // var docs = [];
1727
+ // const get_docs = async function (dirPath) {
1728
+ // const opt = {
1729
+ // selector: {
1730
+ // docType: `${drive_type}_drive`,
1731
+ // stat: 3,
1732
+ // file_path: path.join('/', dirPath),
1733
+ // },
1734
+ // limit: 99999,
1735
+ // };
1736
+ // const ret = drive_type === 'user' ? await db_module.find_couch_query('xuda_drive', opt) : await db_module.find_app_couch_query(app_id, opt);
1737
+ // for await (let doc of ret.docs) {
1738
+ // if (doc.type === 'directory') {
1739
+ // await get_docs(path.join('/', doc._id));
1740
+ // } else {
1741
+ // docs.push(doc);
1742
+ // }
1743
+ // }
1744
+ // };
1745
+
1746
+ // await get_docs(dir);
1747
+
1748
+ // return docs;
1749
+ // };
1750
1750
 
1751
1751
  exports.update_drive_file_tags = async function (req, job_id, headers) {
1752
1752
  try {
@@ -2155,28 +2155,28 @@ setTimeout(async function () {
2155
2155
  // fix_date_modified();
2156
2156
  }, 2000);
2157
2157
 
2158
- const fix_date_modified = async function () {
2159
- const app_id = 'dtcb1674f63e47ddcb11865cefdfb4483fb';
2160
- const ret = await db_module.find_app_couch_query(app_id, { selector: { docType: 'workspace_drive' }, limit: 99999 });
2158
+ // const fix_date_modified = async function () {
2159
+ // const app_id = 'dtcb1674f63e47ddcb11865cefdfb4483fb';
2160
+ // const ret = await db_module.find_app_couch_query(app_id, { selector: { docType: 'workspace_drive' }, limit: 99999 });
2161
2161
 
2162
- for (doc of ret.docs) {
2163
- if (!doc.date_modified) {
2164
- doc.date_modified = doc.date_created;
2165
- }
2166
- }
2162
+ // for (doc of ret.docs) {
2163
+ // if (!doc.date_modified) {
2164
+ // doc.date_modified = doc.date_created;
2165
+ // }
2166
+ // }
2167
2167
 
2168
- const save_ret = await db_module.sava_app_couch_bulk_docs(app_id, ret.docs);
2169
- console.log('fix_date_modified', save_ret, ret);
2168
+ // const save_ret = await db_module.sava_app_couch_bulk_docs(app_id, ret.docs);
2169
+ // console.log('fix_date_modified', save_ret, ret);
2170
2170
 
2171
- // const db_name = 'db_prj_3uh4q1zj0llw3mj4wgifh1';
2172
- // const ret = await db_module.find_couch_query(db_name, { selector: { docType: 'workspace_drive' } });
2171
+ // // const db_name = 'db_prj_3uh4q1zj0llw3mj4wgifh1';
2172
+ // // const ret = await db_module.find_couch_query(db_name, { selector: { docType: 'workspace_drive' } });
2173
2173
 
2174
- // for (doc of ret.docs) {
2175
- // if (!doc.date_modified) {
2176
- // doc.date_modified = 0;
2177
- // }
2178
- // }
2174
+ // // for (doc of ret.docs) {
2175
+ // // if (!doc.date_modified) {
2176
+ // // doc.date_modified = 0;
2177
+ // // }
2178
+ // // }
2179
2179
 
2180
- // const save_ret = await db_module.save_couch_bulk_docs(db_name, ret.docs);
2181
- // console.log('fix_date_modified', save_ret, ret);
2182
- };
2180
+ // // const save_ret = await db_module.save_couch_bulk_docs(db_name, ret.docs);
2181
+ // // console.log('fix_date_modified', save_ret, ret);
2182
+ // };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.1204",
3
+ "version": "1.1.1206",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {