0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-28 22:12:39 +00:00

Fix variable name conflict bugs

This commit is contained in:
Trevor Buckner
2023-03-07 14:27:33 -05:00
parent 2a9ac9fa47
commit bfccf833b6
2 changed files with 29144 additions and 29144 deletions

58268
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
/* eslint-disable max-lines */
const _ = require('lodash');
const drive = require('@googleapis/drive');
const googleDrive = require('@googleapis/drive');
const { nanoid } = require('nanoid');
const token = require('./token.js');
const config = require('./config.js');
@@ -14,7 +14,7 @@ if(!config.get('service_account')){
config.get('service_account');
try {
serviceAuth = drive.auth.fromJSON(keys);
serviceAuth = googleDrive.auth.fromJSON(keys);
serviceAuth.scopes = ['https://www.googleapis.com/auth/drive'];
} catch (err) {
console.warn(err);
@@ -33,7 +33,7 @@ const GoogleActions = {
throw (err);
}
const oAuth2Client = new drive.auth.OAuth2(
const oAuth2Client = new googleDrive.auth.OAuth2(
config.get('google_client_id'),
config.get('google_client_secret'),
'/auth/google/redirect'
@@ -60,7 +60,7 @@ const GoogleActions = {
},
getGoogleFolder : async (auth)=>{
const drive = drive({ version: 'v3', auth });
const drive = googleDrive.drive({ version: 'v3', auth });
fileMetadata = {
'name' : 'Homebrewery',
@@ -97,7 +97,7 @@ const GoogleActions = {
},
listGoogleBrews : async (auth)=>{
const drive = drive({ version: 'v3', auth });
const drive = googleDrive.drive({ version: 'v3', auth });
const obj = await drive.files.list({
pageSize : 1000,
@@ -136,7 +136,7 @@ const GoogleActions = {
},
updateGoogleBrew : async (brew)=>{
const drive = drive({ version: 'v3', auth: defaultAuth });
const drive = googleDrive.drive({ version: 'v3', auth: defaultAuth });
await drive.files.update({
fileId : brew.googleId,
@@ -167,7 +167,7 @@ const GoogleActions = {
},
newGoogleBrew : async (auth, brew)=>{
const drive = drive({ version: 'v3', auth });
const drive = googleDrive.drive({ version: 'v3', auth });
const media = {
mimeType : 'text/plain',
@@ -218,7 +218,7 @@ const GoogleActions = {
},
getGoogleBrew : async (id, accessId, accessType)=>{
const drive = drive({ version: 'v3', auth: defaultAuth });
const drive = googleDrive.drive({ version: 'v3', auth: defaultAuth });
const obj = await drive.files.get({
fileId : id,
@@ -274,7 +274,7 @@ const GoogleActions = {
},
deleteGoogleBrew : async (auth, id, accessId)=>{
const drive = drive({ version: 'v3', auth });
const drive = googleDrive.drive({ version: 'v3', auth });
const obj = await drive.files.get({
fileId : id,
@@ -300,7 +300,7 @@ const GoogleActions = {
},
increaseView : async (id, accessId, accessType, brew)=>{
const drive = drive({ version: 'v3', auth: defaultAuth });
const drive = googleDrive.drive({ version: 'v3', auth: defaultAuth });
await drive.files.update({
fileId : brew.googleId,