@kintone/plugin-uploader
Advanced tools
Comparing version 2.0.1 to 2.1.0
#!/usr/bin/env node | ||
'use strict'; | ||
"use strict"; | ||
const meow = require('meow'); | ||
const { run } = require('../dist/index'); | ||
const meow = require("meow"); | ||
const { run } = require("../dist/index"); | ||
const { inquireParams } = require("../dist/params"); | ||
@@ -36,19 +37,19 @@ const { | ||
domain: { | ||
type: 'string', | ||
type: "string", | ||
default: KINTONE_DOMAIN | ||
}, | ||
username: { | ||
type: 'string', | ||
type: "string", | ||
default: KINTONE_USERNAME | ||
}, | ||
password: { | ||
type: 'string', | ||
type: "string", | ||
default: KINTONE_PASSWORD | ||
}, | ||
proxy: { | ||
type: 'string', | ||
type: "string", | ||
default: HTTPS_PROXY || HTTP_PROXY | ||
}, | ||
watch: { | ||
type: 'boolean', | ||
type: "boolean", | ||
default: false | ||
@@ -64,21 +65,4 @@ } | ||
let error = false; | ||
if (!username) { | ||
console.error('Please specify the login username'); | ||
error = true; | ||
} | ||
if (!password) { | ||
console.error('Please specify the login password'); | ||
error = true; | ||
} | ||
if (!domain) { | ||
console.error('Please specify the kintone domain'); | ||
error = true; | ||
} | ||
if (!pluginPath) { | ||
console.error('Please specify the path of kintone plugin zip'); | ||
error = true; | ||
} | ||
if (error) { | ||
console.error("Please specify the path of kintone plugin zip"); | ||
cli.showHelp(); | ||
@@ -88,2 +72,5 @@ process.exit(1); | ||
run(domain, username, password, pluginPath, options); | ||
inquireParams({ username, password, domain }).then( | ||
({ username, password, domain }) => | ||
run(domain, username, password, pluginPath, options) | ||
); |
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="2.1.0"></a> | ||
# [2.1.0](https://github.com/kintone/plugin-uploader/compare/v2.0.1...v2.1.0) (2018-05-29) | ||
### Features | ||
* **cli:** Interactive input for username, password, domain ([#51](https://github.com/kintone/plugin-uploader/issues/51)) ([61ab6d9](https://github.com/kintone/plugin-uploader/commit/61ab6d9)) | ||
<a name="2.0.1"></a> | ||
@@ -7,0 +17,0 @@ ## [2.0.1](https://github.com/kintone/plugin-uploader/compare/v2.0.0...v2.0.1) (2018-05-11) |
@@ -16,2 +16,3 @@ "use strict"; | ||
const puppeteer_1 = __importDefault(require("puppeteer")); | ||
const TIMEOUT_MS = 5000; | ||
function launchBrowser(proxy) { | ||
@@ -35,3 +36,6 @@ return __awaiter(this, void 0, void 0, function* () { | ||
yield page.click(".login-button"); | ||
yield page.waitForNavigation(); | ||
yield page.waitForNavigation({ | ||
timeout: TIMEOUT_MS, | ||
waitUntil: "domcontentloaded" | ||
}); | ||
const pluginUrl = `${kintoneUrl}k/admin/system/plugin/`; | ||
@@ -55,3 +59,3 @@ console.log(`Navigate to ${pluginUrl}`); | ||
hidden: true, | ||
timeout: 5000 | ||
timeout: TIMEOUT_MS | ||
}); | ||
@@ -58,0 +62,0 @@ console.log(`${pluginPath} has been uploaded!`); |
{ | ||
"name": "@kintone/plugin-uploader", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "A kintone plugin uploader using puppetieer", | ||
@@ -32,2 +32,3 @@ "bin": { | ||
"dependencies": { | ||
"inquirer": "^5.2.0", | ||
"meow": "^5.0.0", | ||
@@ -37,7 +38,8 @@ "puppeteer": "^1.4.0" | ||
"devDependencies": { | ||
"@types/node": "^9.6.14", | ||
"@types/inquirer": "0.0.41", | ||
"@types/node": "^9.6.18", | ||
"@types/puppeteer": "^1.3.2", | ||
"npm-run-all": "^4.1.3", | ||
"prettier": "^1.12.1", | ||
"standard-version": "^4.3.0", | ||
"prettier": "^1.13.2", | ||
"standard-version": "^4.4.0", | ||
"tslint": "^5.10.0", | ||
@@ -44,0 +46,0 @@ "tslint-plugin-prettier": "^1.3.0", |
@@ -6,3 +6,2 @@ # @kintone/plugin-uploader | ||
A kintone plugin uploader using [puppeteer](https://github.com/GoogleChrome/puppeteer) | ||
@@ -65,4 +64,13 @@ | ||
If you ommit the options, you can input the options interactively. | ||
``` | ||
% kintone-plugin-uploader plugin.zip | ||
? Input your username: hoge | ||
? Input your password: [hidden] | ||
? Input your domain: example.com | ||
``` | ||
## LICENSE | ||
MIT License |
13632
7
208
75
3
9
+ Addedinquirer@^5.2.0
+ Addedansi-escapes@3.2.0(transitive)
+ Addedansi-regex@3.0.1(transitive)
+ Addedansi-styles@3.2.1(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedchardet@0.4.2(transitive)
+ Addedcli-cursor@2.1.0(transitive)
+ Addedcli-width@2.2.1(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedexternal-editor@2.2.0(transitive)
+ Addedfigures@2.0.0(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedinquirer@5.2.0(transitive)
+ Addedis-fullwidth-code-point@2.0.0(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedmimic-fn@1.2.0(transitive)
+ Addedmute-stream@0.0.7(transitive)
+ Addedonetime@2.0.1(transitive)
+ Addedos-tmpdir@1.0.2(transitive)
+ Addedrestore-cursor@2.0.0(transitive)
+ Addedrun-async@2.4.1(transitive)
+ Addedrxjs@5.5.12(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedstring-width@2.1.1(transitive)
+ Addedstrip-ansi@4.0.0(transitive)
+ Addedsupports-color@5.5.0(transitive)
+ Addedsymbol-observable@1.0.1(transitive)
+ Addedthrough@2.3.8(transitive)
+ Addedtmp@0.0.33(transitive)