selfish-google-drive
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "selfish-google-drive", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Google drive api for that access your own account", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -25,7 +25,19 @@ const _ = require('lodash'); | ||
* @param {String} token.access_token | ||
* @param {String} searchObject.name | ||
* @param {String} searchObject.mimeType | ||
* @returns {Object} | ||
*/ | ||
module.exports = (token, searchKeyword) => { | ||
module.exports = (token, searchObject) => { | ||
const accessToken = _.get(token, 'access_token'); | ||
const { name, mimeType } = searchObject; | ||
let gdQuery = 'trashed = false '; | ||
if (name) { | ||
gdQuery += `and name contains '${_.trim(name)}' `; | ||
} | ||
if (mimeType) { | ||
gdQuery += `and mimeType contains '${_.trim(mimeType)}' `; | ||
} | ||
return request | ||
@@ -36,3 +48,3 @@ .get(constant.lsUrl) | ||
pageSize: 1000, | ||
q: `trashed = false and name contains '${_.trim(searchKeyword)}'`, | ||
q: gdQuery, | ||
}) | ||
@@ -39,0 +51,0 @@ .set('Accept', 'application/json') |
@@ -27,5 +27,10 @@ const _ = require('lodash'); | ||
*/ | ||
module.exports = (token) => { | ||
module.exports = (token, folderId) => { | ||
let gdQuery = 'trashed = false '; | ||
const accessToken = _.get(token, 'access_token'); | ||
if (folderId) { | ||
gdQuery += `and parents in '${folderId}'`; | ||
} | ||
return request | ||
@@ -36,3 +41,3 @@ .get(constant.lsUrl) | ||
pageSize: 1000, | ||
q: 'trashed = false', | ||
q: gdQuery, | ||
}) | ||
@@ -39,0 +44,0 @@ .set('Accept', 'application/json') |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
92614
2614