google-auth-token-generator
Advanced tools
Comparing version 0.1.2 to 0.1.3
20
index.js
@@ -6,8 +6,20 @@ 'use strict'; | ||
const oAuth2ClientGen = (options) => { | ||
let credentials = {}; | ||
let token = {}; | ||
const google = options.library; | ||
const CREDENTIALS_PATH = options.CREDENTIALS_PATH || 'credentials.json'; | ||
const TOKEN_PATH = options.TOKEN_PATH || 'token.json'; | ||
const credentials = JSON.parse(fs.readFileSync(CREDENTIALS_PATH, 'utf8')); | ||
const token = JSON.parse(fs.readFileSync(TOKEN_PATH, 'utf8')); | ||
if(options.CREDENTIALS && options.TOKEN){ | ||
//文字列指定 | ||
const CREDENTIALS = options.CREDENTIALS; | ||
const TOKEN = options.TOKEN; | ||
credentials = JSON.parse(CREDENTIALS); | ||
token = JSON.parse(TOKEN); | ||
}else{ | ||
//ファイル指定 | ||
const CREDENTIALS_PATH = options.CREDENTIALS_PATH || 'credentials.json'; | ||
const TOKEN_PATH = options.TOKEN_PATH || 'token.json'; | ||
credentials = JSON.parse(fs.readFileSync(CREDENTIALS_PATH, 'utf8')); | ||
token = JSON.parse(fs.readFileSync(TOKEN_PATH, 'utf8')); | ||
} | ||
@@ -14,0 +26,0 @@ const {client_secret, client_id, redirect_uris} = credentials.installed; |
{ | ||
"name": "google-auth-token-generator", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "", | ||
@@ -21,5 +21,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"googleapis": "^67.1.0", | ||
"googleapis": "^73.0.0", | ||
"inquirer": "^7.3.3" | ||
} | ||
} |
11106
178
+ Addedgoogleapis@73.0.0(transitive)
- Removedgoogleapis@67.1.1(transitive)
Updatedgoogleapis@^73.0.0