UNPKG

gsweet

Version:

Help with writing scripts to run against gSuite

85 lines (62 loc) 2.53 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Source: drive/driveService.js</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Source: drive/driveService.js</h1> <section> <article> <pre class="prettyprint source linenums"><code>/** * @module */ const {google} = require('googleapis') const authHelper = require('../googleAuthHelper') let _driveService = undefined /** * Set up the service used for the Google Drive API. If no parameter passed in * uses the real google API, a fake or mock can be passed in for testing. * @param {Object} svc (optional) if not passed uses the google.drive service */ const init = (svc = undefined) => { if (svc !== undefined) { _driveService = svc } else { if (_driveService === undefined) { _driveService = getDriveServiceDefault() } } return _driveService } const getDriveServiceDefault = () => google.drive({ version: 'v3', auth: authHelper.getGoogleDriveAuth(), }) module.exports = { init, getDriveServiceDefault, } </code></pre> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="Drive_driveOps.module_test.html">test</a></li><li><a href="module-drive_driveOps.html">drive/driveOps</a></li><li><a href="module-Drive_driveOps%2520Integration%2520Tests.html">Drive/driveOps Integration Tests</a></li><li><a href="module-drive_driveService.html">drive/driveService</a></li><li><a href="module-Sheet_sheetOps%2520Integration%2520Tests.html">Sheet/sheetOps Integration Tests</a></li><li><a href="sheets_sheetOps.module_js.html">sheets/sheetOps.js</a></li><li><a href="sheets_sheetService.module_js.html">sheets/sheetService.js</a></li><li><a href="-_sheetOps.module_test.html">test</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sat May 11 2019 23:52:27 GMT-0700 (Pacific Daylight Time) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>