change linter to standard

This commit is contained in:
Unknown
2018-11-12 10:28:59 +00:00
parent 19f3edf55a
commit 04d80c7c2f
19 changed files with 837 additions and 691 deletions

View File

@@ -1,16 +1,16 @@
import StoreJson from "./models/StoreJson";
import Fetcher from "./lib/Fetcher";
import Controller from "./lib/Controller";
import config from "./config";
import StoreJson from './models/StoreJson'
import Fetcher from './lib/Fetcher'
import Controller from './lib/Controller'
import config from './config'
const {googleSheets} = config;
const {sheets, privateKey, email} = googleSheets;
const { googleSheets } = config
const { sheets, privateKey, email } = googleSheets
function authenticate(_fetcher) {
function authenticate (_fetcher) {
return _fetcher.fetcher.authenticate(email, privateKey).then(msg => {
console.log(msg);
return true;
});
console.log(msg)
return true
})
}
export default callback => {
@@ -18,29 +18,29 @@ export default callback => {
return {
name: sheet.name,
fetcher: new Fetcher(new StoreJson(), sheet.name, sheet.id, sheet.tabs)
};
});
}
})
Promise.all(fetchers.map(authenticate))
.then(() => {
console.log(`===================`);
console.log(`grant access to: ${email}`);
console.log(`===================`);
console.log(`===================`)
console.log(`grant access to: ${email}`)
console.log(`===================`)
// NB: reformat fetchers as config for controller
const config = {};
const config = {}
fetchers.forEach(fetcher => {
config[fetcher.name] = fetcher.fetcher;
});
const controller = new Controller(config);
callback(controller);
config[fetcher.name] = fetcher.fetcher
})
const controller = new Controller(config)
callback(controller)
})
.catch(err => {
console.log(err);
console.log(err)
console.log(
`ERROR: the server couldn't connect to all of the sheets you provided. Ensure you have granted access to ${
email
} on ALL listed sheets.`
);
});
};
)
})
}