From c3b026b1d6c8d2445240149ad87a2e115df30b26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Trevi=C3=B1o?= Date: Tue, 30 Oct 2018 08:06:07 +0100 Subject: [PATCH 01/44] Add linter files --- app-cli/.eslintignore | 3 + app-cli/.eslintrc.js | 43 +++ app-cli/.prettierignore | 5 + app-cli/.prettierrc.js | 5 + app-cli/.stylelintignore | 3 + app-cli/.stylelintrc.js | 25 ++ app-cli/package-lock.json | 788 +++++++++++++++++++++++++++++++++++++- app-cli/package.json | 12 + 8 files changed, 883 insertions(+), 1 deletion(-) create mode 100644 app-cli/.eslintignore create mode 100644 app-cli/.eslintrc.js create mode 100644 app-cli/.prettierignore create mode 100644 app-cli/.prettierrc.js create mode 100644 app-cli/.stylelintignore create mode 100644 app-cli/.stylelintrc.js diff --git a/app-cli/.eslintignore b/app-cli/.eslintignore new file mode 100644 index 0000000..9ebfc2d --- /dev/null +++ b/app-cli/.eslintignore @@ -0,0 +1,3 @@ +node_modules/ +dist/ +coverage/ diff --git a/app-cli/.eslintrc.js b/app-cli/.eslintrc.js new file mode 100644 index 0000000..c2b5192 --- /dev/null +++ b/app-cli/.eslintrc.js @@ -0,0 +1,43 @@ +module.exports = { + env: { + browser: true, + commonjs: true, + es6: true, + node: true, + "jest/globals": true + }, + globals: { + page: true, + browser: true, + jestPuppeteer: true + }, + extends: ["eslint:recommended"], + parserOptions: { + sourceType: "module", + codeFrame: false, + ecmaFeatures: { + experimentalObjectRestSpread: true, + jsx: true + } + }, + plugins: ["jest"], + rules: { + "padding-line-between-statements": [ + "error", + { blankLine: "always", prev: "*", next: "*" }, + { + blankLine: "never", + prev: ["const", "let"], + next: ["const", "let"] + } + ], + "no-console": 0, + "no-unused-vars": 1, + "prefer-const": "error", + "linebreak-style": ["error", "unix"], + quotes: ["error", "double"], + semi: ["error", "never"], + "require-await": 2, + "no-return-await": 2 + } +} diff --git a/app-cli/.prettierignore b/app-cli/.prettierignore new file mode 100644 index 0000000..253b0cd --- /dev/null +++ b/app-cli/.prettierignore @@ -0,0 +1,5 @@ +package.json +package-lock.json +node_modules/ +coverage/ +dist/ diff --git a/app-cli/.prettierrc.js b/app-cli/.prettierrc.js new file mode 100644 index 0000000..fa89c60 --- /dev/null +++ b/app-cli/.prettierrc.js @@ -0,0 +1,5 @@ +module.exports = { + tabWidth: 2, + semi: false, + printWidth: 80 +}; diff --git a/app-cli/.stylelintignore b/app-cli/.stylelintignore new file mode 100644 index 0000000..1d17b90 --- /dev/null +++ b/app-cli/.stylelintignore @@ -0,0 +1,3 @@ + +node_modules +coverage diff --git a/app-cli/.stylelintrc.js b/app-cli/.stylelintrc.js new file mode 100644 index 0000000..947165b --- /dev/null +++ b/app-cli/.stylelintrc.js @@ -0,0 +1,25 @@ +module.exports = { + extends: "stylelint-config-sass-guidelines", + rules: { + "no-descending-specificity": null, + "selector-pseudo-class-no-unknown": [ + true, + { + ignorePseudoClasses: ["global"] + } + ], + "selector-class-pattern": null, + "max-nesting-depth": null, + "color-named": null, + "declaration-property-value-blacklist": null, + "selector-no-qualifying-type": null, + "selector-max-compound-selectors": null, + "property-no-vendor-prefix": null, + "selector-max-id": null, + "scss/selector-no-redundant-nesting-selector": null, + "string-quotes": "double", + "scss/at-import-no-partial-leading-underscore": null, + "scss/at-extend-no-missing-placeholder": null, + "scss/at-mixin-pattern": null + } +}; diff --git a/app-cli/package-lock.json b/app-cli/package-lock.json index 30e0475..4d5b2ba 100644 --- a/app-cli/package-lock.json +++ b/app-cli/package-lock.json @@ -1,9 +1,41 @@ { "name": "captainduckduck", - "version": "1.0.13", + "version": "1.0.15", "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/highlight": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", + "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "acorn": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.2.tgz", + "integrity": "sha512-GXmKIvbrN3TV7aVqAzVFaMW8F8wzVX7voEBRO3bDA64+EX37YSayggRJP5Xig6HYHBkWKpFg9W5gg6orklubhg==", + "dev": true + }, + "acorn-jsx": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.0.tgz", + "integrity": "sha512-XkB50fn0MURDyww9+UYL3c1yLbOBz0ZFvrdYlGB8l+Ije1oSC75qAqrzSPjYQbdnQUzhlUGNKuesryAv0gxZOg==", + "dev": true + }, "ajv": { "version": "5.5.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", @@ -41,6 +73,36 @@ "color-convert": "^1.9.0" } }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, "asn1": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", @@ -66,6 +128,12 @@ "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==" }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, "bcrypt-pbkdf": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", @@ -89,6 +157,31 @@ "widest-line": "^2.0.0" } }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, + "requires": { + "callsites": "^0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, "camelcase": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", @@ -124,6 +217,12 @@ "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.1.3.tgz", "integrity": "sha512-SK/846h/Rcy8q9Z9CAwGBLfCJ6EkjJWdpelWDufQpqVDYq2Wnnv8zlSO6AMQap02jvhVruKKpEtQOufo3pFhLg==" }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, "cli-boxes": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", @@ -183,6 +282,12 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==" }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, "configstore": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.2.tgz", @@ -232,16 +337,63 @@ "assert-plus": "^1.0.0" } }, + "debug": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz", + "integrity": "sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, "deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "^5.0.0", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "rimraf": "^2.2.8" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, "dot-prop": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", @@ -269,6 +421,219 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, + "eslint": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.8.0.tgz", + "integrity": "sha512-Zok6Bru3y2JprqTNm14mgQ15YQu/SMDkWdnmHfFg770DIUlmMFd/gqqzCHekxzjHZJxXv3tmTpH0C1icaYJsRQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.5.3", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^2.1.0", + "eslint-scope": "^4.0.0", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^4.0.0", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^2.0.0", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "imurmurhash": "^0.1.4", + "inquirer": "^6.1.0", + "is-resolvable": "^1.1.0", + "js-yaml": "^3.12.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.5", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "pluralize": "^7.0.0", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "require-uncached": "^1.0.3", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^5.0.2", + "text-table": "^0.2.0" + }, + "dependencies": { + "ajv": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.4.tgz", + "integrity": "sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "external-editor": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", + "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "inquirer": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.0.tgz", + "integrity": "sha512-QIEQG4YyQ2UYZGDC4srMZ7BjHOmNk1lR2JQj5UknBapklm6WHA+VVH7N+sUdX3A7NeCfGF8o4X1S3Ao7nAcIeg==", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.0", + "figures": "^2.0.0", + "lodash": "^4.17.10", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.1.0", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "dev": true + } + } + }, + "eslint-plugin-jest": { + "version": "21.26.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-21.26.2.tgz", + "integrity": "sha512-SCTBC6q182D4qQlQAN81D351jdte/YwTMo4f+l19Gvh1VemaNZP7ak3MLLvw6xkL9dO2FxVjCLk5DCdl1KfdLw==", + "dev": true + }, + "eslint-scope": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", + "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", + "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", + "dev": true + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, + "espree": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-4.1.0.tgz", + "integrity": "sha512-I5BycZW6FCVIub93TeVY1s7vjhP9CY6cXCznIRfiig7nRviKZYdRnj/sHEWC6A7WE9RDWOFq9+7OsWSYz8qv2w==", + "dev": true, + "requires": { + "acorn": "^6.0.2", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "dev": true, + "requires": { + "estraverse": "^4.0.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, "execa": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", @@ -313,6 +678,12 @@ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, "figures": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", @@ -321,6 +692,28 @@ "escape-string-regexp": "^1.0.5" } }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, + "requires": { + "flat-cache": "^1.2.1", + "object-assign": "^4.0.1" + } + }, + "flat-cache": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "dev": true, + "requires": { + "circular-json": "^0.3.1", + "del": "^2.0.2", + "graceful-fs": "^4.1.2", + "write": "^0.2.1" + } + }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -346,6 +739,18 @@ "universalify": "^0.1.0" } }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, "get-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", @@ -359,6 +764,20 @@ "assert-plus": "^1.0.0" } }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "global-dirs": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", @@ -367,6 +786,34 @@ "ini": "^1.3.4" } }, + "globals": { + "version": "11.8.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.8.0.tgz", + "integrity": "sha512-io6LkyPVuzCHBSQV9fmOwxZkUk6nIaGmxheLDgmuFv89j0fm2aqDbIXKAGfzCMHqz3HLF2Zf8WSG6VqMh2qFmA==", + "dev": true + }, + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, "got": { "version": "6.7.1", "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", @@ -427,6 +874,12 @@ "safer-buffer": ">= 2.1.2 < 3" } }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, "import-lazy": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", @@ -437,6 +890,22 @@ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, "ini": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", @@ -495,6 +964,21 @@ "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", + "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", + "dev": true, + "requires": { + "is-path-inside": "^1.0.0" + } + }, "is-path-inside": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", @@ -513,6 +997,12 @@ "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=" }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true + }, "is-retry-allowed": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", @@ -538,6 +1028,22 @@ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", @@ -554,6 +1060,12 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -586,6 +1098,16 @@ "package-json": "^4.0.0" } }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, "lodash": { "version": "4.17.10", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", @@ -639,16 +1161,60 @@ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" }, + "mkdirp": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, "mute-stream": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=" }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, "npm-run-path": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", @@ -662,6 +1228,21 @@ "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, "onetime": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", @@ -670,6 +1251,20 @@ "mimic-fn": "^1.0.0" } }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" + } + }, "ora": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/ora/-/ora-1.4.0.tgz", @@ -702,6 +1297,12 @@ "semver": "^5.1.0" } }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, "path-is-inside": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", @@ -722,11 +1323,44 @@ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, "prepend-http": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" }, + "prettier": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.14.3.tgz", + "integrity": "sha512-qZDVnCrnpsRJJq5nSsiHCE3BYMED2OtsI+cmzIzF1QIfqm5ALf8tEJcO27zV1gKNKRPdhjO0dNWnrzssDQ1tFg==", + "dev": true + }, "progress": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", @@ -758,6 +1392,12 @@ "strip-json-comments": "~2.0.1" } }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true + }, "registry-auth-token": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.2.tgz", @@ -802,6 +1442,22 @@ "uuid": "^3.1.0" } }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "^0.1.0", + "resolve-from": "^1.0.0" + } + }, + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + }, "restore-cursor": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", @@ -811,6 +1467,15 @@ "signal-exit": "^3.0.2" } }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "^7.0.5" + } + }, "run-async": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", @@ -832,6 +1497,15 @@ "rx-lite": "*" } }, + "rxjs": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz", + "integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -873,6 +1547,21 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, + "slice-ansi": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, "sshpk": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz", @@ -923,6 +1612,44 @@ "has-flag": "^3.0.0" } }, + "table": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/table/-/table-5.1.0.tgz", + "integrity": "sha512-e542in22ZLhD/fOIuXs/8yDZ9W61ltF8daM88rkRNtgTIct+vI2fTnAyu/Db2TCfEcI8i7mjZz6meLq0nW7TYg==", + "dev": true, + "requires": { + "ajv": "^6.5.3", + "lodash": "^4.17.10", + "slice-ansi": "1.0.0", + "string-width": "^2.1.1" + }, + "dependencies": { + "ajv": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.4.tgz", + "integrity": "sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + } + } + }, "term-size": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", @@ -931,6 +1658,12 @@ "execa": "^0.7.0" } }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -957,6 +1690,12 @@ "punycode": "^1.4.1" } }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "dev": true + }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", @@ -971,6 +1710,15 @@ "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", "optional": true }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, "unique-string": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", @@ -1006,6 +1754,23 @@ "xdg-basedir": "^3.0.0" } }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + } + } + }, "url-parse-lax": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", @@ -1045,6 +1810,27 @@ "string-width": "^2.1.1" } }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, "write-file-atomic": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", diff --git a/app-cli/package.json b/app-cli/package.json index caf481a..669bc7c 100644 --- a/app-cli/package.json +++ b/app-cli/package.json @@ -27,6 +27,13 @@ ], "author": "Kasra Bigdeli", "license": "Apache-2.0", + "lint-staged": { + "./**/*.{js}": [ + "co-eslint", + "co-prettier --write", + "git add" + ] + }, "dependencies": { "chalk": "^2.1.0", "command-exists": "^1.2.2", @@ -38,5 +45,10 @@ "progress": "^2.0.0", "request": "^2.83.0", "update-notifier": "^2.3.0" + }, + "devDependencies": { + "eslint": "^5.8.0", + "eslint-plugin-jest": "^21.26.2", + "prettier": "^1.14.3" } } From 0ce0f1fb5270c66fa9b76a516a8dab4caebe5ebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Trevi=C3=B1o?= Date: Tue, 30 Oct 2018 08:30:59 +0100 Subject: [PATCH 02/44] Change folder structure and starting to refactor files --- app-cli/captainduckduck-deploy.js | 748 ------------------------- app-cli/captainduckduck-list.js | 40 -- app-cli/captainduckduck-login.js | 225 -------- app-cli/captainduckduck-logout.js | 91 --- app-cli/captainduckduck-serversetup.js | 466 --------------- app-cli/captainduckduck.js | 56 +- app-cli/lib/deploy.js | 440 +++++++++++++++ app-cli/lib/list.js | 29 + app-cli/lib/login.js | 239 ++++++++ app-cli/lib/logout.js | 79 +++ app-cli/lib/serversetup.js | 514 +++++++++++++++++ app-cli/utils/errorHandler.js | 9 + app-cli/utils/fileHandler.js | 178 ++++++ app-cli/utils/loginHandler.js | 194 +++++++ app-cli/utils/spinner.js | 20 +- app-cli/utils/validationsHandler.js | 23 + 16 files changed, 1756 insertions(+), 1595 deletions(-) delete mode 100755 app-cli/captainduckduck-deploy.js delete mode 100644 app-cli/captainduckduck-list.js delete mode 100644 app-cli/captainduckduck-login.js delete mode 100644 app-cli/captainduckduck-logout.js delete mode 100755 app-cli/captainduckduck-serversetup.js create mode 100644 app-cli/lib/deploy.js create mode 100644 app-cli/lib/list.js create mode 100644 app-cli/lib/login.js create mode 100644 app-cli/lib/logout.js create mode 100644 app-cli/lib/serversetup.js create mode 100644 app-cli/utils/errorHandler.js create mode 100644 app-cli/utils/fileHandler.js create mode 100644 app-cli/utils/loginHandler.js create mode 100644 app-cli/utils/validationsHandler.js diff --git a/app-cli/captainduckduck-deploy.js b/app-cli/captainduckduck-deploy.js deleted file mode 100755 index a0190e2..0000000 --- a/app-cli/captainduckduck-deploy.js +++ /dev/null @@ -1,748 +0,0 @@ -#!/usr/bin/env node -const program = require('commander'); -const fs = require('fs-extra'); -const path = require('path'); -const chalk = require('chalk'); -const inquirer = require('inquirer'); -const configstore = require('configstore'); -const request = require('request'); -const commandExistsSync = require('command-exists').sync; -const ProgressBar = require('progress'); -const ora = require('ora'); -const {exec} = require('child_process'); - -const packagejson = require('./package.json'); - -const configs = new configstore(packagejson.name, { - captainMachines: [], - apps: [] -}); - -const BRANCH_TO_PUSH = 'branchToPush'; -const APP_NAME = 'appName'; -const MACHINE_TO_DEPLOY = 'machineToDeploy'; -const EMPTY_STRING = ''; - -console.log(' '); -console.log(' '); - -program - .description('Deploy current directory to a Captain machine.') - .option('-t, --tarFile ', 'Specify file to be uploaded (rather than using git archive)') - .option('-d, --default', 'Run with default options') - .option('-s, --stateless', 'Run deploy stateless') - .option('-h, --host ', 'Only for stateless mode: Host of the captain machine') - .option('-a, --appName ', 'Only for stateless mode: Name of the app') - .option('-p, --pass ', 'Only for stateless mode: Password for Captain') - .option('-b, --branch ', 'Only for stateless mode: Branch name (default master)') - .parse(process.argv); - - -if (program.args.length) { - console.error(chalk.red('Unrecognized commands:')); - program.args.forEach(function (arg) { - console.log(chalk.red(arg)); - }); - console.error(chalk.red('Deploy does not require any options. ')); - process.exit(1); -} - -function printErrorAndExit(error) { - console.log(chalk.bold.red(error)); - console.log(' '); - console.log(' '); - process.exit(0); -} - -function getSuppliedTarFile() { - return program.tarFile; -} - -if (!getSuppliedTarFile()) { - - if (!fs.pathExistsSync('./.git')) { - printErrorAndExit('**** ERROR: You are not in a git root directory. This command will only deploys the current directory ****'); - } - - if (!fs.pathExistsSync('./captain-definition')) { - printErrorAndExit('**** ERROR: captain-definition file cannot be found. Please see docs! ****'); - } - - const contents = fs.readFileSync('./captain-definition', 'utf8'); - let contentsJson = null; - - try { - contentsJson = JSON.parse(contents); - } catch (e) { - console.log(e); - console.log(''); - printErrorAndExit('**** ERROR: captain-definition file is not a valid JSON! ****'); - } - - if (!contentsJson.schemaVersion) { - printErrorAndExit('**** ERROR: captain-definition needs schemaVersion. Please see docs! ****'); - } - - if (!contentsJson.templateId && !contentsJson.dockerfileLines) { - printErrorAndExit('**** ERROR: captain-definition needs templateId or dockerfileLines. Please see docs! ****'); - } - - if (contentsJson.templateId && contentsJson.dockerfileLines) { - printErrorAndExit('**** ERROR: captain-definition needs templateId or dockerfileLines, NOT BOTH! Please see docs! ****'); - } -} - -let listOfMachines = [{ - name: '-- CANCEL --', - value: EMPTY_STRING, - short: EMPTY_STRING -}]; - -let machines = configs.get('captainMachines'); -for (let i = 0; i < machines.length; i++) { - let m = machines[i]; - listOfMachines.push({ - name: m.name + ' at ' + m.baseUrl, - value: m.name, - short: m.name + ' at ' + m.baseUrl - }) -} - -// Gets default value for propType that is stored in a directory. -// Replaces getAppForDirectory -function getPropForDirectory(propType) { - let apps = configs.get('apps'); - for (let i = 0; i < apps.length; i++) { - let app = apps[i]; - if (app.cwd === process.cwd()) { - return app[propType]; - } - } - return undefined; -} - -// Sets default value for propType that is stored in a directory to propValue. -// Replaces saveAppForDirectory -function savePropForDirectory(propType, propValue) { - let apps = configs.get('apps'); - for (let i = 0; i < apps.length; i++) { - let app = apps[i]; - if (app.cwd === process.cwd()) { - app[propType] = propValue; - configs.set('apps', apps); - return; - } - } - - apps.push({ - cwd: process.cwd(), - [propType]: propValue - }); - - configs.set('apps', apps); -} - - -function getDefaultMachine() { - let machine = getPropForDirectory(MACHINE_TO_DEPLOY); - if (machine) { - return machine.name; - } - if (listOfMachines.length == 2) { - return 1; - } - return EMPTY_STRING; -} - -console.log('Preparing deployment to Captain...'); -console.log(' '); - - -const questions = [ - { - type: 'list', - name: 'captainNameToDeploy', - default: getDefaultMachine(), - message: 'Select the Captain Machine you want to deploy to:', - choices: listOfMachines - }, - { - type: 'input', - default: getPropForDirectory(BRANCH_TO_PUSH) || 'master', - name: BRANCH_TO_PUSH, - message: 'Enter the "git" branch you would like to deploy:', - when: function (answers) { - return !!answers.captainNameToDeploy; - } - }, - { - type: 'input', - default: getPropForDirectory(APP_NAME), - name: APP_NAME, - message: 'Enter the Captain app name this directory will be deployed to:', - when: function (answers) { - return !!answers.captainNameToDeploy; - } - }, - { - type: 'confirm', - name: 'confirmedToDeploy', - message: 'Note that uncommitted files and files in gitignore (if any) will not be pushed to server. Please confirm so that deployment process can start.', - default: true, - when: function (answers) { - return !!answers.captainNameToDeploy; - } - } -]; - -let defaultInvalid = false; - -if (program.default) { - - if (!getDefaultMachine() || !getPropForDirectory(BRANCH_TO_PUSH) || !getPropForDirectory(APP_NAME)) { - console.log('Default deploy failed. Please select deploy options.'); - defaultInvalid = true; - } - else { - console.log('Deploying to ' + getPropForDirectory(MACHINE_TO_DEPLOY).name); - deployTo(getPropForDirectory(MACHINE_TO_DEPLOY), getPropForDirectory(BRANCH_TO_PUSH), getPropForDirectory(APP_NAME)); - } - -} - -const isStateless = program.stateless && program.host && program.appName && program.pass; - -if (isStateless) { - // login first - console.log('Trying to login to', program.host) - requestLoginAuth(program.host, program.pass, function (authToken) { - // deploy - console.log('Starting stateless deploy to', program.host, program.branch, program.appName); - deployTo({ - baseUrl: program.host, - authToken, - }, program.branch || 'master', program.appName); - }); -} -else if (!program.default || defaultInvalid) { - - inquirer.prompt(questions).then(function (answers) { - - console.log(' '); - console.log(' '); - - if (!answers.confirmedToDeploy) { - console.log('Operation cancelled by the user...'); - console.log(' '); - } - else { - let machines = configs.get('captainMachines'); - let machineToDeploy = null; - for (let i = 0; i < machines.length; i++) { - if (machines[i].name === answers.captainNameToDeploy) { - console.log('Deploying to ' + answers.captainNameToDeploy); - machineToDeploy = machines[i]; - break; - } - } - - console.log(' '); - deployTo(machineToDeploy, answers.branchToPush, answers.appName); - } - - }); - -} - -function deployTo(machineToDeploy, branchToPush, appName) { - - function checkAuthAndSendFile(zipFileFullPath, gitHash) { - function isAuthTokenValidCallback(isValid) { - if (isValid) { - sendFileToCaptain(machineToDeploy, zipFileFullPath, appName, gitHash, branchToPush); - } - else { - - requestLogin(machineToDeploy.name, machineToDeploy.baseUrl, function callback(machineToDeployNew) { - - deployTo(machineToDeployNew, branchToPush, appName); - - }); - } - } - - isAuthTokenValid(machineToDeploy, appName, isAuthTokenValidCallback); - } - - if (getSuppliedTarFile()) { - checkAuthAndSendFile(path.join(process.cwd(), getSuppliedTarFile()), 'sendviatarfile'); - return; - } - - if (!commandExistsSync('git')) { - console.log(chalk.red('"git" command not found...')); - console.log(chalk.red('Captain needs "git" to create tar file of your source files...')); - console.log(' '); - process.exit(1); - } - - let zipFileNameToDeploy = 'temporary-captain-to-deploy.tar'; - let zipFileFullPath = path.join(process.cwd(), zipFileNameToDeploy); - - console.log('Saving tar file to:'); - console.log(zipFileFullPath); - console.log(' '); - - try { - fs.removeSync(zipFileFullPath); - } catch (ignoreError) { - - } - - exec('git archive --format tar --output "' + zipFileFullPath + '" ' + branchToPush, function (err, stdout, stderr) { - if (err) { - console.log(chalk.red('TAR file failed')); - console.log(chalk.red(err + ' ')); - console.log(' '); - fs.removeSync(zipFileFullPath); - return; - } - - exec('git rev-parse ' + branchToPush, function (err, stdout, stderr) { - - const gitHash = (stdout || '').trim(); - - if (err || !(/^[a-f0-9]{40}$/.test(gitHash))) { - console.log(chalk.red('Cannot find hash of last commit on this branch: ' + branchToPush)); - console.log(chalk.red(gitHash + ' ')); - console.log(chalk.red(err + ' ')); - console.log(' '); - return; - } - - console.log('Pushing last commit on ' + branchToPush + ': ' + gitHash); - - checkAuthAndSendFile(zipFileFullPath, gitHash); - - }); - }); - -} - -function sendFileToCaptain(machineToDeploy, zipFileFullPath, appName, gitHash, branchToPush) { - - console.log('Uploading file to ' + machineToDeploy.baseUrl); - - const fileSize = fs.statSync(zipFileFullPath).size; - const fileStream = fs.createReadStream(zipFileFullPath); - - const barOpts = { - width: 20, - total: fileSize, - clear: true - }; - const bar = new ProgressBar(' uploading [:bar] :percent (ETA :etas)', barOpts); - fileStream.on('data', function (chunk) { - bar.tick(chunk.length); - }); - - let spinner; - - fileStream.on('end', function () { - console.log(' '); - console.log('This might take several minutes. PLEASE BE PATIENT...'); - spinner = ora('Building your source code...').start(); - spinner.color = 'yellow'; - }); - - - let options = { - url: machineToDeploy.baseUrl + '/api/v1/user/appData/' + appName + '/?detached=1', - headers: { - 'x-namespace': 'captain', - 'x-captain-auth': machineToDeploy.authToken - }, - method: 'POST', - formData: { - sourceFile: fileStream, - gitHash: gitHash - } - }; - - function callback(error, response, body) { - - if (spinner) { - spinner.stop(); - } - - if (fs.pathExistsSync(zipFileFullPath)) { - if (!getSuppliedTarFile()) { - fs.removeSync(zipFileFullPath); - } - } - - try { - - if (!error && response.statusCode === 200) { - - let data = JSON.parse(body); - - if (data.status === 1106) { - // expired token - requestLogin(machineToDeploy.name, machineToDeploy.baseUrl, function callback(machineToDeployNew) { - - deployTo(machineToDeployNew, branchToPush, appName); - - }); - - return; - } - - if (data.status !== 100 && data.status !== 101) { - throw new Error(JSON.stringify(data, null, 2)); - } - - savePropForDirectory(APP_NAME, appName); - savePropForDirectory(BRANCH_TO_PUSH, branchToPush); - savePropForDirectory(MACHINE_TO_DEPLOY, machineToDeploy); - - if (data.status === 100) { - console.log(chalk.green('Deployed successfully: ') + appName); - console.log(' '); - } else if (data.status === 101) { - console.log(chalk.green('Building started: ') + appName); - console.log(' '); - startFetchingBuildLogs(machineToDeploy, appName); - } - - return; - } - - if (error) { - throw new Error(error) - } - - throw new Error(response ? JSON.stringify(response, null, 2) : 'Response NULL'); - - } catch (error) { - - console.error(chalk.red('\nSomething bad happened. Cannot deploy "' + appName + '"\n')); - - if (error.message) { - try { - var errorObj = JSON.parse(error.message); - if (errorObj.status) { - console.error(chalk.red('\nError code: ' + errorObj.status)); - console.error(chalk.red('\nError message:\n\n ' + errorObj.description)); - } else { - throw new Error("NOT API ERROR"); - } - } catch (ignoreError) { - console.error(chalk.red(error.message)); - } - } else { - console.error(chalk.red(error)); - } - console.log(' '); - } - } - - request(options, callback); - -} - -var lastLineNumberPrinted = -10000; // we want to show all lines to begin with! - -function startFetchingBuildLogs(machineToDeploy, appName) { - - let options = { - url: machineToDeploy.baseUrl + '/api/v1/user/appData/' + appName, - headers: { - 'x-namespace': 'captain', - 'x-captain-auth': machineToDeploy.authToken - }, - method: 'GET' - }; - - function onLogRetrieved(data) { - - if (data) { - var lines = data.logs.lines; - var firstLineNumberOfLogs = data.logs.firstLineNumber; - var firstLinesToPrint = 0; - if (firstLineNumberOfLogs > lastLineNumberPrinted) { - - if (firstLineNumberOfLogs < 0) { - // This is the very first fetch, probably firstLineNumberOfLogs is around -50 - firstLinesToPrint = -firstLineNumberOfLogs; - } else { - console.log('[[ TRUNCATED ]]'); - } - - } else { - firstLinesToPrint = lastLineNumberPrinted - firstLineNumberOfLogs; - } - - lastLineNumberPrinted = firstLineNumberOfLogs + lines.length; - - for (var i = firstLinesToPrint; i < lines.length; i++) { - console.log((lines[i] || '').trim()); - } - } - - if (data && !data.isAppBuilding) { - console.log(' '); - if (!data.isBuildFailed) { - console.log(chalk.green('Deployed successfully: ') + appName); - console.log(chalk.magenta('App is available at ') - + (machineToDeploy.baseUrl.replace('//captain.', '//' + appName + '.').replace('https://', 'http://')) - ); - } else { - console.error(chalk.red('\nSomething bad happened. Cannot deploy "' + appName + '"\n')); - } - console.log(' '); - return; - } - - setTimeout(function () { - startFetchingBuildLogs(machineToDeploy, appName); - }, 2000); - } - - - function callback(error, response, body) { - - try { - - if (!error && response.statusCode === 200) { - - let data = JSON.parse(body); - - if (data.status !== 100) { - throw new Error(JSON.stringify(data, null, 2)); - } - - onLogRetrieved(data.data); - - return; - } - - if (error) { - throw new Error(error) - } - - throw new Error(response ? JSON.stringify(response, null, 2) : 'Response NULL'); - - } catch (error) { - - console.error(chalk.red('\nSomething while retrieving app build logs.. "' + error + '"\n')); - - onLogRetrieved(null); - } - } - - request(options, callback); -} - -function isAuthTokenValid(machineToDeploy, appName, isAuthTokenValidCallback) { - - let options = { - url: machineToDeploy.baseUrl + '/api/v1/user/appDefinitions/', - headers: { - 'x-namespace': 'captain', - 'x-captain-auth': machineToDeploy.authToken - }, - method: 'GET' - }; - - - function callback(error, response, body) { - - try { - - if (!error && response.statusCode === 200) { - - let data = JSON.parse(body); - - if (data.status === 1106 || data.status === 1105) { - isAuthTokenValidCallback(false); - } - else { - isAuthTokenValidCallback(true); - } - } - - } catch (error) { - // This is just a sanity check. We only fire FALSE (i.e. expired) if we know it's expired or password is wrong - isAuthTokenValidCallback(true); - } - } - - request(options, callback); -} - -function requestLoginAuth(serverAddress, password, authCallback) { - let options = { - url: serverAddress + '/api/v1/login', - headers: { - 'x-namespace': 'captain' - }, - method: 'POST', - form: { - password: password - } - }; - - function callback(error, response, body) { - - try { - - if (!error && response.statusCode === 200) { - - let data = JSON.parse(body); - - if (data.status !== 100) { - throw new Error(JSON.stringify(data, null, 2)); - } - - authCallback(data.token); - - return; - } - - if (error) { - throw new Error(error) - } - - throw new Error(response ? JSON.stringify(response, null, 2) : 'Response NULL'); - - } catch (error) { - - if (error.message) { - try { - var errorObj = JSON.parse(error.message); - if (errorObj.status) { - console.error(chalk.red('\nError code: ' + errorObj.status)); - console.error(chalk.red('\nError message:\n\n ' + errorObj.description)); - } else { - throw new Error("NOT API ERROR"); - } - } catch (ignoreError) { - console.error(chalk.red(error.message)); - } - } else { - console.error(chalk.red(error)); - } - console.log(' '); - - } - - process.exit(0); - } - - request(options, callback); -} - -function requestLogin(serverName, serverAddress, loginCallback) { - - console.log('Your auth token is not valid anymore. Try to login again.'); - - const questions = [ - { - type: 'password', - name: 'captainPassword', - message: 'Please enter your password for ' + serverAddress, - validate: function (value) { - - if (value && value.trim()) { - return true; - } - - return ('Please enter your password for ' + serverAddress); - } - } - ]; - - function updateAuthTokenInConfigStoreAndReturn(authToken) { - - let machines = configs.get('captainMachines'); - for (let i = 0; i < machines.length; i++) { - if (machines[i].name === serverName) { - var baseUrl = machines[i].authToken = authToken; - configs.set('captainMachines', machines); - console.log('You are now logged back in to ' + serverAddress); - return machines[i]; - } - } - } - - - inquirer.prompt(questions).then(function (passwordAnswers) { - - var password = passwordAnswers.captainPassword; - - let options = { - url: serverAddress + '/api/v1/login', - headers: { - 'x-namespace': 'captain' - }, - method: 'POST', - form: { - password: password - } - }; - - function callback(error, response, body) { - - try { - - if (!error && response.statusCode === 200) { - - let data = JSON.parse(body); - - if (data.status !== 100) { - throw new Error(JSON.stringify(data, null, 2)); - } - - var newMachineToDeploy = updateAuthTokenInConfigStoreAndReturn(data.token); - - loginCallback(newMachineToDeploy); - - return; - } - - if (error) { - throw new Error(error) - } - - throw new Error(response ? JSON.stringify(response, null, 2) : 'Response NULL'); - - } catch (error) { - - if (error.message) { - try { - var errorObj = JSON.parse(error.message); - if (errorObj.status) { - console.error(chalk.red('\nError code: ' + errorObj.status)); - console.error(chalk.red('\nError message:\n\n ' + errorObj.description)); - } else { - throw new Error("NOT API ERROR"); - } - } catch (ignoreError) { - console.error(chalk.red(error.message)); - } - } else { - console.error(chalk.red(error)); - } - console.log(' '); - - } - - process.exit(0); - } - - request(options, callback); - - }); - -} diff --git a/app-cli/captainduckduck-list.js b/app-cli/captainduckduck-list.js deleted file mode 100644 index dc3d049..0000000 --- a/app-cli/captainduckduck-list.js +++ /dev/null @@ -1,40 +0,0 @@ -const program = require('commander'); -const fs = require('fs'); -const path = require('path'); -const chalk = require('chalk'); -const inquirer = require('inquirer'); -const configstore = require('configstore'); -const request = require('request'); - -const packagejson = require('./package.json'); - - -const configs = new configstore(packagejson.name, { - captainMachines: [] -}); - - -program - .description('List all Captain machines currently logged in.') - .parse(process.argv); - -if (program.args.length) { - console.error(chalk.red('Unrecognized commands:')); - program.args.forEach(function (arg) { - console.log(chalk.red(arg)); - }); - console.error(chalk.red('List does not require any options. ')); - process.exit(1); -} -console.log(); -console.log('Logged in Captain Machines:'); -console.log(); -let machines = configs.get('captainMachines'); -for (let i = 0; i < machines.length; i++) { - - console.log('>> ' + chalk.greenBright(machines[i].name) + ' at ' + chalk.cyan(machines[i].baseUrl)); - -} -console.log(); - - diff --git a/app-cli/captainduckduck-login.js b/app-cli/captainduckduck-login.js deleted file mode 100644 index 2e9ac23..0000000 --- a/app-cli/captainduckduck-login.js +++ /dev/null @@ -1,225 +0,0 @@ -const program = require('commander'); -const fs = require('fs'); -const path = require('path'); -const chalk = require('chalk'); -const inquirer = require('inquirer'); -const configstore = require('configstore'); -const request = require('request'); - -const packagejson = require('./package.json'); - - -const configs = new configstore(packagejson.name, { - captainMachines: [] -}); - - -program - .description('Login to a CaptainDuckDuck machine. You can be logged in to multiple machines simultaneously.') - .parse(process.argv); - - -function cleanUpUrl(url) { - if (!url) { - return url; - } - url = url.trim(); - url = url.replace('http://', '').replace('https://', ''); - if (!url || !url.length) { - return url; - } - - if (url.substr(url.length - 1, 1) === '/') { - url = url.substr(0, url.length - 1); - } - return url; -} - - -if (program.args.length) { - console.error(chalk.red('Unrecognized commands:')); - program.args.forEach(function (arg) { - console.log(chalk.red(arg)); - }); - console.error(chalk.red('Login does not require any options. ')); - process.exit(1); -} - -function findDefaultCaptainName() { - - let machines = configs.get('captainMachines'); - let currentSuffix = machines.length + 1; - - function getCaptainFullName(suffix) { - if (suffix < 10) { - suffix = '0' + suffix; - } - return 'captain-' + suffix; - } - - function isSuffixValid(suffixNumber) { - for (let i = 0; i < machines.length; i++) { - let m = machines[i]; - if (m.name === getCaptainFullName(suffixNumber)) { - return false; - } - } - return true; - } - - while (!isSuffixValid(currentSuffix)) { - currentSuffix++; - } - - return getCaptainFullName(currentSuffix); -} - -console.log('Login to a Captain Machine'); - -const SAMPLE_DOMAIN = 'captain.captainroot.yourdomain.com'; - -const questions = [ - { - type: 'input', - default: SAMPLE_DOMAIN, - name: 'captainAddress', - message: 'Enter address of the Captain machine. \nIt is captain.[your-captain-root-domain] :', - validate: function (value) { - - if (value===SAMPLE_DOMAIN){ - return 'Enter a valid URL'; - } - - if (!cleanUpUrl(value)) { - return 'This is an invalid URL: ' + value; - } - - let machines = configs.get('captainMachines'); - for (let i = 0; i < machines.length; i++) { - if (cleanUpUrl(machines[i].baseUrl) === cleanUpUrl(value)) { - return value + ' already exist as ' + machines[i].name + '. If you want to replace the existing entry, you have to first use command, and then re-login.' - } - } - - if (value && value.trim()) { - return true; - } - - return 'Please enter a valid address.'; - } - }, - { - type: 'confirm', - name: 'captainHasRootSsl', - message: 'Is HTTPS activated for this Captain machine?', - default: true - }, - { - type: 'password', - name: 'captainPassword', - message: 'Enter your password:', - validate: function (value) { - - if (value && value.trim()) { - return true; - } - - return 'Please enter your password.'; - } - }, - { - type: 'input', - name: 'captainName', - message: 'Enter a name for this Captain machine:', - default: findDefaultCaptainName(), - validate: function (value) { - - let machines = configs.get('captainMachines'); - for (let i = 0; i < machines.length; i++) { - if (machines[i].name === value) { - return value + ' already exist. If you want to replace the existing entry, you have to first use command, and then re-login.' - } - } - - if (value.match(/^[-\d\w]+$/i)) { - return true; - } - - return 'Please enter a Captain Name.'; - } - } -]; - -inquirer.prompt(questions).then(function (answers) { - - - console.log(' '); - console.log(' '); - - let baseUrl = (answers.captainHasRootSsl ? 'https://' : 'http://') + cleanUpUrl(answers.captainAddress); - - let options = { - url: baseUrl + '/api/v1/login', - headers: { - 'x-namespace': 'captain' - }, - method: 'POST', - form: { - password: answers.captainPassword - } - }; - - function setCaptainMachine(data) { - let machines = configs.get('captainMachines'); - machines.push(data); - configs.set('captainMachines', machines); - } - - function callback(error, response, body) { - - let captainNameEnterByUser = answers.captainName; - - try { - - if (!error && response.statusCode === 200) { - - let data = JSON.parse(body); - - if (data.status !== 100) { - throw new Error(JSON.stringify(data, null, 2)); - } - - console.log(chalk.green('Logged in successfully to ') + baseUrl); - console.log(chalk.green('Authorization token is now saved as ' + captainNameEnterByUser)); - console.log(' '); - - - setCaptainMachine({ - authToken: data.token, - baseUrl: baseUrl, - name: captainNameEnterByUser - }); - - return; - } - - if (error) { - throw new Error(error) - } - - throw new Error(response ? JSON.stringify(response, null, 2) : 'Response NULL'); - - } catch (error) { - console.error(chalk.red('Something bad happened. Cannot save "' + captainNameEnterByUser + '"')); - let errorMessage = error.message ? error.message : error; - console.error(chalk.red(errorMessage)); - console.log(' '); - } - } - - request(options, callback); - -}); - - - diff --git a/app-cli/captainduckduck-logout.js b/app-cli/captainduckduck-logout.js deleted file mode 100644 index 0ae3d1b..0000000 --- a/app-cli/captainduckduck-logout.js +++ /dev/null @@ -1,91 +0,0 @@ -const program = require('commander'); -const fs = require('fs'); -const path = require('path'); -const chalk = require('chalk'); -const inquirer = require('inquirer'); -const configstore = require('configstore'); -const request = require('request'); - -const packagejson = require('./package.json'); - - -const configs = new configstore(packagejson.name, { - captainMachines: [] -}); - - -program - .description('Logout from a specific Captain machine.') - .parse(process.argv); - - -if (program.args.length) { - console.error(chalk.red('Unrecognized commands:')); - program.args.forEach(function (arg) { - console.log(chalk.red(arg)); - }); - console.error(chalk.red('Logout does not require any options. ')); - process.exit(1); -} - -let listOfMachines = [{ - name: '-- CANCEL --', - value: '', - short: '' -}]; -let machines = configs.get('captainMachines'); -for (let i = 0; i < machines.length; i++) { - let m = machines[i]; - listOfMachines.push({ - name: m.name + ' at ' + m.baseUrl, - value: m.name, - short: m.name + ' at ' + m.baseUrl - }) -} - -console.log('Logout from a Captain Machine and clear auth info'); - -const questions = [ - { - type: 'list', - name: 'captainNameToLogout', - message: 'Select the Captain Machine you want to logout from:', - choices: listOfMachines - }, - { - type: 'confirm', - name: 'confirmedToLogout', - message: 'Are you sure you want to logout from this Captain machine?', - default: false, - when: function (answers) { - return !!answers.captainNameToLogout; - } - } -]; - -inquirer.prompt(questions).then(function (answers) { - - console.log(' '); - console.log(' '); - - if (!answers.captainNameToLogout) { - console.log('Operation cancelled by the user...'); - } - else { - let machines = configs.get('captainMachines'); - for (let i = 0; i < machines.length; i++) { - if (machines[i].name === answers.captainNameToLogout) { - var baseUrl = machines[i].baseUrl; - machines.splice(i,1); - configs.set('captainMachines', machines); - console.log('You are now logged out from ' + answers.captainNameToLogout + ' at ' + baseUrl + '...'); - break; - } - } - } - console.log(' '); - -}); - - - diff --git a/app-cli/captainduckduck-serversetup.js b/app-cli/captainduckduck-serversetup.js deleted file mode 100755 index acb5cae..0000000 --- a/app-cli/captainduckduck-serversetup.js +++ /dev/null @@ -1,466 +0,0 @@ -const program = require('commander'); -const fs = require('fs'); -const path = require('path'); -const chalk = require('chalk'); -const inquirer = require('inquirer'); -const configstore = require('configstore'); -const request = require('request'); -const spinnerUtil = require('./utils/spinner'); - -const packagejson = require('./package.json'); - - -const configs = new configstore(packagejson.name, { - captainMachines: [] -}); - - -program - .description('Easy setup for your Captain server.') - .parse(process.argv); - - -if (program.args.length) { - console.error(chalk.red('Unrecognized commands:')); - program.args.forEach(function (arg) { - console.log(chalk.red(arg)); - }); - console.error(chalk.red('This command does not require any options. ')); - process.exit(1); -} - -function findDefaultCaptainName() { - - let machines = configs.get('captainMachines'); - let currentSuffix = machines.length + 1; - - function getCaptainFullName(suffix) { - if (suffix < 10) { - suffix = '0' + suffix; - } - return 'captain-' + suffix; - } - - function isSuffixValid(suffixNumber) { - for (let i = 0; i < machines.length; i++) { - let m = machines[i]; - if (m.name === getCaptainFullName(suffixNumber)) { - return false; - } - } - return true; - } - - while (!isSuffixValid(currentSuffix)) { - currentSuffix++; - } - - return getCaptainFullName(currentSuffix); -} - -function isIpAddress(ipaddress) { - if (/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(ipaddress)) { - return (true) - } - return (false) -} - - -console.log(' '); -console.log('Setup your Captain server'); -console.log(' '); - -const SAMPLE_IP = '123.123.123.123'; - -var authTokenFromLogin = null; -var ipAddressOfServer = null; -var customDomainFromUser = null; -var newPasswordFirstTry = null; -var oldPassword = 'captain42'; - -function setCustomDomain(baseApiUrl, customDomain) { - - return apiEndpointWithLoading('Changing Domain...')('POST', baseApiUrl, '/api/v1/user/system/changerootdomain/', { - rootDomain: customDomain - }); -} - -function enableHttps(baseApiUrl, emailAddress) { - - return apiEndpointWithLoading('Enabling SSL...')('POST', baseApiUrl, '/api/v1/user/system/enablessl/', { - emailAddress: emailAddress - }); - -} - -function changePass(baseApiUrl, newPass) { - - return apiEndpointWithLoading('Changing Password...')('POST', baseApiUrl, '/api/v1/user/changepassword/', { - oldPassword: oldPassword, - newPassword: newPass - }); - -} - -function forceHttps(baseApiUrl) { - - return apiEndpointWithLoading('Forcing SSL...')('POST', baseApiUrl, '/api/v1/user/system/forcessl/', { - isEnabled: true - }); -} - -// returns promise that resolves to auth token -// rejects with ErrorCode or null -function login(baseApiUrl, password) { - - return apiEndpointWithLoading('Login...')('POST', baseApiUrl, '/api/v1/login', { - password: password - }).then(function (data) { - return data.token; - }) - -} - -function apiEndpointWithLoading(message) { - return (method, baseApiUrl, endpoint, dataToSend) => { - return apiEndpoint(method, baseApiUrl, endpoint, dataToSend, message) - } -} - -function apiEndpoint(method, baseApiUrl, endpoint, dataToSend, message) { - - let options = { - url: baseApiUrl + endpoint, - headers: { - 'x-namespace': 'captain', - 'x-captain-auth': authTokenFromLogin - }, - method: method, - form: dataToSend - }; - - return new Promise(function (res, rej) { - - let spinner; - if (message) { - spinner = spinnerUtil.start(message); - } - var callback = function (error, response, body) { - try { - - if (!error && response.statusCode === 200) { - - let data = JSON.parse(body); - - if (data.status !== 100) { - if (spinner) { - spinnerUtil.fail(spinner); - } - rej(data); - return; - } - if (spinner) { - spinnerUtil.succeed(spinner); - } - res(data); - - return; - } - - if (error) { - throw new Error(error) - } - - throw new Error(response ? JSON.stringify(response, null, 2) : 'Response NULL'); - - } catch (error) { - if (spinner) { - spinnerUtil.fail(spinner); - } - console.error(chalk.red('Something bad happened. Cannot connect to "' + baseApiUrl + endpoint + '"')); - let errorMessage = error.message ? error.message : error; - console.error(chalk.red(errorMessage)); - console.log(' '); - process.exit(0); - } - } - - request(options, callback); - - }); -} - -const questions = [ - { - type: 'list', - name: 'hasInstalledCaptain', - message: 'Have you already installed Captain on your server by running the following line:' - + '\nmkdir /captain && docker run -v /var/run/docker.sock:/var/run/docker.sock dockersaturn/captainduckduck ?', - default: 'Yes', - choices: ['Yes', 'No'], - filter: function (value) { - return new Promise(function (res, rej) { - - if (value === 'Yes') { - res(true); - return; - } - - console.log(''); - console.log(''); - console.log(' Cannot start the setup process if Captain is not installed.'); - console.log(' Please read tutorial on CaptainDuckDuck.com' - + ' to learn how to install CaptainDuckDuck on a server.'); - console.log(''); - - process.exit(0); - }); - } - }, - { - type: 'input', - default: SAMPLE_IP, - name: 'captainAddress', - message: 'Enter IP address of your captain server:', - filter: function (value) { - return new Promise(function (res, rej) { - - if (value === SAMPLE_IP) { - rej('Enter a valid IP Address'); - return; - } - - if (!isIpAddress(value.trim())) { - rej('This is an invalid IP Address: ' + value); - return; - } - - ipAddressOfServer = value.trim(); - - //login using captain42. - - return login('http://' + ipAddressOfServer + ':3000', oldPassword) - .then(function (authTokenFetched) { - authTokenFromLogin = authTokenFetched; - res(ipAddressOfServer); - }) - .catch(function (error) { - - // if error is anything but password wrong, exit here... - if (error.status == 1105) { - authTokenFromLogin = null; - res(ipAddressOfServer); - return; - } - - console.log(''); - - if (error.status) { - console.log(chalk.red('Error: ' + error.status)); - console.log(chalk.red('Error: ' + error.description)); - } else { - console.log(chalk.red('Error: ' + error)); - } - - process.exit(0); - - - }); - }) - } - }, - { - type: 'password', - name: 'captainOriginalPassword', - message: 'Enter your current password:', - when: function () { - return !authTokenFromLogin; - }, - filter: function (value) { - return new Promise(function (res, rej) { - - console.log(''); - - return login('http://' + ipAddressOfServer + ':3000', value) - .then(function (authTokenFetched) { - authTokenFromLogin = authTokenFetched; - oldPassword = value; - res(value); - }) - .catch(function (error) { - console.log(''); - - if (error.status) { - console.log(chalk.red('Error: ' + error.status)); - console.log(chalk.red('Error: ' + error.description)); - } else { - console.log(chalk.red('Error: ' + error)); - } - - process.exit(0); - }); - }) - } - }, - { - type: 'input', - name: 'captainRootDomain', - message: 'Enter a root domain for this Captain server. For example, enter test.yourdomain.com if you' + - ' setup your DNS to point *.test.yourdomain.com to ip address of your server' + ': ', - filter: function (value) { - return new Promise(function (res, rej) { - - value = value.trim(); - - customDomainFromUser = 'captain.' + value; - - return setCustomDomain('http://' + ipAddressOfServer + ':3000', value) - .then(function () { - res(customDomainFromUser); - }) - .catch(function (error) { - console.log(''); - if (error.status) { - console.log(chalk.red('Error: ' + error.status)); - console.log(chalk.red('Error: ' + error.description)); - } else { - console.log(chalk.red('Error: ' + error)); - } - process.exit(0); - }); - }) - } - }, - { - type: 'input', - name: 'emailAddress', - message: 'Enter your "valid" email address to enable HTTPS: ', - filter: function (value) { - return new Promise(function (res, rej) { - - console.log(''); - value = value.trim(); - - return enableHttps('http://' + customDomainFromUser, value) - .then(function () { - return forceHttps('https://' + customDomainFromUser); - }) - .then(function () { - res(value); - }) - .catch(function (error) { - console.log(''); - if (error.status) { - console.log(chalk.red('Error: ' + error.status)); - console.log(chalk.red('Error: ' + error.description)); - } else { - console.log(chalk.red('Error: ' + error)); - } - - process.exit(0); - }); - }) - } - }, - { - type: 'password', - name: 'newPasswordFirstTry', - message: 'Enter a new password:', - filter: function (value) { - return new Promise(function (res, rej) { - - newPasswordFirstTry = value; - res(value); - - }) - } - }, - { - type: 'password', - name: 'newPassword', - message: 'Enter a new password:', - filter: function (value) { - return new Promise(function (res, rej) { - - if (newPasswordFirstTry !== value) { - rej('Passwords do not match'); - //process.exit(0); - return; - } - - return changePass('https://' + customDomainFromUser, value) - .then(function () { - return login('https://' + customDomainFromUser, value) - }) - .then(function (token) { - authTokenFromLogin = token; - res(value); - }) - .catch(function (error) { - console.log(''); - if (error.status) { - console.log(chalk.red('Error: ' + error.status)); - console.log(chalk.red('Error: ' + error.description)); - } else { - console.log(chalk.red('Error: ' + error)); - } - - console.log(''); - console.log(chalk.red('IMPORTANT!! Server setup is completed by password is not changed.')); - console.log(chalk.red('You CANNOT use serversetup anymore. To continue: ')); - console.log(chalk.red('- Go to https://' + customDomainFromUser - + ' login with default password and change the password in settings.')); - console.log(chalk.red('- In terminal (here), type captainduckduck login and enter this as your root domain: ' + customDomainFromUser)); - - process.exit(0); - }); - }) - } - }, - { - type: 'input', - name: 'captainName', - message: 'Enter a name for this Captain machine:', - default: findDefaultCaptainName(), - validate: function (value) { - - let machines = configs.get('captainMachines'); - for (let i = 0; i < machines.length; i++) { - if (machines[i].name === value) { - return value + ' already exist. If you want to replace the existing entry, you have to first use command, and then re-login.' - } - } - - if (value.match(/^[-\d\w]+$/i)) { - return true; - } - - return 'Please enter a Captain Name.'; - } - } -]; - -inquirer.prompt(questions).then(function (answers) { - - - var captainAddress = 'https://' + customDomainFromUser; - let machines = configs.get('captainMachines'); - machines.push({ - authToken: authTokenFromLogin, - baseUrl: captainAddress, - name: answers.captainName - }); - configs.set('captainMachines', machines); - - console.log(' '); - console.log(' '); - console.log('Captain is available at ' + captainAddress); - console.log(' '); - console.log('For more details and docs see http://www.captainduckduck.com'); - console.log(' '); - console.log(' '); - -}); - - - diff --git a/app-cli/captainduckduck.js b/app-cli/captainduckduck.js index 54f933d..3a3b075 100755 --- a/app-cli/captainduckduck.js +++ b/app-cli/captainduckduck.js @@ -1,22 +1,48 @@ #!/usr/bin/env node -const packagejson = require('./package.json'); -const updateNotifier = require('update-notifier'); +const packagejson = require("./package.json") +const updateNotifier = require("update-notifier") -updateNotifier({ pkg: packagejson }).notify({ isGlobal: true }); +updateNotifier({ pkg: packagejson }).notify({ isGlobal: true }) +const program = require("commander") +const fs = require("fs") +const path = require("path") +const chalk = require("chalk") +// Command actions +const list = require("./lib/list") +const logout = require("./lib/logout") -const program = require('commander'); -const fs = require('fs'); -const path = require('path'); -const chalk = require('chalk'); +// Setup +program.version(packagejson.version + "").description(packagejson.description) program - .version(packagejson.version + '') - .description(packagejson.description) - .command('serversetup', 'Performs necessary actions and prepares your Captain server.') - .command('login', 'Login to a CaptainDuckDuck machine. You can be logged in to multiple machines simultaneously.') - .command('logout', 'Logout from a specific Captain machine.') - .command('list', 'List all Captain machines currently logged in.') - .command('deploy', 'Deploy your app (current directory) to a specific Captain machine. You\'ll be prompted to choose your Captain machine.') - .parse(process.argv); + .command( + "serversetup", + "Performs necessary actions and prepares your Captain server." + ) + .command( + "login", + "Login to a CaptainDuckDuck machine. You can be logged in to multiple machines simultaneously." + ) + .command( + "deploy", + "Deploy your app (current directory) to a specific Captain machine. You'll be prompted to choose your Captain machine." + ) + +// Commands +program + .command("logout") + .description("Logout from a specific Captain machine.") + .action(() => { + logout() + }) + +program + .command("list") + .description("List all Captain machines currently logged in.") + .action(() => { + list() + }) + +program.parse(process.argv) diff --git a/app-cli/lib/deploy.js b/app-cli/lib/deploy.js new file mode 100644 index 0000000..7fba8be --- /dev/null +++ b/app-cli/lib/deploy.js @@ -0,0 +1,440 @@ +#!/usr/bin/env node +const program = require("commander") +const fs = require("fs-extra") +const path = require("path") +const chalk = require("chalk") +const inquirer = require("inquirer") +const configstore = require("configstore") +const request = require("request") +const commandExistsSync = require("command-exists").sync +const { exec } = require("child_process") +const { sendFileToCaptain } = require("./utils/fileHandler") +const { + requestLogin, + requestLoginAuth, + isAuthTokenValid +} = require("./utils/loginHandler") +const { + validateIsGitRepository, + validateDefinitionFile +} = require("./utils/validationsHandler") +const { printErrorAndExit } = require("./utils/errorHandler") +const packagejson = require("./package.json") +const configs = new configstore(packagejson.name, { + captainMachines: [], + apps: [] +}) +const BRANCH_TO_PUSH = "branchToPush" +const APP_NAME = "appName" +const MACHINE_TO_DEPLOY = "machineToDeploy" +const EMPTY_STRING = "" + +console.log("\n") + +program + .description("Deploy current directory to a Captain machine.") + .option( + "-t, --tarFile ", + "Specify file to be uploaded (rather than using git archive)" + ) + .option("-d, --default", "Run with default options") + .option("-s, --stateless", "Run deploy stateless") + .option( + "-h, --host ", + "Only for stateless mode: Host of the captain machine" + ) + .option("-a, --appName ", "Only for stateless mode: Name of the app") + .option("-p, --pass ", "Only for stateless mode: Password for Captain") + .option( + "-b, --branch ", + "Only for stateless mode: Branch name (default master)" + ) + .parse(process.argv) + +if (program.args.length) { + console.error(chalk.red("Unrecognized commands:")) + program.args.forEach(function(arg) { + console.log(chalk.red(arg)) + }) + console.error(chalk.red("Deploy does not require any options. ")) + process.exit(1) +} + +function getSuppliedTarFile() { + return program.tarFile +} + +if (!getSuppliedTarFile()) { + validateIsGitRepository() + + validateDefinitionFile() + + const contents = fs.readFileSync("./captain-definition", "utf8") + let contentsJson = null + + try { + contentsJson = JSON.parse(contents) + } catch (e) { + console.log(e) + console.log("") + printErrorAndExit( + "**** ERROR: captain-definition file is not a valid JSON! ****" + ) + } + + if (!contentsJson.schemaVersion) { + printErrorAndExit( + "**** ERROR: captain-definition needs schemaVersion. Please see docs! ****" + ) + } + + if (!contentsJson.templateId && !contentsJson.dockerfileLines) { + printErrorAndExit( + "**** ERROR: captain-definition needs templateId or dockerfileLines. Please see docs! ****" + ) + } + + if (contentsJson.templateId && contentsJson.dockerfileLines) { + printErrorAndExit( + "**** ERROR: captain-definition needs templateId or dockerfileLines, NOT BOTH! Please see docs! ****" + ) + } +} + +let listOfMachines = [ + { + name: "-- CANCEL --", + value: EMPTY_STRING, + short: EMPTY_STRING + } +] + +let machines = configs.get("captainMachines") +for (let i = 0; i < machines.length; i++) { + let m = machines[i] + listOfMachines.push({ + name: m.name + " at " + m.baseUrl, + value: m.name, + short: m.name + " at " + m.baseUrl + }) +} + +// Gets default value for propType that is stored in a directory. +// Replaces getAppForDirectory +function getPropForDirectory(propType) { + let apps = configs.get("apps") + for (let i = 0; i < apps.length; i++) { + let app = apps[i] + if (app.cwd === process.cwd()) { + return app[propType] + } + } + return undefined +} + +function getDefaultMachine() { + let machine = getPropForDirectory(MACHINE_TO_DEPLOY) + if (machine) { + return machine.name + } + if (listOfMachines.length == 2) { + return 1 + } + return EMPTY_STRING +} + +console.log("Preparing deployment to Captain...\n") + +const questions = [ + { + type: "list", + name: "captainNameToDeploy", + default: getDefaultMachine(), + message: "Select the Captain Machine you want to deploy to:", + choices: listOfMachines + }, + { + type: "input", + default: getPropForDirectory(BRANCH_TO_PUSH) || "master", + name: BRANCH_TO_PUSH, + message: "Enter the 'git' branch you would like to deploy:", + when: function(answers) { + return !!answers.captainNameToDeploy + } + }, + { + type: "input", + default: getPropForDirectory(APP_NAME), + name: APP_NAME, + message: "Enter the Captain app name this directory will be deployed to:", + when: function(answers) { + return !!answers.captainNameToDeploy + } + }, + { + type: "confirm", + name: "confirmedToDeploy", + message: + "Note that uncommitted files and files in gitignore (if any) will not be pushed to server. Please confirm so that deployment process can start.", + default: true, + when: function(answers) { + return !!answers.captainNameToDeploy + } + } +] + +let defaultInvalid = false + +if (program.default) { + if ( + !getDefaultMachine() || + !getPropForDirectory(BRANCH_TO_PUSH) || + !getPropForDirectory(APP_NAME) + ) { + console.log("Default deploy failed. Please select deploy options.") + defaultInvalid = true + } else { + console.log("Deploying to " + getPropForDirectory(MACHINE_TO_DEPLOY).name) + deployTo( + getPropForDirectory(MACHINE_TO_DEPLOY), + getPropForDirectory(BRANCH_TO_PUSH), + getPropForDirectory(APP_NAME) + ) + } +} + +const isStateless = + program.stateless && program.host && program.appName && program.pass + +if (isStateless) { + // login first + console.log("Trying to login to", program.host) + requestLoginAuth(program.host, program.pass, function(authToken) { + // deploy + console.log( + "Starting stateless deploy to", + program.host, + program.branch, + program.appName + ) + deployTo( + { + baseUrl: program.host, + authToken + }, + program.branch || "master", + program.appName + ) + }) +} else if (!program.default || defaultInvalid) { + inquirer.prompt(questions).then(function(answers) { + console.log(" ") + console.log(" ") + + if (!answers.confirmedToDeploy) { + console.log("Operation cancelled by the user...") + console.log(" ") + } else { + let machines = configs.get("captainMachines") + let machineToDeploy = null + for (let i = 0; i < machines.length; i++) { + if (machines[i].name === answers.captainNameToDeploy) { + console.log("Deploying to " + answers.captainNameToDeploy) + machineToDeploy = machines[i] + break + } + } + + console.log(" ") + deployTo(machineToDeploy, answers.branchToPush, answers.appName) + } + }) +} + +function deployTo(machineToDeploy, branchToPush, appName) { + function checkAuthAndSendFile(zipFileFullPath, gitHash) { + function isAuthTokenValidCallback(isValid) { + if (isValid) { + sendFileToCaptain( + machineToDeploy, + zipFileFullPath, + appName, + gitHash, + branchToPush + ) + } else { + requestLogin( + machineToDeploy.name, + machineToDeploy.baseUrl, + function callback(machineToDeployNew) { + deployTo(machineToDeployNew, branchToPush, appName) + } + ) + } + } + + isAuthTokenValid(machineToDeploy, appName, isAuthTokenValidCallback) + } + + if (getSuppliedTarFile()) { + checkAuthAndSendFile( + path.join(process.cwd(), getSuppliedTarFile()), + "sendviatarfile" + ) + return + } + + if (!commandExistsSync("git")) { + console.log(chalk.red('"git" command not found...')) + console.log( + chalk.red( + 'Captain needs "git" to create tar file of your source files...' + ) + ) + console.log(" ") + process.exit(1) + } + + let zipFileNameToDeploy = "temporary-captain-to-deploy.tar" + let zipFileFullPath = path.join(process.cwd(), zipFileNameToDeploy) + + console.log("Saving tar file to:") + console.log(zipFileFullPath) + console.log(" ") + + try { + fs.removeSync(zipFileFullPath) + } catch (ignoreError) {} + + exec( + 'git archive --format tar --output "' + + zipFileFullPath + + '" ' + + branchToPush, + function(err, stdout, stderr) { + if (err) { + console.log(chalk.red("TAR file failed")) + console.log(chalk.red(err + " ")) + console.log(" ") + fs.removeSync(zipFileFullPath) + return + } + + exec("git rev-parse " + branchToPush, function(err, stdout, stderr) { + const gitHash = (stdout || "").trim() + + if (err || !/^[a-f0-9]{40}$/.test(gitHash)) { + console.log( + chalk.red( + "Cannot find hash of last commit on this branch: " + branchToPush + ) + ) + console.log(chalk.red(gitHash + " ")) + console.log(chalk.red(err + " ")) + console.log(" ") + return + } + + console.log("Pushing last commit on " + branchToPush + ": " + gitHash) + + checkAuthAndSendFile(zipFileFullPath, gitHash) + }) + } + ) +} + +var lastLineNumberPrinted = -10000 // we want to show all lines to begin with! + +function startFetchingBuildLogs(machineToDeploy, appName) { + let options = { + url: machineToDeploy.baseUrl + "/api/v1/user/appData/" + appName, + headers: { + "x-namespace": "captain", + "x-captain-auth": machineToDeploy.authToken + }, + method: "GET" + } + + function onLogRetrieved(data) { + if (data) { + var lines = data.logs.lines + var firstLineNumberOfLogs = data.logs.firstLineNumber + var firstLinesToPrint = 0 + if (firstLineNumberOfLogs > lastLineNumberPrinted) { + if (firstLineNumberOfLogs < 0) { + // This is the very first fetch, probably firstLineNumberOfLogs is around -50 + firstLinesToPrint = -firstLineNumberOfLogs + } else { + console.log("[[ TRUNCATED ]]") + } + } else { + firstLinesToPrint = lastLineNumberPrinted - firstLineNumberOfLogs + } + + lastLineNumberPrinted = firstLineNumberOfLogs + lines.length + + for (var i = firstLinesToPrint; i < lines.length; i++) { + console.log((lines[i] || "").trim()) + } + } + + if (data && !data.isAppBuilding) { + console.log(" ") + if (!data.isBuildFailed) { + console.log(chalk.green("Deployed successfully: ") + appName) + console.log( + chalk.magenta("App is available at ") + + machineToDeploy.baseUrl + .replace("//captain.", "//" + appName + ".") + .replace("https://", "http://") + ) + } else { + console.error( + chalk.red( + '\nSomething bad happened. Cannot deploy "' + appName + '"\n' + ) + ) + } + console.log(" ") + return + } + + setTimeout(function() { + startFetchingBuildLogs(machineToDeploy, appName) + }, 2000) + } + + function callback(error, response, body) { + try { + if (!error && response.statusCode === 200) { + let data = JSON.parse(body) + + if (data.status !== 100) { + throw new Error(JSON.stringify(data, null, 2)) + } + + onLogRetrieved(data.data) + + return + } + + if (error) { + throw new Error(error) + } + + throw new Error( + response ? JSON.stringify(response, null, 2) : "Response NULL" + ) + } catch (error) { + console.error( + chalk.red( + '\nSomething while retrieving app build logs.. "' + error + '"\n' + ) + ) + + onLogRetrieved(null) + } + } + + request(options, callback) +} diff --git a/app-cli/lib/list.js b/app-cli/lib/list.js new file mode 100644 index 0000000..0418def --- /dev/null +++ b/app-cli/lib/list.js @@ -0,0 +1,29 @@ +const chalk = require("chalk") +const configstore = require("configstore") +const packagejson = require("../package.json") +const configs = new configstore(packagejson.name, { + captainMachines: [] +}) + +function _displayMachine(machine) { + console.log( + ">> " + + chalk.greenBright(machine.name) + + " at " + + chalk.cyan(machine.baseUrl) + ) +} + +function list() { + console.log("\nLogged in Captain Machines:\n") + + const machines = configs.get("captainMachines") + + machines.map(machine => { + _displayMachine(machine) + }) + + console.log("") +} + +module.exports = list diff --git a/app-cli/lib/login.js b/app-cli/lib/login.js new file mode 100644 index 0000000..16fba02 --- /dev/null +++ b/app-cli/lib/login.js @@ -0,0 +1,239 @@ +const program = require("commander") +const fs = require("fs") +const path = require("path") +const chalk = require("chalk") +const inquirer = require("inquirer") +const configstore = require("configstore") +const request = require("request") +const packagejson = require("./package.json") +const configs = new configstore(packagejson.name, { + captainMachines: [] +}) + +program + .description( + "Login to a CaptainDuckDuck machine. You can be logged in to multiple machines simultaneously." + ) + .parse(process.argv) + +function cleanUpUrl(url) { + if (!url) { + return url + } + + url = url.trim() + + url = url.replace("http://", "").replace("https://", "") + + if (!url || !url.length) { + return url + } + + if (url.substr(url.length - 1, 1) === "/") { + url = url.substr(0, url.length - 1) + } + + return url +} + +if (program.args.length) { + console.error(chalk.red("Unrecognized commands:")) + + program.args.forEach(function(arg) { + console.log(chalk.red(arg)) + }) + + console.error(chalk.red("Login does not require any options. ")) + + process.exit(1) +} + +function findDefaultCaptainName() { + const machines = configs.get("captainMachines") + let currentSuffix = machines.length + 1 + + function getCaptainFullName(suffix) { + if (suffix < 10) { + suffix = "0" + suffix + } + + return "captain-" + suffix + } + + function isSuffixValid(suffixNumber) { + for (let i = 0; i < machines.length; i++) { + const m = machines[i] + + if (m.name === getCaptainFullName(suffixNumber)) { + return false + } + } + + return true + } + + while (!isSuffixValid(currentSuffix)) { + currentSuffix++ + } + + return getCaptainFullName(currentSuffix) +} + +console.log("Login to a Captain Machine") + +const SAMPLE_DOMAIN = "captain.captainroot.yourdomain.com" +const questions = [ + { + type: "input", + default: SAMPLE_DOMAIN, + name: "captainAddress", + message: + "Enter address of the Captain machine. \nIt is captain.[your-captain-root-domain] :", + validate: function(value) { + if (value === SAMPLE_DOMAIN) { + return "Enter a valid URL" + } + + if (!cleanUpUrl(value)) { + return "This is an invalid URL: " + value + } + + const machines = configs.get("captainMachines") + + for (let i = 0; i < machines.length; i++) { + if (cleanUpUrl(machines[i].baseUrl) === cleanUpUrl(value)) { + return ( + value + + " already exist as " + + machines[i].name + + ". If you want to replace the existing entry, you have to first use command, and then re-login." + ) + } + } + + if (value && value.trim()) { + return true + } + + return "Please enter a valid address." + } + }, + { + type: "confirm", + name: "captainHasRootSsl", + message: "Is HTTPS activated for this Captain machine?", + default: true + }, + { + type: "password", + name: "captainPassword", + message: "Enter your password:", + validate: function(value) { + if (value && value.trim()) { + return true + } + + return "Please enter your password." + } + }, + { + type: "input", + name: "captainName", + message: "Enter a name for this Captain machine:", + default: findDefaultCaptainName(), + validate: function(value) { + const machines = configs.get("captainMachines") + + for (let i = 0; i < machines.length; i++) { + if (machines[i].name === value) { + return ( + value + + " already exist. If you want to replace the existing entry, you have to first use command, and then re-login." + ) + } + } + + if (value.match(/^[-\d\w]+$/i)) { + return true + } + + return "Please enter a Captain Name." + } + } +] + +function setCaptainMachine(data) { + const machines = configs.get("captainMachines") + + machines.push(data) + + configs.set("captainMachines", machines) +} + +inquirer.prompt(questions).then(function(answers) { + console.log("\n") + + const baseUrl = + (answers.captainHasRootSsl ? "https://" : "http://") + + cleanUpUrl(answers.captainAddress) + const options = { + url: baseUrl + "/api/v1/login", + headers: { + "x-namespace": "captain" + }, + method: "POST", + form: { + password: answers.captainPassword + } + } + + function callback(error, response, body) { + const captainNameEnterByUser = answers.captainName + + try { + if (!error && response.statusCode === 200) { + const data = JSON.parse(body) + + if (data.status !== 100) { + throw new Error(JSON.stringify(data, null, 2)) + } + + console.log(chalk.green("Logged in successfully to ") + baseUrl) + + console.log( + chalk.green( + `Authorization token is now saved as ${captainNameEnterByUser} \n` + ) + ) + + setCaptainMachine({ + authToken: data.token, + baseUrl: baseUrl, + name: captainNameEnterByUser + }) + + return + } + + if (error) { + throw new Error(error) + } + + throw new Error( + response ? JSON.stringify(response, null, 2) : "Response NULL" + ) + } catch (error) { + console.error( + chalk.red( + `Something bad happened. Cannot save "${captainNameEnterByUser}"` + ) + ) + + const errorMessage = error.message ? error.message : error + + console.error(`${chalk.red(errorMessage)} \n`) + } + } + + request(options, callback) +}) diff --git a/app-cli/lib/logout.js b/app-cli/lib/logout.js new file mode 100644 index 0000000..e102f46 --- /dev/null +++ b/app-cli/lib/logout.js @@ -0,0 +1,79 @@ +const inquirer = require("inquirer") +const configstore = require("configstore") +const packagejson = require("../package.json") +const configs = new configstore(packagejson.name, { + captainMachines: [] +}) +const machines = configs.get("captainMachines") + +function getMachineList() { + const firstItemInOption = [ + { + name: "-- CANCEL --", + value: "", + short: "" + } + ] + const listOfMachines = machines.map(machine => { + return { + name: `${machine.name} at ${machine.baseUrl}`, + value: `${machine.name}`, + short: `${machine.name} at ${machine.baseUrl}` + } + }) + + return [...firstItemInOption, ...listOfMachines] +} + +function generateQuestions() { + const listOfMachines = getMachineList() + + return [ + { + type: "list", + name: "captainNameToLogout", + message: "Select the Captain Machine you want to logout from:", + choices: listOfMachines + }, + { + type: "confirm", + name: "confirmedToLogout", + message: "Are you sure you want to logout from this Captain machine?", + default: false, + when: answers => !!answers.captainNameToLogout + } + ] +} + +function removeMachineFromLocalStorage(machineName) { + const removedMachine = machines.filter( + machine => machine.name === machineName + ) + const newMachines = machines.filter(machine => machine !== machineName) + + configs.set("captainMachines", newMachines) + + console.log( + `You are now logged out from ${removedMachine.name} at ${ + removedMachine.baseUrl + }...\n` + ) +} + +function logout() { + const questions = generateQuestions() + + console.log("Logout from a Captain Machine and clear auth info") + + inquirer.prompt(questions).then(answers => { + if (!answers.captainNameToLogout) { + console.log("\nOperation cancelled by the user...\n") + + return + } + + removeMachineFromLocalStorage(answers.captainNameToLogout) + }) +} + +module.exports = logout diff --git a/app-cli/lib/serversetup.js b/app-cli/lib/serversetup.js new file mode 100644 index 0000000..5b01350 --- /dev/null +++ b/app-cli/lib/serversetup.js @@ -0,0 +1,514 @@ +const program = require("commander") +const chalk = require("chalk") +const inquirer = require("inquirer") +const configstore = require("configstore") +const request = require("request") +const spinnerUtil = require("./utils/spinner") +const packagejson = require("./package.json") +const configs = new configstore(packagejson.name, { + captainMachines: [] +}) + +program.description("Easy setup for your Captain server.").parse(process.argv) + +if (program.args.length) { + console.error(chalk.red("Unrecognized commands:")) + + program.args.forEach(function(arg) { + console.log(chalk.red(arg)) + }) + + console.error(chalk.red("This command does not require any options. ")) + + process.exit(1) +} + +function findDefaultCaptainName() { + const machines = configs.get("captainMachines") + let currentSuffix = machines.length + 1 + + function getCaptainFullName(suffix) { + if (suffix < 10) { + suffix = "0" + suffix + } + + return "captain-" + suffix + } + + function isSuffixValid(suffixNumber) { + for (let i = 0; i < machines.length; i++) { + const m = machines[i] + + if (m.name === getCaptainFullName(suffixNumber)) { + return false + } + } + + return true + } + + while (!isSuffixValid(currentSuffix)) { + currentSuffix++ + } + + return getCaptainFullName(currentSuffix) +} + +function isIpAddress(ipaddress) { + if ( + /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test( + ipaddress + ) + ) { + return true + } + + return false +} + +console.log("\nSetup your Captain server\n") + +const SAMPLE_IP = "123.123.123.123" +let authTokenFromLogin = null +let ipAddressOfServer = null +let customDomainFromUser = null +let newPasswordFirstTry = null +let oldPassword = "captain42" + +function setCustomDomain(baseApiUrl, customDomain) { + return apiEndpointWithLoading("Changing Domain...")( + "POST", + baseApiUrl, + "/api/v1/user/system/changerootdomain/", + { + rootDomain: customDomain + } + ) +} + +function enableHttps(baseApiUrl, emailAddress) { + return apiEndpointWithLoading("Enabling SSL...")( + "POST", + baseApiUrl, + "/api/v1/user/system/enablessl/", + { + emailAddress: emailAddress + } + ) +} + +function changePass(baseApiUrl, newPass) { + return apiEndpointWithLoading("Changing Password...")( + "POST", + baseApiUrl, + "/api/v1/user/changepassword/", + { + oldPassword: oldPassword, + newPassword: newPass + } + ) +} + +function forceHttps(baseApiUrl) { + return apiEndpointWithLoading("Forcing SSL...")( + "POST", + baseApiUrl, + "/api/v1/user/system/forcessl/", + { + isEnabled: true + } + ) +} + +// returns promise that resolves to auth token +// rejects with ErrorCode or null +function login(baseApiUrl, password) { + return apiEndpointWithLoading("Login...")( + "POST", + baseApiUrl, + "/api/v1/login", + { + password: password + } + ).then(function(data) { + return data.token + }) +} + +function apiEndpointWithLoading(message) { + return (method, baseApiUrl, endpoint, dataToSend) => { + return apiEndpoint(method, baseApiUrl, endpoint, dataToSend, message) + } +} + +function apiEndpoint(method, baseApiUrl, endpoint, dataToSend, message) { + const options = { + url: baseApiUrl + endpoint, + headers: { + "x-namespace": "captain", + "x-captain-auth": authTokenFromLogin + }, + method: method, + form: dataToSend + } + + return new Promise(function(res, rej) { + let spinner + + if (message) { + spinner = spinnerUtil.start(message) + } + + var callback = function(error, response, body) { + try { + if (!error && response.statusCode === 200) { + const data = JSON.parse(body) + + if (data.status !== 100) { + if (spinner) { + spinnerUtil.fail(spinner) + } + + rej(data) + + return + } + + if (spinner) { + spinnerUtil.succeed(spinner) + } + + res(data) + + return + } + + if (error) { + throw new Error(error) + } + + throw new Error( + response ? JSON.stringify(response, null, 2) : "Response NULL" + ) + } catch (error) { + if (spinner) { + spinnerUtil.fail(spinner) + } + + console.error( + chalk.red( + `Something bad happened. Cannot connect to "${baseApiUrl} ${endpoint}"` + ) + ) + + const errorMessage = error.message ? error.message : error + + console.error(`${chalk.red(errorMessage)}\n`) + + process.exit(0) + } + } + + request(options, callback) + }) +} + +const questions = [ + { + type: "list", + name: "hasInstalledCaptain", + message: + "Have you already installed Captain on your server by running the following line:" + + "\nmkdir /captain && docker run -v /var/run/docker.sock:/var/run/docker.sock dockersaturn/captainduckduck ?", + default: "Yes", + choices: ["Yes", "No"], + filter: function(value) { + return new Promise(function(res, rej) { + if (value === "Yes") { + res(true) + + return + } + + console.log( + "\n\nCannot start the setup process if Captain is not installed." + ) + + console.log( + "Please read tutorial on CaptainDuckDuck.com\n to learn how to install CaptainDuckDuck on a server.\n" + ) + + process.exit(0) + }) + } + }, + { + type: "input", + default: SAMPLE_IP, + name: "captainAddress", + message: "Enter IP address of your captain server:", + filter: function(value) { + return new Promise(function(res, rej) { + if (value === SAMPLE_IP) { + rej("Enter a valid IP Address") + + return + } + + if (!isIpAddress(value.trim())) { + rej("This is an invalid IP Address: " + value) + + return + } + + ipAddressOfServer = value.trim() + + //login using captain42. + + return login("http://" + ipAddressOfServer + ":3000", oldPassword) + .then(function(authTokenFetched) { + authTokenFromLogin = authTokenFetched + + res(ipAddressOfServer) + }) + .catch(function(error) { + // if error is anything but password wrong, exit here... + if (error.status == 1105) { + authTokenFromLogin = null + + res(ipAddressOfServer) + + return + } + + console.log("") + + if (error.status) { + console.log(chalk.red(`Error: ${error.status}`)) + + console.log(chalk.red(`Error: ${error.description}`)) + } else { + console.log(chalk.red(`Error: ${error}`)) + } + + process.exit(0) + }) + }) + } + }, + { + type: "password", + name: "captainOriginalPassword", + message: "Enter your current password:", + when: function() { + return !authTokenFromLogin + }, + filter: function(value) { + return new Promise(function(res, rej) { + console.log("") + + return login("http://" + ipAddressOfServer + ":3000", value) + .then(function(authTokenFetched) { + authTokenFromLogin = authTokenFetched + + oldPassword = value + + res(value) + }) + .catch(function(error) { + console.log("") + + if (error.status) { + console.log(chalk.red("Error: " + error.status)) + + console.log(chalk.red("Error: " + error.description)) + } else { + console.log(chalk.red("Error: " + error)) + } + + process.exit(0) + }) + }) + } + }, + { + type: "input", + name: "captainRootDomain", + message: + "Enter a root domain for this Captain server. For example, enter test.yourdomain.com if you" + + " setup your DNS to point *.test.yourdomain.com to ip address of your server" + + ": ", + filter: function(value) { + return new Promise(function(res, rej) { + value = value.trim() + + customDomainFromUser = "captain." + value + + return setCustomDomain("http://" + ipAddressOfServer + ":3000", value) + .then(function() { + res(customDomainFromUser) + }) + .catch(function(error) { + if (error.status) { + console.log(chalk.red(`Error: ${error.status}`)) + + console.log(chalk.red(`Error: ${error.description}`)) + } else { + console.log(chalk.red(`Error: ${error}`)) + } + + process.exit(0) + }) + }) + } + }, + { + type: "input", + name: "emailAddress", + message: "Enter your 'valid' email address to enable HTTPS: ", + filter: function(value) { + return new Promise(function(res, rej) { + console.log("") + + value = value.trim() + + return enableHttps("http://" + customDomainFromUser, value) + .then(function() { + return forceHttps("https://" + customDomainFromUser) + }) + .then(function() { + res(value) + }) + .catch(function(error) { + console.log("") + + if (error.status) { + console.log(chalk.red(`Error: ${error.status}`)) + + console.log(chalk.red(`Error: ${error.description}`)) + } else { + console.log(chalk.red(`Error: ${error}`)) + } + + process.exit(0) + }) + }) + } + }, + { + type: "password", + name: "newPasswordFirstTry", + message: "Enter a new password:", + filter: function(value) { + return new Promise(function(res, rej) { + newPasswordFirstTry = value + + res(value) + }) + } + }, + { + type: "password", + name: "newPassword", + message: "Enter a new password:", + filter: function(value) { + return new Promise(function(res, rej) { + if (newPasswordFirstTry !== value) { + rej("Passwords do not match") + //process.exit(0); + + return + } + + return changePass("https://" + customDomainFromUser, value) + .then(function() { + return login("https://" + customDomainFromUser, value) + }) + .then(function(token) { + authTokenFromLogin = token + + res(value) + }) + .catch(function(error) { + console.log("") + + if (error.status) { + console.log(chalk.red(`Error: ${error.status}`)) + + console.log(chalk.red(`Error: ${error.description}`)) + } else { + console.log(chalk.red(`Error: ${error}`)) + } + + console.log( + chalk.red( + "\nIMPORTANT!! Server setup is completed by password is not changed." + ) + ) + + console.log( + chalk.red("You CANNOT use serversetup anymore. To continue: ") + ) + + console.log( + chalk.red( + "- Go to https://" + + customDomainFromUser + + " login with default password and change the password in settings." + ) + ) + + console.log( + chalk.red( + "- In terminal (here), type captainduckduck login and enter this as your root domain: " + + customDomainFromUser + ) + ) + + process.exit(0) + }) + }) + } + }, + { + type: "input", + name: "captainName", + message: "Enter a name for this Captain machine:", + default: findDefaultCaptainName(), + validate: function(value) { + const machines = configs.get("captainMachines") + + for (let i = 0; i < machines.length; i++) { + if (machines[i].name === value) { + return `${value} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.` + } + } + + if (value.match(/^[-\d\w]+$/i)) { + return true + } + + return "Please enter a Captain Name." + } + } +] + +inquirer.prompt(questions).then(function(answers) { + var captainAddress = "https://" + customDomainFromUser + + const machines = configs.get("captainMachines") + + machines.push({ + authToken: authTokenFromLogin, + baseUrl: captainAddress, + name: answers.captainName + }) + + configs.set("captainMachines", machines) + + console.log(`\n\nCaptain is available at ${captainAddress}`) + + console.log( + "\nFor more details and docs see http://www.captainduckduck.com\n\n" + ) +}) diff --git a/app-cli/utils/errorHandler.js b/app-cli/utils/errorHandler.js new file mode 100644 index 0000000..34a2ddf --- /dev/null +++ b/app-cli/utils/errorHandler.js @@ -0,0 +1,9 @@ +const chalk = require("chalk") + +function printErrorAndExit(error) { + console.log(`${chalk.bold.red(error)}\n\n`) + + process.exit(0) +} + +module.exports = printErrorAndExit diff --git a/app-cli/utils/fileHandler.js b/app-cli/utils/fileHandler.js new file mode 100644 index 0000000..1358c6a --- /dev/null +++ b/app-cli/utils/fileHandler.js @@ -0,0 +1,178 @@ +const fs = require("fs-extra") +const chalk = require("chalk") +const request = require("request") +const ProgressBar = require("progress") +const ora = require("ora") +const configstore = require("configstore") +const packagejson = require("./package.json") +const { requestLogin } = require("./utils/loginHandler") +const configs = new configstore(packagejson.name, { + captainMachines: [], + apps: [] +}) + +function sendFileToCaptain( + machineToDeploy, + zipFileFullPath, + appName, + gitHash, + branchToPush +) { + console.log("Uploading file to " + machineToDeploy.baseUrl) + + const fileSize = fs.statSync(zipFileFullPath).size + const fileStream = fs.createReadStream(zipFileFullPath) + const barOpts = { + width: 20, + total: fileSize, + clear: true + } + const bar = new ProgressBar( + " uploading [:bar] :percent (ETA :etas)", + barOpts + ) + + fileStream.on("data", function(chunk) { + bar.tick(chunk.length) + }) + + let spinner + + fileStream.on("end", function() { + console.log(" ") + + console.log("This might take several minutes. PLEASE BE PATIENT...") + + spinner = ora("Building your source code...").start() + + spinner.color = "yellow" + }) + + const options = { + url: + machineToDeploy.baseUrl + + "/api/v1/user/appData/" + + appName + + "/?detached=1", + headers: { + "x-namespace": "captain", + "x-captain-auth": machineToDeploy.authToken + }, + method: "POST", + formData: { + sourceFile: fileStream, + gitHash: gitHash + } + } + + function callback(error, response, body) { + if (spinner) { + spinner.stop() + } + + if (fs.pathExistsSync(zipFileFullPath) && !getSuppliedTarFile()) { + fs.removeSync(zipFileFullPath) + } + + try { + if (!error && response.statusCode === 200) { + const data = JSON.parse(body) + + if (data.status === 1106) { + // expired token + requestLogin( + machineToDeploy.name, + machineToDeploy.baseUrl, + function callback(machineToDeployNew) { + deployTo(machineToDeployNew, branchToPush, appName) + } + ) + + return + } + + if (data.status !== 100 && data.status !== 101) { + throw new Error(JSON.stringify(data, null, 2)) + } + + savePropForDirectory(APP_NAME, appName) + + savePropForDirectory(BRANCH_TO_PUSH, branchToPush) + + savePropForDirectory(MACHINE_TO_DEPLOY, machineToDeploy) + + if (data.status === 100) { + console.log(chalk.green("Deployed successfully: ") + appName) + console.log(" ") + } else if (data.status === 101) { + console.log(chalk.green("Building started: ") + appName) + console.log(" ") + + startFetchingBuildLogs(machineToDeploy, appName) + } + + return + } + + if (error) { + throw new Error(error) + } + + throw new Error( + response ? JSON.stringify(response, null, 2) : "Response NULL" + ) + } catch (error) { + console.error( + chalk.red('\nSomething bad happened. Cannot deploy "' + appName + '"\n') + ) + + if (error.message) { + try { + var errorObj = JSON.parse(error.message) + if (errorObj.status) { + console.error(chalk.red("\nError code: " + errorObj.status)) + console.error( + chalk.red("\nError message:\n\n " + errorObj.description) + ) + } else { + throw new Error("NOT API ERROR") + } + } catch (ignoreError) { + console.error(chalk.red(error.message)) + } + } else { + console.error(chalk.red(error)) + } + console.log(" ") + } + } + + request(options, callback) +} + +// Sets default value for propType that is stored in a directory to propValue. +// Replaces saveAppForDirectory +function savePropForDirectory(propType, propValue) { + const apps = configs.get("apps") + + for (let i = 0; i < apps.length; i++) { + const app = apps[i] + + if (app.cwd === process.cwd()) { + app[propType] = propValue + + configs.set("apps", apps) + + return + } + } + + apps.push({ + cwd: process.cwd(), + [propType]: propValue + }) + + configs.set("apps", apps) +} + +module.exports = sendFileToCaptain diff --git a/app-cli/utils/loginHandler.js b/app-cli/utils/loginHandler.js new file mode 100644 index 0000000..2a82ca1 --- /dev/null +++ b/app-cli/utils/loginHandler.js @@ -0,0 +1,194 @@ +const inquirer = require("inquirer") + +function requestLogin(serverName, serverAddress, loginCallback) { + console.log("Your auth token is not valid anymore. Try to login again.") + + const questions = [ + { + type: "password", + name: "captainPassword", + message: "Please enter your password for " + serverAddress, + validate: function(value) { + if (value && value.trim()) { + return true + } + + return "Please enter your password for " + serverAddress + } + } + ] + + inquirer.prompt(questions).then(function(passwordAnswers) { + var password = passwordAnswers.captainPassword + + let options = { + url: serverAddress + "/api/v1/login", + headers: { + "x-namespace": "captain" + }, + method: "POST", + form: { + password: password + } + } + + function callback(error, response, body) { + try { + if (!error && response.statusCode === 200) { + let data = JSON.parse(body) + + if (data.status !== 100) { + throw new Error(JSON.stringify(data, null, 2)) + } + + var newMachineToDeploy = updateAuthTokenInConfigStoreAndReturn( + data.token + ) + + loginCallback(newMachineToDeploy) + + return + } + + if (error) { + throw new Error(error) + } + + throw new Error( + response ? JSON.stringify(response, null, 2) : "Response NULL" + ) + } catch (error) { + if (error.message) { + try { + var errorObj = JSON.parse(error.message) + if (errorObj.status) { + console.error(chalk.red("\nError code: " + errorObj.status)) + console.error( + chalk.red("\nError message:\n\n " + errorObj.description) + ) + } else { + throw new Error("NOT API ERROR") + } + } catch (ignoreError) { + console.error(chalk.red(error.message)) + } + } else { + console.error(chalk.red(error)) + } + console.log(" ") + } + + process.exit(0) + } + + request(options, callback) + }) +} + +function requestLoginAuth(serverAddress, password, authCallback) { + let options = { + url: serverAddress + "/api/v1/login", + headers: { + "x-namespace": "captain" + }, + method: "POST", + form: { + password: password + } + } + + function callback(error, response, body) { + try { + if (!error && response.statusCode === 200) { + let data = JSON.parse(body) + + if (data.status !== 100) { + throw new Error(JSON.stringify(data, null, 2)) + } + + authCallback(data.token) + + return + } + + if (error) { + throw new Error(error) + } + + throw new Error( + response ? JSON.stringify(response, null, 2) : "Response NULL" + ) + } catch (error) { + if (error.message) { + try { + var errorObj = JSON.parse(error.message) + if (errorObj.status) { + console.error(chalk.red("\nError code: " + errorObj.status)) + console.error( + chalk.red("\nError message:\n\n " + errorObj.description) + ) + } else { + throw new Error("NOT API ERROR") + } + } catch (ignoreError) { + console.error(chalk.red(error.message)) + } + } else { + console.error(chalk.red(error)) + } + console.log(" ") + } + + process.exit(0) + } + + request(options, callback) +} + +function isAuthTokenValid(machineToDeploy, appName, isAuthTokenValidCallback) { + let options = { + url: machineToDeploy.baseUrl + "/api/v1/user/appDefinitions/", + headers: { + "x-namespace": "captain", + "x-captain-auth": machineToDeploy.authToken + }, + method: "GET" + } + + function callback(error, response, body) { + try { + if (!error && response.statusCode === 200) { + let data = JSON.parse(body) + + if (data.status === 1106 || data.status === 1105) { + isAuthTokenValidCallback(false) + } else { + isAuthTokenValidCallback(true) + } + } + } catch (error) { + // This is just a sanity check. We only fire FALSE (i.e. expired) if we know it's expired or password is wrong + isAuthTokenValidCallback(true) + } + } + + request(options, callback) +} + +function updateAuthTokenInConfigStoreAndReturn(authToken) { + let machines = configs.get("captainMachines") + for (let i = 0; i < machines.length; i++) { + if (machines[i].name === serverName) { + var baseUrl = (machines[i].authToken = authToken) + configs.set("captainMachines", machines) + console.log("You are now logged back in to " + serverAddress) + return machines[i] + } + } +} + +module.exports = { + requestLogin, + requestLoginAuth, + isAuthTokenValid +} diff --git a/app-cli/utils/spinner.js b/app-cli/utils/spinner.js index 3c031a4..1912ab0 100644 --- a/app-cli/utils/spinner.js +++ b/app-cli/utils/spinner.js @@ -1,24 +1,24 @@ -const ora = require('ora'); +const ora = require("ora") function start(message) { - return ora(message).start() + return ora(message).start() } function stop(spinner) { - spinner.stop(); + spinner.stop() } function succeed(spinner) { - spinner.succeed(); + spinner.succeed() } function fail(spinner) { - spinner.fail(); + spinner.fail() } module.exports = { - start: start, - stop: stop, - succeed: succeed, - fail: fail, -} \ No newline at end of file + start: start, + stop: stop, + succeed: succeed, + fail: fail +} diff --git a/app-cli/utils/validationsHandler.js b/app-cli/utils/validationsHandler.js new file mode 100644 index 0000000..ac6c12f --- /dev/null +++ b/app-cli/utils/validationsHandler.js @@ -0,0 +1,23 @@ +const fs = require("fs-extra") +const printErrorAndExit = require("./errorHandler") + +function validateIsGitRepository() { + if (!fs.pathExistsSync("./.git")) { + printErrorAndExit( + "**** ERROR: You are not in a git root directory. This command will only deploys the current directory ****" + ) + } +} + +function validateDefinitionFile() { + if (!fs.pathExistsSync("./captain-definition")) { + printErrorAndExit( + "**** ERROR: captain-definition file cannot be found. Please see docs! ****" + ) + } +} + +module.exports = { + validateIsGitRepository, + validateDefinitionFile +} From 8e2f2f53b839153a868e69e996a3e5a7a0c25ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Trevi=C3=B1o?= Date: Wed, 31 Oct 2018 12:21:14 +0100 Subject: [PATCH 03/44] Add Api files, fully working login, logout and list commands --- app-cli/api/LoginApi.js | 13 ++ app-cli/api/MainApi.js | 34 ++++ app-cli/captainduckduck.js | 21 ++- app-cli/lib/login.js | 316 ++++++++++++---------------------- app-cli/lib/logout.js | 10 +- app-cli/package-lock.json | 37 +++- app-cli/package.json | 1 + app-cli/utils/constants.js | 3 + app-cli/utils/loginHandler.js | 59 ++++--- app-cli/utils/loginHelpers.js | 49 ++++++ 10 files changed, 298 insertions(+), 245 deletions(-) create mode 100644 app-cli/api/LoginApi.js create mode 100644 app-cli/api/MainApi.js create mode 100644 app-cli/utils/constants.js create mode 100644 app-cli/utils/loginHelpers.js diff --git a/app-cli/api/LoginApi.js b/app-cli/api/LoginApi.js new file mode 100644 index 0000000..57d1cd8 --- /dev/null +++ b/app-cli/api/LoginApi.js @@ -0,0 +1,13 @@ +const MainApi = require("./MainApi") + +class LoginApi { + loginMachine(url, password) { + try { + return MainApi.post(url, { password }) + } catch (e) { + throw e + } + } +} + +module.exports = new LoginApi() diff --git a/app-cli/api/MainApi.js b/app-cli/api/MainApi.js new file mode 100644 index 0000000..630e179 --- /dev/null +++ b/app-cli/api/MainApi.js @@ -0,0 +1,34 @@ +const Request = require("request-promise") + +class MainApi { + get(url, config) { + return Request.get(url) + } + + post(url, form, config) { + const options = { + url, + headers: { + "x-namespace": "captain" + }, + method: "POST", + form + } + + return Request(options) + } + + put(url, data, config) { + return Request.put(url, data) + } + + patch(url, data, config) { + return Request.patch(url, data) + } + + delete(url, data, config) { + return Request.delete(url) + } +} + +module.exports = new MainApi() diff --git a/app-cli/captainduckduck.js b/app-cli/captainduckduck.js index 3a3b075..abc1897 100755 --- a/app-cli/captainduckduck.js +++ b/app-cli/captainduckduck.js @@ -2,35 +2,38 @@ const packagejson = require("./package.json") const updateNotifier = require("update-notifier") +const program = require("commander") updateNotifier({ pkg: packagejson }).notify({ isGlobal: true }) -const program = require("commander") -const fs = require("fs") -const path = require("path") -const chalk = require("chalk") // Command actions const list = require("./lib/list") const logout = require("./lib/logout") +const login = require("./lib/login") // Setup -program.version(packagejson.version + "").description(packagejson.description) +program.version(packagejson.version).description(packagejson.description) program .command( "serversetup", "Performs necessary actions and prepares your Captain server." ) - .command( - "login", - "Login to a CaptainDuckDuck machine. You can be logged in to multiple machines simultaneously." - ) .command( "deploy", "Deploy your app (current directory) to a specific Captain machine. You'll be prompted to choose your Captain machine." ) // Commands +program + .command("login") + .description( + "Login to a CaptainDuckDuck machine. You can be logged in to multiple machines simultaneously." + ) + .action(() => { + login() + }) + program .command("logout") .description("Logout from a specific Captain machine.") diff --git a/app-cli/lib/login.js b/app-cli/lib/login.js index 16fba02..bb022aa 100644 --- a/app-cli/lib/login.js +++ b/app-cli/lib/login.js @@ -1,239 +1,141 @@ -const program = require("commander") -const fs = require("fs") -const path = require("path") const chalk = require("chalk") const inquirer = require("inquirer") const configstore = require("configstore") -const request = require("request") -const packagejson = require("./package.json") +const packagejson = require("../package.json") const configs = new configstore(packagejson.name, { captainMachines: [] }) +const machines = configs.get("captainMachines") +const { cleanUpUrl, findDefaultCaptainName } = require("../utils/loginHelpers") +const { SAMPLE_DOMAIN } = require("../utils/constants") +const LoginApi = require("../api/LoginApi") -program - .description( - "Login to a CaptainDuckDuck machine. You can be logged in to multiple machines simultaneously." - ) - .parse(process.argv) - -function cleanUpUrl(url) { - if (!url) { - return url - } - - url = url.trim() - - url = url.replace("http://", "").replace("https://", "") - - if (!url || !url.length) { - return url - } - - if (url.substr(url.length - 1, 1) === "/") { - url = url.substr(0, url.length - 1) - } - - return url -} - -if (program.args.length) { - console.error(chalk.red("Unrecognized commands:")) - - program.args.forEach(function(arg) { - console.log(chalk.red(arg)) - }) - - console.error(chalk.red("Login does not require any options. ")) - - process.exit(1) -} - -function findDefaultCaptainName() { - const machines = configs.get("captainMachines") - let currentSuffix = machines.length + 1 - - function getCaptainFullName(suffix) { - if (suffix < 10) { - suffix = "0" + suffix - } - - return "captain-" + suffix - } - - function isSuffixValid(suffixNumber) { - for (let i = 0; i < machines.length; i++) { - const m = machines[i] - - if (m.name === getCaptainFullName(suffixNumber)) { - return false - } - } - - return true - } - - while (!isSuffixValid(currentSuffix)) { - currentSuffix++ - } - - return getCaptainFullName(currentSuffix) -} - -console.log("Login to a Captain Machine") - -const SAMPLE_DOMAIN = "captain.captainroot.yourdomain.com" -const questions = [ - { - type: "input", - default: SAMPLE_DOMAIN, - name: "captainAddress", - message: - "Enter address of the Captain machine. \nIt is captain.[your-captain-root-domain] :", - validate: function(value) { - if (value === SAMPLE_DOMAIN) { - return "Enter a valid URL" - } - - if (!cleanUpUrl(value)) { - return "This is an invalid URL: " + value - } - - const machines = configs.get("captainMachines") - - for (let i = 0; i < machines.length; i++) { - if (cleanUpUrl(machines[i].baseUrl) === cleanUpUrl(value)) { - return ( - value + - " already exist as " + - machines[i].name + - ". If you want to replace the existing entry, you have to first use command, and then re-login." - ) - } - } - - if (value && value.trim()) { - return true - } - - return "Please enter a valid address." - } - }, - { - type: "confirm", - name: "captainHasRootSsl", - message: "Is HTTPS activated for this Captain machine?", - default: true - }, - { - type: "password", - name: "captainPassword", - message: "Enter your password:", - validate: function(value) { - if (value && value.trim()) { - return true - } - - return "Please enter your password." - } - }, - { - type: "input", - name: "captainName", - message: "Enter a name for this Captain machine:", - default: findDefaultCaptainName(), - validate: function(value) { - const machines = configs.get("captainMachines") - - for (let i = 0; i < machines.length; i++) { - if (machines[i].name === value) { - return ( - value + - " already exist. If you want to replace the existing entry, you have to first use command, and then re-login." - ) - } - } - - if (value.match(/^[-\d\w]+$/i)) { - return true - } - - return "Please enter a Captain Name." - } - } -] - -function setCaptainMachine(data) { +function setCaptainMachine(newMachine) { const machines = configs.get("captainMachines") - machines.push(data) + machines.push(newMachine) configs.set("captainMachines", machines) } -inquirer.prompt(questions).then(function(answers) { - console.log("\n") +function login() { + console.log("Login to a Captain Machine") - const baseUrl = - (answers.captainHasRootSsl ? "https://" : "http://") + - cleanUpUrl(answers.captainAddress) - const options = { - url: baseUrl + "/api/v1/login", - headers: { - "x-namespace": "captain" - }, - method: "POST", - form: { - password: answers.captainPassword - } - } - - function callback(error, response, body) { - const captainNameEnterByUser = answers.captainName - - try { - if (!error && response.statusCode === 200) { - const data = JSON.parse(body) - - if (data.status !== 100) { - throw new Error(JSON.stringify(data, null, 2)) + const questions = [ + { + type: "input", + default: SAMPLE_DOMAIN, + name: "captainAddress", + message: + "Enter address of the Captain machine. \nIt is captain.[your-captain-root-domain] :", + validate: value => { + if (value === SAMPLE_DOMAIN) { + return "Enter a valid URL" } - console.log(chalk.green("Logged in successfully to ") + baseUrl) + if (!cleanUpUrl(value)) return "This is an invalid URL: " + value - console.log( - chalk.green( - `Authorization token is now saved as ${captainNameEnterByUser} \n` - ) - ) - - setCaptainMachine({ - authToken: data.token, - baseUrl: baseUrl, - name: captainNameEnterByUser + machines.map(machine => { + if (cleanUpUrl(machine.baseUrl) === cleanUpUrl(value)) { + return `${value} already exist as ${ + machine.name + }. If you want to replace the existing entry, you have to first use command, and then re-login.` + } }) - return - } + if (value && value.trim()) { + return true + } - if (error) { - throw new Error(error) + return "Please enter a valid address." } + }, + { + type: "confirm", + name: "captainHasRootSsl", + message: "Is HTTPS activated for this Captain machine?", + default: true + }, + { + type: "password", + name: "captainPassword", + message: "Enter your password:", + validate: value => { + if (value && value.trim()) { + return true + } - throw new Error( - response ? JSON.stringify(response, null, 2) : "Response NULL" + return "Please enter your password." + } + }, + { + type: "input", + name: "captainName", + message: "Enter a name for this Captain machine:", + default: findDefaultCaptainName(), + validate: value => { + machines.map(machine => { + if (machine.name === value) { + return `${value} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.` + } + }) + + if (value.match(/^[-\d\w]+$/i)) { + return true + } + + return "Please enter a Captain Name." + } + } + ] + + inquirer.prompt(questions).then(async answers => { + console.log("\n") + + const { + captainHasRootSsl, + captainPassword, + captainAddress, + captainName + } = answers + const handleHttp = captainHasRootSsl ? "https://" : "http://" + const baseUrl = `${handleHttp}${cleanUpUrl(captainAddress)}` + + try { + const data = await LoginApi.loginMachine( + `${baseUrl}/api/v1/login`, + captainPassword ) + const response = JSON.parse(data) + + // TODO - This status should be 200 maybe? + if (response.status !== 100) { + throw new Error(JSON.stringify(response, null, 2)) + } + + console.log(`${chalk.green("Logged in successfully to ")}${baseUrl}`) + + console.log( + chalk.green(`Authorization token is now saved as ${captainName} \n`) + ) + + const newMachine = { + authToken: response.token, + baseUrl, + name: captainName + } + + setCaptainMachine(newMachine) } catch (error) { console.error( - chalk.red( - `Something bad happened. Cannot save "${captainNameEnterByUser}"` - ) + chalk.red(`Something bad happened. Cannot save "${captainName}"`) ) const errorMessage = error.message ? error.message : error console.error(`${chalk.red(errorMessage)} \n`) } - } + }) +} - request(options, callback) -}) +module.exports = login diff --git a/app-cli/lib/logout.js b/app-cli/lib/logout.js index e102f46..c096845 100644 --- a/app-cli/lib/logout.js +++ b/app-cli/lib/logout.js @@ -48,8 +48,8 @@ function generateQuestions() { function removeMachineFromLocalStorage(machineName) { const removedMachine = machines.filter( machine => machine.name === machineName - ) - const newMachines = machines.filter(machine => machine !== machineName) + )[0] + const newMachines = machines.filter(machine => machine.name !== machineName) configs.set("captainMachines", newMachines) @@ -66,13 +66,15 @@ function logout() { console.log("Logout from a Captain Machine and clear auth info") inquirer.prompt(questions).then(answers => { - if (!answers.captainNameToLogout) { + const { captainNameToLogout } = answers + + if (!captainNameToLogout) { console.log("\nOperation cancelled by the user...\n") return } - removeMachineFromLocalStorage(answers.captainNameToLogout) + removeMachineFromLocalStorage(captainNameToLogout) }) } diff --git a/app-cli/package-lock.json b/app-cli/package-lock.json index 4d5b2ba..dedc22c 100644 --- a/app-cli/package-lock.json +++ b/app-cli/package-lock.json @@ -143,6 +143,11 @@ "tweetnacl": "^0.14.3" } }, + "bluebird": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.2.tgz", + "integrity": "sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg==" + }, "boxen": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", @@ -720,12 +725,12 @@ "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" }, "form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", "requires": { "asynckit": "^0.4.0", - "combined-stream": "1.0.6", + "combined-stream": "^1.0.6", "mime-types": "^2.1.12" } }, @@ -1442,6 +1447,25 @@ "uuid": "^3.1.0" } }, + "request-promise": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/request-promise/-/request-promise-4.2.2.tgz", + "integrity": "sha1-0epG1lSm7k+O5qT+oQGMIpEZBLQ=", + "requires": { + "bluebird": "^3.5.0", + "request-promise-core": "1.1.1", + "stealthy-require": "^1.1.0", + "tough-cookie": ">=2.3.3" + } + }, + "request-promise-core": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", + "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", + "requires": { + "lodash": "^4.13.1" + } + }, "require-uncached": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", @@ -1577,6 +1601,11 @@ "tweetnacl": "~0.14.0" } }, + "stealthy-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", + "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=" + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", diff --git a/app-cli/package.json b/app-cli/package.json index 669bc7c..108796a 100644 --- a/app-cli/package.json +++ b/app-cli/package.json @@ -44,6 +44,7 @@ "ora": "^1.3.0", "progress": "^2.0.0", "request": "^2.83.0", + "request-promise": "^4.2.2", "update-notifier": "^2.3.0" }, "devDependencies": { diff --git a/app-cli/utils/constants.js b/app-cli/utils/constants.js new file mode 100644 index 0000000..0c5224c --- /dev/null +++ b/app-cli/utils/constants.js @@ -0,0 +1,3 @@ +const SAMPLE_DOMAIN = "captain.captainroot.yourdomain.com" + +module.exports = { SAMPLE_DOMAIN } diff --git a/app-cli/utils/loginHandler.js b/app-cli/utils/loginHandler.js index 2a82ca1..fa5c779 100644 --- a/app-cli/utils/loginHandler.js +++ b/app-cli/utils/loginHandler.js @@ -1,4 +1,11 @@ const inquirer = require("inquirer") +const chalk = require("chalk") +const request = require("request") +const configstore = require("configstore") +const packagejson = require("../package.json") +const configs = new configstore(packagejson.name, { + captainMachines: [] +}) function requestLogin(serverName, serverAddress, loginCallback) { console.log("Your auth token is not valid anymore. Try to login again.") @@ -18,24 +25,40 @@ function requestLogin(serverName, serverAddress, loginCallback) { } ] - inquirer.prompt(questions).then(function(passwordAnswers) { - var password = passwordAnswers.captainPassword + function updateAuthTokenInConfigStoreAndReturn(authToken) { + const machines = configs.get("captainMachines") - let options = { + for (let i = 0; i < machines.length; i++) { + if (machines[i].name === serverName) { + machines[i].authToken = authToken + + configs.set("captainMachines", machines) + + console.log("You are now logged back in to " + serverAddress) + + return machines[i] + } + } + } + + inquirer.prompt(questions).then(passwordAnswers => { + var { captainPassword } = passwordAnswers + + const options = { url: serverAddress + "/api/v1/login", headers: { "x-namespace": "captain" }, method: "POST", form: { - password: password + password: captainPassword } } function callback(error, response, body) { try { if (!error && response.statusCode === 200) { - let data = JSON.parse(body) + const data = JSON.parse(body) if (data.status !== 100) { throw new Error(JSON.stringify(data, null, 2)) @@ -61,8 +84,10 @@ function requestLogin(serverName, serverAddress, loginCallback) { if (error.message) { try { var errorObj = JSON.parse(error.message) + if (errorObj.status) { console.error(chalk.red("\nError code: " + errorObj.status)) + console.error( chalk.red("\nError message:\n\n " + errorObj.description) ) @@ -75,6 +100,7 @@ function requestLogin(serverName, serverAddress, loginCallback) { } else { console.error(chalk.red(error)) } + console.log(" ") } @@ -86,7 +112,7 @@ function requestLogin(serverName, serverAddress, loginCallback) { } function requestLoginAuth(serverAddress, password, authCallback) { - let options = { + const options = { url: serverAddress + "/api/v1/login", headers: { "x-namespace": "captain" @@ -100,7 +126,7 @@ function requestLoginAuth(serverAddress, password, authCallback) { function callback(error, response, body) { try { if (!error && response.statusCode === 200) { - let data = JSON.parse(body) + const data = JSON.parse(body) if (data.status !== 100) { throw new Error(JSON.stringify(data, null, 2)) @@ -122,8 +148,10 @@ function requestLoginAuth(serverAddress, password, authCallback) { if (error.message) { try { var errorObj = JSON.parse(error.message) + if (errorObj.status) { console.error(chalk.red("\nError code: " + errorObj.status)) + console.error( chalk.red("\nError message:\n\n " + errorObj.description) ) @@ -136,6 +164,7 @@ function requestLoginAuth(serverAddress, password, authCallback) { } else { console.error(chalk.red(error)) } + console.log(" ") } @@ -146,7 +175,7 @@ function requestLoginAuth(serverAddress, password, authCallback) { } function isAuthTokenValid(machineToDeploy, appName, isAuthTokenValidCallback) { - let options = { + const options = { url: machineToDeploy.baseUrl + "/api/v1/user/appDefinitions/", headers: { "x-namespace": "captain", @@ -158,7 +187,7 @@ function isAuthTokenValid(machineToDeploy, appName, isAuthTokenValidCallback) { function callback(error, response, body) { try { if (!error && response.statusCode === 200) { - let data = JSON.parse(body) + const data = JSON.parse(body) if (data.status === 1106 || data.status === 1105) { isAuthTokenValidCallback(false) @@ -175,18 +204,6 @@ function isAuthTokenValid(machineToDeploy, appName, isAuthTokenValidCallback) { request(options, callback) } -function updateAuthTokenInConfigStoreAndReturn(authToken) { - let machines = configs.get("captainMachines") - for (let i = 0; i < machines.length; i++) { - if (machines[i].name === serverName) { - var baseUrl = (machines[i].authToken = authToken) - configs.set("captainMachines", machines) - console.log("You are now logged back in to " + serverAddress) - return machines[i] - } - } -} - module.exports = { requestLogin, requestLoginAuth, diff --git a/app-cli/utils/loginHelpers.js b/app-cli/utils/loginHelpers.js new file mode 100644 index 0000000..fbb34a8 --- /dev/null +++ b/app-cli/utils/loginHelpers.js @@ -0,0 +1,49 @@ +const configstore = require("configstore") +const packagejson = require("../package.json") +const configs = new configstore(packagejson.name, { + captainMachines: [] +}) +const machines = configs.get("captainMachines") + +function cleanUpUrl(url) { + if (!url || !url.length) return null + + let cleanedUrl = url + const hasSlashAtTheEnd = url.substr(url.length - 1, 1) === "/" + + if (hasSlashAtTheEnd) { + // Remove the slash at the end + cleanedUrl = url.substr(0, url.length - 1) + } + + return cleanedUrl + .replace("http://", "") + .replace("https://", "") + .trim() +} + +function _getCaptainFullName(suffix) { + const formatSuffix = suffix < 10 ? `0${suffix}` : suffix + + return `captain-${formatSuffix}` +} + +const _isSuffixValid = suffixNumber => + machines.map(machine => { + machine.name !== _getCaptainFullName(suffixNumber) + }) + +function findDefaultCaptainName() { + let currentSuffix = machines.length + 1 + + while (!_isSuffixValid(currentSuffix)) { + currentSuffix++ + } + + return _getCaptainFullName(currentSuffix) +} + +module.exports = { + cleanUpUrl, + findDefaultCaptainName +} From c4e3965ff5f09a29d0d19a0e79271072ca480749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Trevi=C3=B1o?= Date: Thu, 1 Nov 2018 12:05:33 +0100 Subject: [PATCH 04/44] Refactor messageHandler and catch unknown commands --- app-cli/captainduckduck.js | 10 ++++++++++ app-cli/utils/errorHandler.js | 9 --------- app-cli/utils/messageHandler.js | 26 ++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 9 deletions(-) delete mode 100644 app-cli/utils/errorHandler.js create mode 100644 app-cli/utils/messageHandler.js diff --git a/app-cli/captainduckduck.js b/app-cli/captainduckduck.js index abc1897..cd62b73 100755 --- a/app-cli/captainduckduck.js +++ b/app-cli/captainduckduck.js @@ -1,5 +1,6 @@ #!/usr/bin/env node +const { printErrorAndExit } = require("./utils/messageHandler") const packagejson = require("./package.json") const updateNotifier = require("update-notifier") const program = require("commander") @@ -48,4 +49,13 @@ program list() }) +// Error on unknown commands +program.on("command:*", () => { + const wrongCommands = program.args.join(" ") + + printErrorAndExit( + `\nInvalid command: ${wrongCommands}\nSee --help for a list of available commands.\n` + ) +}) + program.parse(process.argv) diff --git a/app-cli/utils/errorHandler.js b/app-cli/utils/errorHandler.js deleted file mode 100644 index 34a2ddf..0000000 --- a/app-cli/utils/errorHandler.js +++ /dev/null @@ -1,9 +0,0 @@ -const chalk = require("chalk") - -function printErrorAndExit(error) { - console.log(`${chalk.bold.red(error)}\n\n`) - - process.exit(0) -} - -module.exports = printErrorAndExit diff --git a/app-cli/utils/messageHandler.js b/app-cli/utils/messageHandler.js new file mode 100644 index 0000000..9ae72ec --- /dev/null +++ b/app-cli/utils/messageHandler.js @@ -0,0 +1,26 @@ +const chalk = require("chalk") + +function printMessage(message) { + console.log(message) +} + +function printGreenMessage(message) { + console.log(`${chalk.green(message)}`) +} + +function printError(error) { + console.log(`${chalk.bold.red(error)}`) +} + +function printErrorAndExit(error) { + console.log(`${printError(error)}`) + + process.exit(0) +} + +module.exports = { + printMessage, + printErrorAndExit, + printError, + printGreenMessage +} From 0b8c020245270f9fba75c6f2fbbfb9a9c6225cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Trevi=C3=B1o?= Date: Thu, 1 Nov 2018 12:06:08 +0100 Subject: [PATCH 05/44] Use messageHandler on the other modules --- app-cli/lib/login.js | 23 +++++++++-------------- app-cli/lib/logout.js | 7 ++++--- app-cli/utils/validationsHandler.js | 14 +++++++++----- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/app-cli/lib/login.js b/app-cli/lib/login.js index bb022aa..e96bc7a 100644 --- a/app-cli/lib/login.js +++ b/app-cli/lib/login.js @@ -1,4 +1,4 @@ -const chalk = require("chalk") +const { printGreenMessage, printError } = require("../utils/messageHandler") const inquirer = require("inquirer") const configstore = require("configstore") const packagejson = require("../package.json") @@ -7,6 +7,7 @@ const configs = new configstore(packagejson.name, { }) const machines = configs.get("captainMachines") const { cleanUpUrl, findDefaultCaptainName } = require("../utils/loginHelpers") +const { printMessage } = require("../utils/messageHandler") const { SAMPLE_DOMAIN } = require("../utils/constants") const LoginApi = require("../api/LoginApi") @@ -19,7 +20,7 @@ function setCaptainMachine(newMachine) { } function login() { - console.log("Login to a Captain Machine") + printMessage("Login to a Captain Machine") const questions = [ { @@ -27,7 +28,7 @@ function login() { default: SAMPLE_DOMAIN, name: "captainAddress", message: - "Enter address of the Captain machine. \nIt is captain.[your-captain-root-domain] :", + "\nEnter address of the Captain machine. \nIt is captain.[your-captain-root-domain] :", validate: value => { if (value === SAMPLE_DOMAIN) { return "Enter a valid URL" @@ -90,8 +91,6 @@ function login() { ] inquirer.prompt(questions).then(async answers => { - console.log("\n") - const { captainHasRootSsl, captainPassword, @@ -113,11 +112,9 @@ function login() { throw new Error(JSON.stringify(response, null, 2)) } - console.log(`${chalk.green("Logged in successfully to ")}${baseUrl}`) + printGreenMessage(`Logged in successfully to ${baseUrl}`) - console.log( - chalk.green(`Authorization token is now saved as ${captainName} \n`) - ) + printGreenMessage(`Authorization token is now saved as ${captainName} \n`) const newMachine = { authToken: response.token, @@ -127,13 +124,11 @@ function login() { setCaptainMachine(newMachine) } catch (error) { - console.error( - chalk.red(`Something bad happened. Cannot save "${captainName}"`) - ) - const errorMessage = error.message ? error.message : error - console.error(`${chalk.red(errorMessage)} \n`) + printError( + `Something bad happened. Cannot save "${captainName}" \n${errorMessage}` + ) } }) } diff --git a/app-cli/lib/logout.js b/app-cli/lib/logout.js index c096845..d5355c9 100644 --- a/app-cli/lib/logout.js +++ b/app-cli/lib/logout.js @@ -1,3 +1,4 @@ +const { printMessage } = require("../utils/messageHandler") const inquirer = require("inquirer") const configstore = require("configstore") const packagejson = require("../package.json") @@ -53,7 +54,7 @@ function removeMachineFromLocalStorage(machineName) { configs.set("captainMachines", newMachines) - console.log( + printMessage( `You are now logged out from ${removedMachine.name} at ${ removedMachine.baseUrl }...\n` @@ -63,13 +64,13 @@ function removeMachineFromLocalStorage(machineName) { function logout() { const questions = generateQuestions() - console.log("Logout from a Captain Machine and clear auth info") + printMessage("Logout from a Captain Machine and clear auth info") inquirer.prompt(questions).then(answers => { const { captainNameToLogout } = answers if (!captainNameToLogout) { - console.log("\nOperation cancelled by the user...\n") + printMessage("\nOperation cancelled by the user...\n") return } diff --git a/app-cli/utils/validationsHandler.js b/app-cli/utils/validationsHandler.js index ac6c12f..032770f 100644 --- a/app-cli/utils/validationsHandler.js +++ b/app-cli/utils/validationsHandler.js @@ -1,18 +1,22 @@ const fs = require("fs-extra") -const printErrorAndExit = require("./errorHandler") +const { printErrorAndExit } = require("./errorHandler") function validateIsGitRepository() { - if (!fs.pathExistsSync("./.git")) { + const gitFolderExists = fs.pathExistsSync("./.git") + + if (!gitFolderExists) { printErrorAndExit( - "**** ERROR: You are not in a git root directory. This command will only deploys the current directory ****" + "\n**** ERROR: You are not in a git root directory. This command will only deploys the current directory ****\n" ) } } function validateDefinitionFile() { - if (!fs.pathExistsSync("./captain-definition")) { + const captainDefinitionExists = fs.pathExistsSync("./captain-definition") + + if (!captainDefinitionExists) { printErrorAndExit( - "**** ERROR: captain-definition file cannot be found. Please see docs! ****" + "\n**** ERROR: captain-definition file cannot be found. Please see docs! ****\n" ) } } From 212cfc1af5483ebcce7842f77e109fa772392747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Trevi=C3=B1o?= Date: Thu, 1 Nov 2018 21:30:57 +0100 Subject: [PATCH 06/44] Add MachineHelper --- app-cli/helpers/MachineHelper.js | 64 ++++++++++++++++++++++++++++++++ app-cli/lib/list.js | 10 +---- app-cli/lib/login.js | 29 ++++----------- app-cli/lib/logout.js | 45 ++-------------------- app-cli/utils/loginHelpers.js | 31 +++++++--------- 5 files changed, 90 insertions(+), 89 deletions(-) create mode 100644 app-cli/helpers/MachineHelper.js diff --git a/app-cli/helpers/MachineHelper.js b/app-cli/helpers/MachineHelper.js new file mode 100644 index 0000000..74b20d2 --- /dev/null +++ b/app-cli/helpers/MachineHelper.js @@ -0,0 +1,64 @@ +const { printMessage } = require("../utils/messageHandler") +const configstore = require("configstore") +const packagejson = require("../package.json") +const configs = new configstore(packagejson.name, { + captainMachines: [] +}) + +class MachineHelper { + constructor() { + this.machines = configs.get("captainMachines") + } + + getMachinesAsOptions() { + const firstItemInOption = [ + { + name: "-- CANCEL --", + value: "", + short: "" + } + ] + const listOfMachines = this.machines.map(machine => { + return { + name: `${machine.name} at ${machine.baseUrl}`, + value: `${machine.name}`, + short: `${machine.name} at ${machine.baseUrl}` + } + }) + + return [...firstItemInOption, ...listOfMachines] + } + + setMachines(machines) { + this.machines = machines + } + + addMachine(newMachine) { + const tempMachines = this.machines + const newMachines = [...tempMachines, newMachine] + + // Add to local storage + configs.set("captainMachines", newMachines) + + this.setMachines(configs.get("captainMachines")) + } + + logoutMachine(machineName) { + const removedMachine = MachineHelper.machines.filter( + machine => machine.name === machineName + )[0] + const newMachines = MachineHelper.machines.filter( + machine => machine.name !== machineName + ) + + MachineHelper.setMachines(newMachines) + + printMessage( + `You are now logged out from ${removedMachine.name} at ${ + removedMachine.baseUrl + }...\n` + ) + } +} + +module.exports = new MachineHelper() diff --git a/app-cli/lib/list.js b/app-cli/lib/list.js index 0418def..855fc61 100644 --- a/app-cli/lib/list.js +++ b/app-cli/lib/list.js @@ -1,9 +1,5 @@ const chalk = require("chalk") -const configstore = require("configstore") -const packagejson = require("../package.json") -const configs = new configstore(packagejson.name, { - captainMachines: [] -}) +const MachineHelper = require("../helpers/MachineHelper") function _displayMachine(machine) { console.log( @@ -17,9 +13,7 @@ function _displayMachine(machine) { function list() { console.log("\nLogged in Captain Machines:\n") - const machines = configs.get("captainMachines") - - machines.map(machine => { + MachineHelper.machines.map(machine => { _displayMachine(machine) }) diff --git a/app-cli/lib/login.js b/app-cli/lib/login.js index e96bc7a..ef5c822 100644 --- a/app-cli/lib/login.js +++ b/app-cli/lib/login.js @@ -1,24 +1,11 @@ +const MachineHelper = require("../helpers/MachineHelper") const { printGreenMessage, printError } = require("../utils/messageHandler") const inquirer = require("inquirer") -const configstore = require("configstore") -const packagejson = require("../package.json") -const configs = new configstore(packagejson.name, { - captainMachines: [] -}) -const machines = configs.get("captainMachines") const { cleanUpUrl, findDefaultCaptainName } = require("../utils/loginHelpers") const { printMessage } = require("../utils/messageHandler") const { SAMPLE_DOMAIN } = require("../utils/constants") const LoginApi = require("../api/LoginApi") -function setCaptainMachine(newMachine) { - const machines = configs.get("captainMachines") - - machines.push(newMachine) - - configs.set("captainMachines", machines) -} - function login() { printMessage("Login to a Captain Machine") @@ -36,7 +23,7 @@ function login() { if (!cleanUpUrl(value)) return "This is an invalid URL: " + value - machines.map(machine => { + MachineHelper.machines.map(machine => { if (cleanUpUrl(machine.baseUrl) === cleanUpUrl(value)) { return `${value} already exist as ${ machine.name @@ -75,7 +62,7 @@ function login() { message: "Enter a name for this Captain machine:", default: findDefaultCaptainName(), validate: value => { - machines.map(machine => { + MachineHelper.machines.map(machine => { if (machine.name === value) { return `${value} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.` } @@ -112,17 +99,17 @@ function login() { throw new Error(JSON.stringify(response, null, 2)) } - printGreenMessage(`Logged in successfully to ${baseUrl}`) - - printGreenMessage(`Authorization token is now saved as ${captainName} \n`) - const newMachine = { authToken: response.token, baseUrl, name: captainName } - setCaptainMachine(newMachine) + MachineHelper.addMachine(newMachine) + + printGreenMessage(`Logged in successfully to ${baseUrl}`) + + printGreenMessage(`Authorization token is now saved as ${captainName} \n`) } catch (error) { const errorMessage = error.message ? error.message : error diff --git a/app-cli/lib/logout.js b/app-cli/lib/logout.js index d5355c9..2eb7e46 100644 --- a/app-cli/lib/logout.js +++ b/app-cli/lib/logout.js @@ -1,33 +1,9 @@ +const MachineHelper = require("../helpers/MachineHelper") const { printMessage } = require("../utils/messageHandler") const inquirer = require("inquirer") -const configstore = require("configstore") -const packagejson = require("../package.json") -const configs = new configstore(packagejson.name, { - captainMachines: [] -}) -const machines = configs.get("captainMachines") - -function getMachineList() { - const firstItemInOption = [ - { - name: "-- CANCEL --", - value: "", - short: "" - } - ] - const listOfMachines = machines.map(machine => { - return { - name: `${machine.name} at ${machine.baseUrl}`, - value: `${machine.name}`, - short: `${machine.name} at ${machine.baseUrl}` - } - }) - - return [...firstItemInOption, ...listOfMachines] -} function generateQuestions() { - const listOfMachines = getMachineList() + const listOfMachines = MachineHelper.getMachinesAsOptions() return [ { @@ -46,21 +22,6 @@ function generateQuestions() { ] } -function removeMachineFromLocalStorage(machineName) { - const removedMachine = machines.filter( - machine => machine.name === machineName - )[0] - const newMachines = machines.filter(machine => machine.name !== machineName) - - configs.set("captainMachines", newMachines) - - printMessage( - `You are now logged out from ${removedMachine.name} at ${ - removedMachine.baseUrl - }...\n` - ) -} - function logout() { const questions = generateQuestions() @@ -75,7 +36,7 @@ function logout() { return } - removeMachineFromLocalStorage(captainNameToLogout) + MachineHelper.logoutMachine(captainNameToLogout) }) } diff --git a/app-cli/utils/loginHelpers.js b/app-cli/utils/loginHelpers.js index fbb34a8..6190357 100644 --- a/app-cli/utils/loginHelpers.js +++ b/app-cli/utils/loginHelpers.js @@ -1,9 +1,4 @@ -const configstore = require("configstore") -const packagejson = require("../package.json") -const configs = new configstore(packagejson.name, { - captainMachines: [] -}) -const machines = configs.get("captainMachines") +const MachineHelper = require("../helpers/MachineHelper") function cleanUpUrl(url) { if (!url || !url.length) return null @@ -22,19 +17,8 @@ function cleanUpUrl(url) { .trim() } -function _getCaptainFullName(suffix) { - const formatSuffix = suffix < 10 ? `0${suffix}` : suffix - - return `captain-${formatSuffix}` -} - -const _isSuffixValid = suffixNumber => - machines.map(machine => { - machine.name !== _getCaptainFullName(suffixNumber) - }) - function findDefaultCaptainName() { - let currentSuffix = machines.length + 1 + let currentSuffix = MachineHelper.machines.length + 1 while (!_isSuffixValid(currentSuffix)) { currentSuffix++ @@ -43,6 +27,17 @@ function findDefaultCaptainName() { return _getCaptainFullName(currentSuffix) } +function _getCaptainFullName(suffix) { + const formatSuffix = suffix < 10 ? `0${suffix}` : suffix + + return `captain-${formatSuffix}` +} + +const _isSuffixValid = suffixNumber => + MachineHelper.machines.map(machine => { + machine.name !== _getCaptainFullName(suffixNumber) + }) + module.exports = { cleanUpUrl, findDefaultCaptainName From 46949f7dc2364cb57f9eb36bf563e2622c789231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Trevi=C3=B1o?= Date: Fri, 2 Nov 2018 09:11:49 +0100 Subject: [PATCH 07/44] Fix Logout function on MachineHelper --- app-cli/helpers/MachineHelper.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app-cli/helpers/MachineHelper.js b/app-cli/helpers/MachineHelper.js index 74b20d2..ccb0ff3 100644 --- a/app-cli/helpers/MachineHelper.js +++ b/app-cli/helpers/MachineHelper.js @@ -31,6 +31,8 @@ class MachineHelper { setMachines(machines) { this.machines = machines + + configs.set("captainMachines", machines) } addMachine(newMachine) { @@ -44,14 +46,14 @@ class MachineHelper { } logoutMachine(machineName) { - const removedMachine = MachineHelper.machines.filter( + const removedMachine = this.machines.filter( machine => machine.name === machineName )[0] - const newMachines = MachineHelper.machines.filter( + const newMachines = this.machines.filter( machine => machine.name !== machineName ) - MachineHelper.setMachines(newMachines) + this.setMachines(newMachines) printMessage( `You are now logged out from ${removedMachine.name} at ${ From ce7b573fe35b7951eb608a9436974405efd15f59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Trevi=C3=B1o?= Date: Sun, 4 Nov 2018 21:15:50 +0100 Subject: [PATCH 08/44] Refactor to serversetup --- app-cli/api/LoginApi.js | 54 ++- app-cli/api/MainApi.js | 81 +++- app-cli/api/SystemApi.js | 87 +++++ app-cli/captainduckduck.js | 32 +- app-cli/lib/login.js | 5 +- app-cli/lib/serversetup.js | 563 +++++++--------------------- app-cli/utils/constants.js | 4 +- app-cli/utils/fileHandler.js | 178 --------- app-cli/utils/loginHandler.js | 211 ----------- app-cli/utils/messageHandler.js | 18 +- app-cli/utils/validationsHandler.js | 17 +- 11 files changed, 406 insertions(+), 844 deletions(-) create mode 100644 app-cli/api/SystemApi.js delete mode 100644 app-cli/utils/fileHandler.js delete mode 100644 app-cli/utils/loginHandler.js diff --git a/app-cli/api/LoginApi.js b/app-cli/api/LoginApi.js index 57d1cd8..0a4ec4a 100644 --- a/app-cli/api/LoginApi.js +++ b/app-cli/api/LoginApi.js @@ -1,9 +1,59 @@ const MainApi = require("./MainApi") +const SystemApi = require("./SystemApi") +const { DEFAULT_PASSWORD } = require("../utils/constants") class LoginApi { - loginMachine(url, password) { + constructor() { + this.token = "" + + this.oldPassword = DEFAULT_PASSWORD + } + + setOldPassword(newPassword) { + this.oldPassword = newPassword + } + + setToken(newToken) { + this.token = newToken + } + + async loginMachine(baseUrl, password) { try { - return MainApi.post(url, { password }) + const data = await MainApi.post(`${baseUrl}/api/v1/login`, { password }) + const dataAsObject = JSON.parse(data) + + if (dataAsObject) { + this.setToken(dataAsObject.token) + } + + return data + } catch (e) { + throw e + } + } + + async changePass(baseUrl, newPassword) { + try { + const customOptions = { + headers: { + "x-captain-auth": LoginApi.token + } + } + const form = { + oldPassword: this.oldPassword, + newPassword + } + const data = await MainApi.post( + `${baseUrl}/api/v1/user/changepassword/`, + form, + customOptions + ) + + this.setToken(data.token) + + SystemApi.setIpAddressOfServer(baseUrl) + + return data } catch (e) { throw e } diff --git a/app-cli/api/MainApi.js b/app-cli/api/MainApi.js index 630e179..d60f8fe 100644 --- a/app-cli/api/MainApi.js +++ b/app-cli/api/MainApi.js @@ -1,33 +1,84 @@ const Request = require("request-promise") class MainApi { - get(url, config) { - return Request.get(url) - } - - post(url, form, config) { - const options = { - url, + constructor() { + this.sharedOptions = { headers: { "x-namespace": "captain" - }, + } + } + } + + _buildOptions(options) { + if (!options) return this.sharedOptions + + if (options.headers) { + options.headers = Object.assign( + {}, + this.sharedOptions.headers, + options.headers + ) + } + + return Object.assign({}, this.sharedOptions, options) + } + + get(url, options) { + const overrideOptions = this._buildOptions(options) + const optionsToSend = { + ...overrideOptions, + url, + method: "GET" + } + + return Request(optionsToSend) + } + + post(url, form, options) { + const overrideOptions = this._buildOptions(options) + const optionsToSend = { + ...overrideOptions, + url, method: "POST", form } - return Request(options) + return Request(optionsToSend) } - put(url, data, config) { - return Request.put(url, data) + put(url, form, options) { + const overrideOptions = this._buildOptions(options) + const optionsToSend = { + ...overrideOptions, + url, + method: "PUT", + form + } + + return Request(optionsToSend) } - patch(url, data, config) { - return Request.patch(url, data) + patch(url, form, options) { + const overrideOptions = this._buildOptions(options) + const optionsToSend = { + ...overrideOptions, + url, + method: "PATCH", + form + } + + return Request(optionsToSend) } - delete(url, data, config) { - return Request.delete(url) + delete(url, options) { + const overrideOptions = this._buildOptions(options) + const optionsToSend = { + ...overrideOptions, + url, + method: "DELETE" + } + + return Request(optionsToSend) } } diff --git a/app-cli/api/SystemApi.js b/app-cli/api/SystemApi.js new file mode 100644 index 0000000..5eed530 --- /dev/null +++ b/app-cli/api/SystemApi.js @@ -0,0 +1,87 @@ +const MainApi = require("./MainApi") +const LoginApi = require("./LoginApi") +// const spinnerUtil = require("../../utils/spinner") + +class SystemApi { + constructor() { + this.ipAddressOfServer = "" + + this.customDomainFromUser = "" + + this.newPasswordFirstTry = "" + } + + setCustomDomainFromUser(newCustomDomainFromUser) { + this.customDomainFromUser = newCustomDomainFromUser + } + + setIpAddressOfServer(newIpAddress) { + this.ipAddressOfServer = newIpAddress.trim() + } + + async setCustomDomain(baseUrl, rootDomain) { + try { + const customOptions = { + headers: { + "x-captain-auth": LoginApi.token + } + } + const data = await MainApi.post( + `${baseUrl}/api/v1/user/system/changerootdomain/`, + { + rootDomain + }, + customOptions + ) + + return data + } catch (e) { + throw e + } + } + + async enableHttps(baseUrl, emailAddress) { + const customOptions = { + headers: { + "x-captain-auth": LoginApi.token + } + } + + try { + const data = await MainApi.post( + `${baseUrl}/api/v1/user/system/enablessl/`, + { + emailAddress + }, + customOptions + ) + + return data + } catch (e) { + throw e + } + } + + async forceHttps(baseUrl, isEnabled = true) { + try { + const customOptions = { + headers: { + "x-captain-auth": LoginApi.token + } + } + const data = await MainApi.post( + `${baseUrl}/api/v1/user/system/forcessl/`, + { + isEnabled + }, + customOptions + ) + + return data + } catch (e) { + throw e + } + } +} + +module.exports = new SystemApi() diff --git a/app-cli/captainduckduck.js b/app-cli/captainduckduck.js index cd62b73..f11c9f8 100755 --- a/app-cli/captainduckduck.js +++ b/app-cli/captainduckduck.js @@ -8,24 +8,23 @@ const program = require("commander") updateNotifier({ pkg: packagejson }).notify({ isGlobal: true }) // Command actions -const list = require("./lib/list") -const logout = require("./lib/logout") +const serversetup = require("./lib/serversetup") const login = require("./lib/login") +const logout = require("./lib/logout") +const list = require("./lib/list") +// const deploy = require("./lib/deploy") // Setup program.version(packagejson.version).description(packagejson.description) -program - .command( - "serversetup", - "Performs necessary actions and prepares your Captain server." - ) - .command( - "deploy", - "Deploy your app (current directory) to a specific Captain machine. You'll be prompted to choose your Captain machine." - ) - // Commands +program + .command("serversetup") + .description("Performs necessary actions and prepares your Captain server.") + .action(() => { + serversetup() + }) + program .command("login") .description( @@ -49,6 +48,15 @@ program list() }) +program + .command("deploy") + .description( + "Deploy your app (current directory) to a specific Captain machine. You'll be prompted to choose your Captain machine." + ) + .action(() => { + // deploy() + }) + // Error on unknown commands program.on("command:*", () => { const wrongCommands = program.args.join(" ") diff --git a/app-cli/lib/login.js b/app-cli/lib/login.js index ef5c822..b388bcc 100644 --- a/app-cli/lib/login.js +++ b/app-cli/lib/login.js @@ -88,10 +88,7 @@ function login() { const baseUrl = `${handleHttp}${cleanUpUrl(captainAddress)}` try { - const data = await LoginApi.loginMachine( - `${baseUrl}/api/v1/login`, - captainPassword - ) + const data = await LoginApi.loginMachine(baseUrl, captainPassword) const response = JSON.parse(data) // TODO - This status should be 200 maybe? diff --git a/app-cli/lib/serversetup.js b/app-cli/lib/serversetup.js index 5b01350..ceb1899 100644 --- a/app-cli/lib/serversetup.js +++ b/app-cli/lib/serversetup.js @@ -1,218 +1,18 @@ -const program = require("commander") -const chalk = require("chalk") +const MachineHelper = require("../helpers/MachineHelper") +const SystemApi = require("../api/SystemApi") +const LoginApi = require("../api/LoginApi") const inquirer = require("inquirer") -const configstore = require("configstore") -const request = require("request") -const spinnerUtil = require("./utils/spinner") -const packagejson = require("./package.json") -const configs = new configstore(packagejson.name, { - captainMachines: [] -}) - -program.description("Easy setup for your Captain server.").parse(process.argv) - -if (program.args.length) { - console.error(chalk.red("Unrecognized commands:")) - - program.args.forEach(function(arg) { - console.log(chalk.red(arg)) - }) - - console.error(chalk.red("This command does not require any options. ")) - - process.exit(1) -} - -function findDefaultCaptainName() { - const machines = configs.get("captainMachines") - let currentSuffix = machines.length + 1 - - function getCaptainFullName(suffix) { - if (suffix < 10) { - suffix = "0" + suffix - } - - return "captain-" + suffix - } - - function isSuffixValid(suffixNumber) { - for (let i = 0; i < machines.length; i++) { - const m = machines[i] - - if (m.name === getCaptainFullName(suffixNumber)) { - return false - } - } - - return true - } - - while (!isSuffixValid(currentSuffix)) { - currentSuffix++ - } - - return getCaptainFullName(currentSuffix) -} - -function isIpAddress(ipaddress) { - if ( - /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test( - ipaddress - ) - ) { - return true - } - - return false -} - -console.log("\nSetup your Captain server\n") - -const SAMPLE_IP = "123.123.123.123" -let authTokenFromLogin = null -let ipAddressOfServer = null -let customDomainFromUser = null -let newPasswordFirstTry = null -let oldPassword = "captain42" - -function setCustomDomain(baseApiUrl, customDomain) { - return apiEndpointWithLoading("Changing Domain...")( - "POST", - baseApiUrl, - "/api/v1/user/system/changerootdomain/", - { - rootDomain: customDomain - } - ) -} - -function enableHttps(baseApiUrl, emailAddress) { - return apiEndpointWithLoading("Enabling SSL...")( - "POST", - baseApiUrl, - "/api/v1/user/system/enablessl/", - { - emailAddress: emailAddress - } - ) -} - -function changePass(baseApiUrl, newPass) { - return apiEndpointWithLoading("Changing Password...")( - "POST", - baseApiUrl, - "/api/v1/user/changepassword/", - { - oldPassword: oldPassword, - newPassword: newPass - } - ) -} - -function forceHttps(baseApiUrl) { - return apiEndpointWithLoading("Forcing SSL...")( - "POST", - baseApiUrl, - "/api/v1/user/system/forcessl/", - { - isEnabled: true - } - ) -} - -// returns promise that resolves to auth token -// rejects with ErrorCode or null -function login(baseApiUrl, password) { - return apiEndpointWithLoading("Login...")( - "POST", - baseApiUrl, - "/api/v1/login", - { - password: password - } - ).then(function(data) { - return data.token - }) -} - -function apiEndpointWithLoading(message) { - return (method, baseApiUrl, endpoint, dataToSend) => { - return apiEndpoint(method, baseApiUrl, endpoint, dataToSend, message) - } -} - -function apiEndpoint(method, baseApiUrl, endpoint, dataToSend, message) { - const options = { - url: baseApiUrl + endpoint, - headers: { - "x-namespace": "captain", - "x-captain-auth": authTokenFromLogin - }, - method: method, - form: dataToSend - } - - return new Promise(function(res, rej) { - let spinner - - if (message) { - spinner = spinnerUtil.start(message) - } - - var callback = function(error, response, body) { - try { - if (!error && response.statusCode === 200) { - const data = JSON.parse(body) - - if (data.status !== 100) { - if (spinner) { - spinnerUtil.fail(spinner) - } - - rej(data) - - return - } - - if (spinner) { - spinnerUtil.succeed(spinner) - } - - res(data) - - return - } - - if (error) { - throw new Error(error) - } - - throw new Error( - response ? JSON.stringify(response, null, 2) : "Response NULL" - ) - } catch (error) { - if (spinner) { - spinnerUtil.fail(spinner) - } - - console.error( - chalk.red( - `Something bad happened. Cannot connect to "${baseApiUrl} ${endpoint}"` - ) - ) - - const errorMessage = error.message ? error.message : error - - console.error(`${chalk.red(errorMessage)}\n`) - - process.exit(0) - } - } - - request(options, callback) - }) -} - +const { findDefaultCaptainName } = require("../utils/loginHelpers") +const { isIpAddress } = require("../utils/validationsHandler") +const { SAMPLE_IP, DEFAULT_PASSWORD } = require("../utils/constants") +const { + printMessage, + printErrorAndExit, + printError, + printMessageAndExit, + errorHandler +} = require("../utils/messageHandler") +let newPasswordFirstTry = undefined const questions = [ { type: "list", @@ -222,24 +22,18 @@ const questions = [ "\nmkdir /captain && docker run -v /var/run/docker.sock:/var/run/docker.sock dockersaturn/captainduckduck ?", default: "Yes", choices: ["Yes", "No"], - filter: function(value) { - return new Promise(function(res, rej) { - if (value === "Yes") { - res(true) + filter: value => { + const answerFromUser = value.trim() - return - } + if (answerFromUser === "Yes") return answerFromUser - console.log( - "\n\nCannot start the setup process if Captain is not installed." - ) + printMessage( + "\n\nCannot start the setup process if Captain is not installed." + ) - console.log( - "Please read tutorial on CaptainDuckDuck.com\n to learn how to install CaptainDuckDuck on a server.\n" - ) - - process.exit(0) - }) + printMessageAndExit( + "Please read tutorial on CaptainDuckDuck.com to learn how to install CaptainDuckDuck on a server." + ) } }, { @@ -247,88 +41,50 @@ const questions = [ default: SAMPLE_IP, name: "captainAddress", message: "Enter IP address of your captain server:", - filter: function(value) { - return new Promise(function(res, rej) { - if (value === SAMPLE_IP) { - rej("Enter a valid IP Address") + filter: async value => { + const ipFromUser = value.trim() - return - } + if (ipFromUser === SAMPLE_IP || !isIpAddress(ipFromUser)) { + printErrorAndExit(`\nThis is an invalid IP Address: ${ipFromUser}`) + } - if (!isIpAddress(value.trim())) { - rej("This is an invalid IP Address: " + value) + try { + // login using captain42. and set the ipAddressToServer + const data = await LoginApi.loginMachine( + `http://${ipFromUser}:3000`, + DEFAULT_PASSWORD + ) - return - } + SystemApi.setIpAddressOfServer(ipFromUser) - ipAddressOfServer = value.trim() - - //login using captain42. - - return login("http://" + ipAddressOfServer + ":3000", oldPassword) - .then(function(authTokenFetched) { - authTokenFromLogin = authTokenFetched - - res(ipAddressOfServer) - }) - .catch(function(error) { - // if error is anything but password wrong, exit here... - if (error.status == 1105) { - authTokenFromLogin = null - - res(ipAddressOfServer) - - return - } - - console.log("") - - if (error.status) { - console.log(chalk.red(`Error: ${error.status}`)) - - console.log(chalk.red(`Error: ${error.description}`)) - } else { - console.log(chalk.red(`Error: ${error}`)) - } - - process.exit(0) - }) - }) + // All went well + if (data) return ipFromUser + } catch (e) { + errorHandler(e) + } } }, { type: "password", name: "captainOriginalPassword", message: "Enter your current password:", - when: function() { - return !authTokenFromLogin - }, - filter: function(value) { - return new Promise(function(res, rej) { - console.log("") + when: () => !LoginApi.token, + filter: async value => { + try { + const captainPasswordFromUser = value.trim() + const data = await LoginApi.loginMachine( + `http://${SystemApi.ipAddressOfServer}:3000`, + captainPasswordFromUser + ) - return login("http://" + ipAddressOfServer + ":3000", value) - .then(function(authTokenFetched) { - authTokenFromLogin = authTokenFetched + if (data) { + SystemApi.setIpAddressOfServer(captainPasswordFromUser) - oldPassword = value - - res(value) - }) - .catch(function(error) { - console.log("") - - if (error.status) { - console.log(chalk.red("Error: " + error.status)) - - console.log(chalk.red("Error: " + error.description)) - } else { - console.log(chalk.red("Error: " + error)) - } - - process.exit(0) - }) - }) + LoginApi.setOldPassword(captainPasswordFromUser) + } + } catch (e) { + errorHandler(e) + } } }, { @@ -338,136 +94,103 @@ const questions = [ "Enter a root domain for this Captain server. For example, enter test.yourdomain.com if you" + " setup your DNS to point *.test.yourdomain.com to ip address of your server" + ": ", - filter: function(value) { - return new Promise(function(res, rej) { - value = value.trim() + filter: async value => { + try { + const captainRootDomainFromUser = value.trim() + const data = await SystemApi.setCustomDomain( + `http://${SystemApi.ipAddressOfServer}:3000`, + captainRootDomainFromUser + ) - customDomainFromUser = "captain." + value + if (data) { + const newCustomDomainFromUser = `captain.${captainRootDomainFromUser}` - return setCustomDomain("http://" + ipAddressOfServer + ":3000", value) - .then(function() { - res(customDomainFromUser) - }) - .catch(function(error) { - if (error.status) { - console.log(chalk.red(`Error: ${error.status}`)) + SystemApi.setCustomDomainFromUser(newCustomDomainFromUser) - console.log(chalk.red(`Error: ${error.description}`)) - } else { - console.log(chalk.red(`Error: ${error}`)) - } - - process.exit(0) - }) - }) + return captainRootDomainFromUser + } + } catch (e) { + errorHandler(e) + } } }, { type: "input", name: "emailAddress", message: "Enter your 'valid' email address to enable HTTPS: ", - filter: function(value) { - return new Promise(function(res, rej) { - console.log("") + filter: async value => { + try { + const emailAddressFromUser = value.trim() + const { customDomainFromUser } = SystemApi - value = value.trim() + await SystemApi.enableHttps( + `http://${customDomainFromUser}`, + emailAddressFromUser + ) - return enableHttps("http://" + customDomainFromUser, value) - .then(function() { - return forceHttps("https://" + customDomainFromUser) - }) - .then(function() { - res(value) - }) - .catch(function(error) { - console.log("") + const data = await SystemApi.forceHttps( + `https://${customDomainFromUser}` + ) - if (error.status) { - console.log(chalk.red(`Error: ${error.status}`)) - - console.log(chalk.red(`Error: ${error.description}`)) - } else { - console.log(chalk.red(`Error: ${error}`)) - } - - process.exit(0) - }) - }) + if (data) return emailAddressFromUser + } catch (e) { + errorHandler(e) + } } }, { type: "password", name: "newPasswordFirstTry", message: "Enter a new password:", - filter: function(value) { - return new Promise(function(res, rej) { - newPasswordFirstTry = value + filter: value => { + newPasswordFirstTry = value - res(value) - }) + return value } }, { type: "password", name: "newPassword", message: "Enter a new password:", - filter: function(value) { - return new Promise(function(res, rej) { - if (newPasswordFirstTry !== value) { - rej("Passwords do not match") - //process.exit(0); + filter: async value => { + const { customDomainFromUser } = SystemApi - return + try { + const confirmPasswordValueFromUser = value + const machineUrl = `https://${customDomainFromUser}` + + if (newPasswordFirstTry !== confirmPasswordValueFromUser) { + printErrorAndExit("Passwords do not match") } - return changePass("https://" + customDomainFromUser, value) - .then(function() { - return login("https://" + customDomainFromUser, value) - }) - .then(function(token) { - authTokenFromLogin = token + const changePassData = await LoginApi.changePass( + machineUrl, + confirmPasswordValueFromUser + ) - res(value) - }) - .catch(function(error) { - console.log("") + if (changePassData) { + const loginData = await LoginApi.login( + machineUrl, + confirmPasswordValueFromUser + ) - if (error.status) { - console.log(chalk.red(`Error: ${error.status}`)) + if (loginData) return + } + } catch (e) { + printError( + "\nIMPORTANT!! Server setup is completed by password is not changed." + ) - console.log(chalk.red(`Error: ${error.description}`)) - } else { - console.log(chalk.red(`Error: ${error}`)) - } + printError("\nYou CANNOT use serversetup anymore. To continue:") - console.log( - chalk.red( - "\nIMPORTANT!! Server setup is completed by password is not changed." - ) - ) + printError( + `\n- Go to https://${customDomainFromUser} login with default password and change the password in settings.` + ) - console.log( - chalk.red("You CANNOT use serversetup anymore. To continue: ") - ) - - console.log( - chalk.red( - "- Go to https://" + - customDomainFromUser + - " login with default password and change the password in settings." - ) - ) - - console.log( - chalk.red( - "- In terminal (here), type captainduckduck login and enter this as your root domain: " + - customDomainFromUser - ) - ) - - process.exit(0) - }) - }) + printErrorAndExit( + `\n- In terminal (here), type captainduckduck login and enter this as your root domain: ${customDomainFromUser}` + ) + } } }, { @@ -475,14 +198,14 @@ const questions = [ name: "captainName", message: "Enter a name for this Captain machine:", default: findDefaultCaptainName(), - validate: function(value) { - const machines = configs.get("captainMachines") + validate: value => { + const newMachineName = value.trim() - for (let i = 0; i < machines.length; i++) { - if (machines[i].name === value) { - return `${value} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.` - } - } + MachineHelper.machines.map( + machine => + machine.name === newMachineName && + `${newMachineName} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.` + ) if (value.match(/^[-\d\w]+$/i)) { return true @@ -493,22 +216,26 @@ const questions = [ } ] -inquirer.prompt(questions).then(function(answers) { - var captainAddress = "https://" + customDomainFromUser +function serversetup() { + printMessage("\nSetup your Captain server\n") - const machines = configs.get("captainMachines") + inquirer.prompt(questions).then(answers => { + var captainAddress = `https://${SystemApi.customDomainFromUser}` - machines.push({ - authToken: authTokenFromLogin, - baseUrl: captainAddress, - name: answers.captainName + const newMachine = { + authToken: LoginApi.token, + baseUrl: captainAddress, + name: answers.captainName + } + + MachineHelper.addMachine(newMachine) + + printMessage(`\n\nCaptain is available at ${captainAddress}`) + + printMessage( + "\nFor more details and docs see http://www.captainduckduck.com\n\n" + ) }) +} - configs.set("captainMachines", machines) - - console.log(`\n\nCaptain is available at ${captainAddress}`) - - console.log( - "\nFor more details and docs see http://www.captainduckduck.com\n\n" - ) -}) +module.exports = serversetup diff --git a/app-cli/utils/constants.js b/app-cli/utils/constants.js index 0c5224c..5862009 100644 --- a/app-cli/utils/constants.js +++ b/app-cli/utils/constants.js @@ -1,3 +1,5 @@ const SAMPLE_DOMAIN = "captain.captainroot.yourdomain.com" +const SAMPLE_IP = "123.123.123.123" +const DEFAULT_PASSWORD = "captain42" -module.exports = { SAMPLE_DOMAIN } +module.exports = { SAMPLE_DOMAIN, SAMPLE_IP, DEFAULT_PASSWORD } diff --git a/app-cli/utils/fileHandler.js b/app-cli/utils/fileHandler.js deleted file mode 100644 index 1358c6a..0000000 --- a/app-cli/utils/fileHandler.js +++ /dev/null @@ -1,178 +0,0 @@ -const fs = require("fs-extra") -const chalk = require("chalk") -const request = require("request") -const ProgressBar = require("progress") -const ora = require("ora") -const configstore = require("configstore") -const packagejson = require("./package.json") -const { requestLogin } = require("./utils/loginHandler") -const configs = new configstore(packagejson.name, { - captainMachines: [], - apps: [] -}) - -function sendFileToCaptain( - machineToDeploy, - zipFileFullPath, - appName, - gitHash, - branchToPush -) { - console.log("Uploading file to " + machineToDeploy.baseUrl) - - const fileSize = fs.statSync(zipFileFullPath).size - const fileStream = fs.createReadStream(zipFileFullPath) - const barOpts = { - width: 20, - total: fileSize, - clear: true - } - const bar = new ProgressBar( - " uploading [:bar] :percent (ETA :etas)", - barOpts - ) - - fileStream.on("data", function(chunk) { - bar.tick(chunk.length) - }) - - let spinner - - fileStream.on("end", function() { - console.log(" ") - - console.log("This might take several minutes. PLEASE BE PATIENT...") - - spinner = ora("Building your source code...").start() - - spinner.color = "yellow" - }) - - const options = { - url: - machineToDeploy.baseUrl + - "/api/v1/user/appData/" + - appName + - "/?detached=1", - headers: { - "x-namespace": "captain", - "x-captain-auth": machineToDeploy.authToken - }, - method: "POST", - formData: { - sourceFile: fileStream, - gitHash: gitHash - } - } - - function callback(error, response, body) { - if (spinner) { - spinner.stop() - } - - if (fs.pathExistsSync(zipFileFullPath) && !getSuppliedTarFile()) { - fs.removeSync(zipFileFullPath) - } - - try { - if (!error && response.statusCode === 200) { - const data = JSON.parse(body) - - if (data.status === 1106) { - // expired token - requestLogin( - machineToDeploy.name, - machineToDeploy.baseUrl, - function callback(machineToDeployNew) { - deployTo(machineToDeployNew, branchToPush, appName) - } - ) - - return - } - - if (data.status !== 100 && data.status !== 101) { - throw new Error(JSON.stringify(data, null, 2)) - } - - savePropForDirectory(APP_NAME, appName) - - savePropForDirectory(BRANCH_TO_PUSH, branchToPush) - - savePropForDirectory(MACHINE_TO_DEPLOY, machineToDeploy) - - if (data.status === 100) { - console.log(chalk.green("Deployed successfully: ") + appName) - console.log(" ") - } else if (data.status === 101) { - console.log(chalk.green("Building started: ") + appName) - console.log(" ") - - startFetchingBuildLogs(machineToDeploy, appName) - } - - return - } - - if (error) { - throw new Error(error) - } - - throw new Error( - response ? JSON.stringify(response, null, 2) : "Response NULL" - ) - } catch (error) { - console.error( - chalk.red('\nSomething bad happened. Cannot deploy "' + appName + '"\n') - ) - - if (error.message) { - try { - var errorObj = JSON.parse(error.message) - if (errorObj.status) { - console.error(chalk.red("\nError code: " + errorObj.status)) - console.error( - chalk.red("\nError message:\n\n " + errorObj.description) - ) - } else { - throw new Error("NOT API ERROR") - } - } catch (ignoreError) { - console.error(chalk.red(error.message)) - } - } else { - console.error(chalk.red(error)) - } - console.log(" ") - } - } - - request(options, callback) -} - -// Sets default value for propType that is stored in a directory to propValue. -// Replaces saveAppForDirectory -function savePropForDirectory(propType, propValue) { - const apps = configs.get("apps") - - for (let i = 0; i < apps.length; i++) { - const app = apps[i] - - if (app.cwd === process.cwd()) { - app[propType] = propValue - - configs.set("apps", apps) - - return - } - } - - apps.push({ - cwd: process.cwd(), - [propType]: propValue - }) - - configs.set("apps", apps) -} - -module.exports = sendFileToCaptain diff --git a/app-cli/utils/loginHandler.js b/app-cli/utils/loginHandler.js deleted file mode 100644 index fa5c779..0000000 --- a/app-cli/utils/loginHandler.js +++ /dev/null @@ -1,211 +0,0 @@ -const inquirer = require("inquirer") -const chalk = require("chalk") -const request = require("request") -const configstore = require("configstore") -const packagejson = require("../package.json") -const configs = new configstore(packagejson.name, { - captainMachines: [] -}) - -function requestLogin(serverName, serverAddress, loginCallback) { - console.log("Your auth token is not valid anymore. Try to login again.") - - const questions = [ - { - type: "password", - name: "captainPassword", - message: "Please enter your password for " + serverAddress, - validate: function(value) { - if (value && value.trim()) { - return true - } - - return "Please enter your password for " + serverAddress - } - } - ] - - function updateAuthTokenInConfigStoreAndReturn(authToken) { - const machines = configs.get("captainMachines") - - for (let i = 0; i < machines.length; i++) { - if (machines[i].name === serverName) { - machines[i].authToken = authToken - - configs.set("captainMachines", machines) - - console.log("You are now logged back in to " + serverAddress) - - return machines[i] - } - } - } - - inquirer.prompt(questions).then(passwordAnswers => { - var { captainPassword } = passwordAnswers - - const options = { - url: serverAddress + "/api/v1/login", - headers: { - "x-namespace": "captain" - }, - method: "POST", - form: { - password: captainPassword - } - } - - function callback(error, response, body) { - try { - if (!error && response.statusCode === 200) { - const data = JSON.parse(body) - - if (data.status !== 100) { - throw new Error(JSON.stringify(data, null, 2)) - } - - var newMachineToDeploy = updateAuthTokenInConfigStoreAndReturn( - data.token - ) - - loginCallback(newMachineToDeploy) - - return - } - - if (error) { - throw new Error(error) - } - - throw new Error( - response ? JSON.stringify(response, null, 2) : "Response NULL" - ) - } catch (error) { - if (error.message) { - try { - var errorObj = JSON.parse(error.message) - - if (errorObj.status) { - console.error(chalk.red("\nError code: " + errorObj.status)) - - console.error( - chalk.red("\nError message:\n\n " + errorObj.description) - ) - } else { - throw new Error("NOT API ERROR") - } - } catch (ignoreError) { - console.error(chalk.red(error.message)) - } - } else { - console.error(chalk.red(error)) - } - - console.log(" ") - } - - process.exit(0) - } - - request(options, callback) - }) -} - -function requestLoginAuth(serverAddress, password, authCallback) { - const options = { - url: serverAddress + "/api/v1/login", - headers: { - "x-namespace": "captain" - }, - method: "POST", - form: { - password: password - } - } - - function callback(error, response, body) { - try { - if (!error && response.statusCode === 200) { - const data = JSON.parse(body) - - if (data.status !== 100) { - throw new Error(JSON.stringify(data, null, 2)) - } - - authCallback(data.token) - - return - } - - if (error) { - throw new Error(error) - } - - throw new Error( - response ? JSON.stringify(response, null, 2) : "Response NULL" - ) - } catch (error) { - if (error.message) { - try { - var errorObj = JSON.parse(error.message) - - if (errorObj.status) { - console.error(chalk.red("\nError code: " + errorObj.status)) - - console.error( - chalk.red("\nError message:\n\n " + errorObj.description) - ) - } else { - throw new Error("NOT API ERROR") - } - } catch (ignoreError) { - console.error(chalk.red(error.message)) - } - } else { - console.error(chalk.red(error)) - } - - console.log(" ") - } - - process.exit(0) - } - - request(options, callback) -} - -function isAuthTokenValid(machineToDeploy, appName, isAuthTokenValidCallback) { - const options = { - url: machineToDeploy.baseUrl + "/api/v1/user/appDefinitions/", - headers: { - "x-namespace": "captain", - "x-captain-auth": machineToDeploy.authToken - }, - method: "GET" - } - - function callback(error, response, body) { - try { - if (!error && response.statusCode === 200) { - const data = JSON.parse(body) - - if (data.status === 1106 || data.status === 1105) { - isAuthTokenValidCallback(false) - } else { - isAuthTokenValidCallback(true) - } - } - } catch (error) { - // This is just a sanity check. We only fire FALSE (i.e. expired) if we know it's expired or password is wrong - isAuthTokenValidCallback(true) - } - } - - request(options, callback) -} - -module.exports = { - requestLogin, - requestLoginAuth, - isAuthTokenValid -} diff --git a/app-cli/utils/messageHandler.js b/app-cli/utils/messageHandler.js index 9ae72ec..f681a14 100644 --- a/app-cli/utils/messageHandler.js +++ b/app-cli/utils/messageHandler.js @@ -4,6 +4,12 @@ function printMessage(message) { console.log(message) } +function printMessageAndExit(message) { + console.log(message) + + process.exit(0) +} + function printGreenMessage(message) { console.log(`${chalk.green(message)}`) } @@ -18,9 +24,19 @@ function printErrorAndExit(error) { process.exit(0) } +function errorHandler(error) { + if (error.status) { + printErrorAndExit(`\nError: ${error.status}\nError: ${error.description}`) + } else { + printErrorAndExit(`\nError: ${error}`) + } +} + module.exports = { printMessage, + printMessageAndExit, printErrorAndExit, printError, - printGreenMessage + printGreenMessage, + errorHandler } diff --git a/app-cli/utils/validationsHandler.js b/app-cli/utils/validationsHandler.js index 032770f..90a984f 100644 --- a/app-cli/utils/validationsHandler.js +++ b/app-cli/utils/validationsHandler.js @@ -1,5 +1,5 @@ const fs = require("fs-extra") -const { printErrorAndExit } = require("./errorHandler") +const { printErrorAndExit } = require("./messageHandler") function validateIsGitRepository() { const gitFolderExists = fs.pathExistsSync("./.git") @@ -21,7 +21,20 @@ function validateDefinitionFile() { } } +function isIpAddress(ipaddress) { + if ( + /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test( + ipaddress + ) + ) { + return true + } + + return false +} + module.exports = { validateIsGitRepository, - validateDefinitionFile + validateDefinitionFile, + isIpAddress } From a8bbf2c216f65bb8567898adf60b5a1b6b97a126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Trevi=C3=B1o?= Date: Sun, 18 Nov 2018 12:46:58 +0100 Subject: [PATCH 09/44] Start refactor of deploy --- app-cli/api/DeployApi.js | 108 +++++ app-cli/captainduckduck.js | 25 +- app-cli/helpers/MachineHelper.js | 29 +- app-cli/lib/deploy.js | 602 ++++++++++------------------ app-cli/lib/login.js | 41 +- app-cli/lib/logout.js | 2 +- app-cli/lib/serversetup.js | 2 +- app-cli/package-lock.json | 274 ++++++------- app-cli/utils/constants.js | 12 +- app-cli/utils/fileHelper.js | 194 +++++++++ app-cli/utils/messageHandler.js | 5 + app-cli/utils/validationsHandler.js | 46 ++- 12 files changed, 786 insertions(+), 554 deletions(-) create mode 100644 app-cli/api/DeployApi.js create mode 100644 app-cli/utils/fileHelper.js diff --git a/app-cli/api/DeployApi.js b/app-cli/api/DeployApi.js new file mode 100644 index 0000000..4f60980 --- /dev/null +++ b/app-cli/api/DeployApi.js @@ -0,0 +1,108 @@ +const MainApi = require("./MainApi") +const MachineHelper = require("../helpers/MachineHelper") +const { + DEFAULT_BRANCH_TO_PUSH, + DEFAULT_APP_NAME +} = require("../utils/constants") + +class DeployApi { + constructor() { + this.machineToDeploy = {} + + this.branchToPush = DEFAULT_BRANCH_TO_PUSH + + this.appName = DEFAULT_APP_NAME + } + + setMachineToDeploy(machineToDeploy) { + let temp = [] + + // Look machine by host + if (machineToDeploy.startsWith("http")) { + temp = MachineHelper.machines.find( + machine => machine.baseUrl === machineToDeploy + ) + } else { + // Look machine by name + temp = MachineHelper.machines.find( + machine => machine.name === machineToDeploy + ) + } + + this.machineToDeploy = temp + } + + setBranchToPush(branchToPush) { + this.branchToPush = branchToPush + } + + setAppName(appName) { + this.appName = appName + } + + async fetchBuildLogs() { + try { + const { token, baseUrl } = this.machineToDeploy + const customOptions = { + headers: { + "x-captain-auth": token + } + } + const data = await MainApi.get( + `${baseUrl}/api/v1/user/appData/${this.appName}`, + customOptions + ) + + return data + } catch (e) { + throw e + } + } + + async sendFile(sourceFile, gitHash) { + try { + const { authToken, baseUrl } = this.machineToDeploy + const url = `${baseUrl}/api/v1/user/appData/${this.appName}/?detached=1` + const form = { + sourceFile, + gitHash + } + const options = { + headers: { + "x-captain-auth": authToken + } + } + const data = await MainApi.post(url, form, options) + + return data + } catch (e) { + throw e + } + } + + // This is not moved to LoginAPI since it's related only for machineToDeploy + async isAuthTokenValid() { + try { + const url = `${this.machineToDeploy.baseUrl}/api/v1/user/appDefinitions/` + const currentToken = this.machineToDeploy.authToken + const options = { + headers: { + "x-captain-auth": currentToken + } + } + const response = await MainApi.get(url, options) + const data = JSON.parse(response) + + // Tolken is not valid + if (data.status === 1106 || data.status === 1105) { + return false + } + + return true + } catch (e) { + throw e + } + } +} + +module.exports = new DeployApi() diff --git a/app-cli/captainduckduck.js b/app-cli/captainduckduck.js index f11c9f8..4d6e666 100755 --- a/app-cli/captainduckduck.js +++ b/app-cli/captainduckduck.js @@ -12,7 +12,7 @@ const serversetup = require("./lib/serversetup") const login = require("./lib/login") const logout = require("./lib/logout") const list = require("./lib/list") -// const deploy = require("./lib/deploy") +const deploy = require("./lib/deploy") // Setup program.version(packagejson.version).description(packagejson.description) @@ -43,6 +43,7 @@ program program .command("list") + .alias("ls") .description("List all Captain machines currently logged in.") .action(() => { list() @@ -53,8 +54,24 @@ program .description( "Deploy your app (current directory) to a specific Captain machine. You'll be prompted to choose your Captain machine." ) - .action(() => { - // deploy() + .option( + "-t, --tarFile ", + "Specify file to be uploaded (rather than using git archive)" + ) + .option("-d, --default", "Run with default options") + .option("-s, --stateless", "Run deploy stateless") + .option( + "-h, --host ", + "Only for stateless mode: Host of the captain machine" + ) + .option("-a, --appName ", "Only for stateless mode: Name of the app") + .option("-p, --pass ", "Only for stateless mode: Password for Captain") + .option( + "-b, --branch ", + "Only for stateless mode: Branch name (default master)" + ) + .action(options => { + deploy(options) }) // Error on unknown commands @@ -62,7 +79,7 @@ program.on("command:*", () => { const wrongCommands = program.args.join(" ") printErrorAndExit( - `\nInvalid command: ${wrongCommands}\nSee --help for a list of available commands.\n` + `\nInvalid command: ${wrongCommands}\nSee --help for a list of available commands.` ) }) diff --git a/app-cli/helpers/MachineHelper.js b/app-cli/helpers/MachineHelper.js index ccb0ff3..0c43cce 100644 --- a/app-cli/helpers/MachineHelper.js +++ b/app-cli/helpers/MachineHelper.js @@ -8,6 +8,8 @@ const configs = new configstore(packagejson.name, { class MachineHelper { constructor() { this.machines = configs.get("captainMachines") + + this.apps = configs.get("apps") } getMachinesAsOptions() { @@ -29,10 +31,31 @@ class MachineHelper { return [...firstItemInOption, ...listOfMachines] } - setMachines(machines) { - this.machines = machines + setMachines(newMachines) { + this.machines = newMachines - configs.set("captainMachines", machines) + configs.set("captainMachines", newMachines) + } + + updateMachineAuthToken(machineName, authToken) { + const newMachines = this.machines.map(machine => { + if (machine.name === machineName) { + return { + ...machine, + authToken + } + } + + return machine + }) + + this.setMachines(newMachines) + } + + setApps(newApps) { + this.apps = newApps + + configs.set("apps", newApps) } addMachine(newMachine) { diff --git a/app-cli/lib/deploy.js b/app-cli/lib/deploy.js index 7fba8be..c01e241 100644 --- a/app-cli/lib/deploy.js +++ b/app-cli/lib/deploy.js @@ -1,440 +1,242 @@ #!/usr/bin/env node -const program = require("commander") -const fs = require("fs-extra") -const path = require("path") -const chalk = require("chalk") -const inquirer = require("inquirer") -const configstore = require("configstore") -const request = require("request") -const commandExistsSync = require("command-exists").sync -const { exec } = require("child_process") -const { sendFileToCaptain } = require("./utils/fileHandler") +const MachineHelper = require("../helpers/MachineHelper") +const DeployApi = require("../api/DeployApi") const { - requestLogin, - requestLoginAuth, - isAuthTokenValid -} = require("./utils/loginHandler") + printErrorAndExit, + printError, + printMessage, + printGreenMessage, + printMagentaMessage +} = require("../utils/messageHandler") const { validateIsGitRepository, - validateDefinitionFile -} = require("./utils/validationsHandler") -const { printErrorAndExit } = require("./utils/errorHandler") -const packagejson = require("./package.json") -const configs = new configstore(packagejson.name, { - captainMachines: [], - apps: [] -}) -const BRANCH_TO_PUSH = "branchToPush" -const APP_NAME = "appName" + validateDefinitionFile, + isTarFileProvided, + optionIsGiven +} = require("../utils/validationsHandler") +const { requestLogin } = require("../lib/login") +const { getFileStream } = require("../utils/fileHelper") +const { gitArchiveFile } = require("../utils/fileHelper") +const fs = require("fs-extra") +const path = require("path") +const inquirer = require("inquirer") +const commandExistsSync = require("command-exists").sync const MACHINE_TO_DEPLOY = "machineToDeploy" -const EMPTY_STRING = "" - -console.log("\n") - -program - .description("Deploy current directory to a Captain machine.") - .option( - "-t, --tarFile ", - "Specify file to be uploaded (rather than using git archive)" - ) - .option("-d, --default", "Run with default options") - .option("-s, --stateless", "Run deploy stateless") - .option( - "-h, --host ", - "Only for stateless mode: Host of the captain machine" - ) - .option("-a, --appName ", "Only for stateless mode: Name of the app") - .option("-p, --pass ", "Only for stateless mode: Password for Captain") - .option( - "-b, --branch ", - "Only for stateless mode: Branch name (default master)" - ) - .parse(process.argv) - -if (program.args.length) { - console.error(chalk.red("Unrecognized commands:")) - program.args.forEach(function(arg) { - console.log(chalk.red(arg)) - }) - console.error(chalk.red("Deploy does not require any options. ")) - process.exit(1) -} - -function getSuppliedTarFile() { - return program.tarFile -} - -if (!getSuppliedTarFile()) { - validateIsGitRepository() - - validateDefinitionFile() - - const contents = fs.readFileSync("./captain-definition", "utf8") - let contentsJson = null - - try { - contentsJson = JSON.parse(contents) - } catch (e) { - console.log(e) - console.log("") - printErrorAndExit( - "**** ERROR: captain-definition file is not a valid JSON! ****" - ) - } - - if (!contentsJson.schemaVersion) { - printErrorAndExit( - "**** ERROR: captain-definition needs schemaVersion. Please see docs! ****" - ) - } - - if (!contentsJson.templateId && !contentsJson.dockerfileLines) { - printErrorAndExit( - "**** ERROR: captain-definition needs templateId or dockerfileLines. Please see docs! ****" - ) - } - - if (contentsJson.templateId && contentsJson.dockerfileLines) { - printErrorAndExit( - "**** ERROR: captain-definition needs templateId or dockerfileLines, NOT BOTH! Please see docs! ****" - ) - } -} - -let listOfMachines = [ - { - name: "-- CANCEL --", - value: EMPTY_STRING, - short: EMPTY_STRING - } -] - -let machines = configs.get("captainMachines") -for (let i = 0; i < machines.length; i++) { - let m = machines[i] - listOfMachines.push({ - name: m.name + " at " + m.baseUrl, - value: m.name, - short: m.name + " at " + m.baseUrl - }) -} +const { + EMPTY_STRING, + DEFAULT_BRANCH_TO_PUSH, + DEFAULT_APP_NAME +} = require("../utils/constants") // Gets default value for propType that is stored in a directory. // Replaces getAppForDirectory +// Check if the command is running inside the directory of an existing app function getPropForDirectory(propType) { - let apps = configs.get("apps") + const appDirectory = MachineHelper.apps + .map(app => { + if (app.cmd === process.cwd()) { + return app[propType] + } + }) + .filter(Boolean) + + return appDirectory.length ? appDirectory : undefined +} + +// Sets default value for propType that is stored in a directory to propValue. +// Replaces saveAppForDirectory +// Saves the app directory into local storage +function savePropForDirectory(propType, propValue) { + const apps = MachineHelper.apps + for (let i = 0; i < apps.length; i++) { - let app = apps[i] + const app = apps[i] + if (app.cwd === process.cwd()) { - return app[propType] + app[propType] = propValue + + MachineHelper.setApps(apps) + + return } } - return undefined + + const newApp = { + cwd: process.cwd(), + [propType]: propValue + } + + apps.push(newApp) + + MachineHelper.setApps(apps) } function getDefaultMachine() { - let machine = getPropForDirectory(MACHINE_TO_DEPLOY) - if (machine) { - return machine.name - } - if (listOfMachines.length == 2) { - return 1 - } + const machine = getPropForDirectory(MACHINE_TO_DEPLOY) + + if (machine) return machine.name + + if (MachineHelper.machines.length == 2) return 1 + return EMPTY_STRING } -console.log("Preparing deployment to Captain...\n") +function deploy(options) { + if (!isTarFileProvided(options.tarFile)) { + validateIsGitRepository() -const questions = [ - { - type: "list", - name: "captainNameToDeploy", - default: getDefaultMachine(), - message: "Select the Captain Machine you want to deploy to:", - choices: listOfMachines - }, - { - type: "input", - default: getPropForDirectory(BRANCH_TO_PUSH) || "master", - name: BRANCH_TO_PUSH, - message: "Enter the 'git' branch you would like to deploy:", - when: function(answers) { - return !!answers.captainNameToDeploy - } - }, - { - type: "input", - default: getPropForDirectory(APP_NAME), - name: APP_NAME, - message: "Enter the Captain app name this directory will be deployed to:", - when: function(answers) { - return !!answers.captainNameToDeploy - } - }, - { - type: "confirm", - name: "confirmedToDeploy", - message: - "Note that uncommitted files and files in gitignore (if any) will not be pushed to server. Please confirm so that deployment process can start.", - default: true, - when: function(answers) { - return !!answers.captainNameToDeploy - } - } -] - -let defaultInvalid = false - -if (program.default) { - if ( - !getDefaultMachine() || - !getPropForDirectory(BRANCH_TO_PUSH) || - !getPropForDirectory(APP_NAME) - ) { - console.log("Default deploy failed. Please select deploy options.") - defaultInvalid = true - } else { - console.log("Deploying to " + getPropForDirectory(MACHINE_TO_DEPLOY).name) - deployTo( - getPropForDirectory(MACHINE_TO_DEPLOY), - getPropForDirectory(BRANCH_TO_PUSH), - getPropForDirectory(APP_NAME) - ) - } -} - -const isStateless = - program.stateless && program.host && program.appName && program.pass - -if (isStateless) { - // login first - console.log("Trying to login to", program.host) - requestLoginAuth(program.host, program.pass, function(authToken) { - // deploy - console.log( - "Starting stateless deploy to", - program.host, - program.branch, - program.appName - ) - deployTo( - { - baseUrl: program.host, - authToken - }, - program.branch || "master", - program.appName - ) - }) -} else if (!program.default || defaultInvalid) { - inquirer.prompt(questions).then(function(answers) { - console.log(" ") - console.log(" ") - - if (!answers.confirmedToDeploy) { - console.log("Operation cancelled by the user...") - console.log(" ") - } else { - let machines = configs.get("captainMachines") - let machineToDeploy = null - for (let i = 0; i < machines.length; i++) { - if (machines[i].name === answers.captainNameToDeploy) { - console.log("Deploying to " + answers.captainNameToDeploy) - machineToDeploy = machines[i] - break - } - } - - console.log(" ") - deployTo(machineToDeploy, answers.branchToPush, answers.appName) - } - }) -} - -function deployTo(machineToDeploy, branchToPush, appName) { - function checkAuthAndSendFile(zipFileFullPath, gitHash) { - function isAuthTokenValidCallback(isValid) { - if (isValid) { - sendFileToCaptain( - machineToDeploy, - zipFileFullPath, - appName, - gitHash, - branchToPush - ) - } else { - requestLogin( - machineToDeploy.name, - machineToDeploy.baseUrl, - function callback(machineToDeployNew) { - deployTo(machineToDeployNew, branchToPush, appName) - } - ) - } - } - - isAuthTokenValid(machineToDeploy, appName, isAuthTokenValidCallback) + validateDefinitionFile() } - if (getSuppliedTarFile()) { - checkAuthAndSendFile( - path.join(process.cwd(), getSuppliedTarFile()), - "sendviatarfile" - ) - return - } + console.log("Preparing deployment to Captain...\n") - if (!commandExistsSync("git")) { - console.log(chalk.red('"git" command not found...')) - console.log( - chalk.red( - 'Captain needs "git" to create tar file of your source files...' - ) - ) - console.log(" ") - process.exit(1) - } - - let zipFileNameToDeploy = "temporary-captain-to-deploy.tar" - let zipFileFullPath = path.join(process.cwd(), zipFileNameToDeploy) - - console.log("Saving tar file to:") - console.log(zipFileFullPath) - console.log(" ") - - try { - fs.removeSync(zipFileFullPath) - } catch (ignoreError) {} - - exec( - 'git archive --format tar --output "' + - zipFileFullPath + - '" ' + - branchToPush, - function(err, stdout, stderr) { - if (err) { - console.log(chalk.red("TAR file failed")) - console.log(chalk.red(err + " ")) - console.log(" ") - fs.removeSync(zipFileFullPath) - return - } - - exec("git rev-parse " + branchToPush, function(err, stdout, stderr) { - const gitHash = (stdout || "").trim() - - if (err || !/^[a-f0-9]{40}$/.test(gitHash)) { - console.log( - chalk.red( - "Cannot find hash of last commit on this branch: " + branchToPush - ) - ) - console.log(chalk.red(gitHash + " ")) - console.log(chalk.red(err + " ")) - console.log(" ") - return - } - - console.log("Pushing last commit on " + branchToPush + ": " + gitHash) - - checkAuthAndSendFile(zipFileFullPath, gitHash) - }) - } - ) -} - -var lastLineNumberPrinted = -10000 // we want to show all lines to begin with! - -function startFetchingBuildLogs(machineToDeploy, appName) { - let options = { - url: machineToDeploy.baseUrl + "/api/v1/user/appData/" + appName, - headers: { - "x-namespace": "captain", - "x-captain-auth": machineToDeploy.authToken + const questions = [ + { + type: "list", + name: "captainNameToDeploy", + default: getDefaultMachine(), + message: "Select the Captain Machine you want to deploy to:", + choices: MachineHelper.getMachinesAsOptions(), + when: () => optionIsGiven(options, "host") }, - method: "GET" + { + type: "input", + default: getPropForDirectory(DEFAULT_BRANCH_TO_PUSH) || "master", + name: "branchToPush", + message: "Enter the 'git' branch you would like to deploy:", + when: () => optionIsGiven(options, "branch") + }, + { + type: "input", + default: getPropForDirectory(DEFAULT_APP_NAME), + name: "appName", + message: "Enter the Captain app name this directory will be deployed to:", + when: () => optionIsGiven(options, "appName") + }, + { + type: "confirm", + name: "confirmedToDeploy", + message: + "Note that uncommitted files and files in gitignore (if any) will not be pushed to server. Please confirm so that deployment process can start.", + default: true, + when: () => optionIsGiven(options, "stateless") + } + ] + // TODO - Refactor + let defaultInvalid = false + + if (options.default) { + if ( + !getDefaultMachine() || + !getPropForDirectory(options.branch || DEFAULT_BRANCH_TO_PUSH) || + !getPropForDirectory(DEFAULT_APP_NAME) + ) { + printError("Default deploy failed. Please select deploy options.") + + defaultInvalid = true + } else { + printMessage( + `Deploying to ${getPropForDirectory(MACHINE_TO_DEPLOY).name}` + ) + + deployTo( + getPropForDirectory(MACHINE_TO_DEPLOY), + getPropForDirectory(DEFAULT_BRANCH_TO_PUSH), + getPropForDirectory(DEFAULT_APP_NAME) + ) + } } - function onLogRetrieved(data) { - if (data) { - var lines = data.logs.lines - var firstLineNumberOfLogs = data.logs.firstLineNumber - var firstLinesToPrint = 0 - if (firstLineNumberOfLogs > lastLineNumberPrinted) { - if (firstLineNumberOfLogs < 0) { - // This is the very first fetch, probably firstLineNumberOfLogs is around -50 - firstLinesToPrint = -firstLineNumberOfLogs - } else { - console.log("[[ TRUNCATED ]]") - } - } else { - firstLinesToPrint = lastLineNumberPrinted - firstLineNumberOfLogs + // TODO - Refactor + const isStateless = + options.stateless && options.host && options.appName && options.pass + + if (isStateless) { + // login first + printMessage(`Trying to login to ${options.host}\n`) + + printMessage( + `Starting stateless deploy to\n${options.host}\n${options.branch}\n${ + options.appName + }` + ) + + deployTo() + } else if (!options.default || defaultInvalid) { + inquirer.prompt(questions).then(answers => { + if (!answers.confirmedToDeploy) { + printMessage("\nOperation cancelled by the user...\n") + + process.exit(0) } - lastLineNumberPrinted = firstLineNumberOfLogs + lines.length + const captainNameToDeploy = answers.captainNameToDeploy + const branchToPush = answers.branchToPush || options.branch + const appName = answers.appName || options.appName - for (var i = firstLinesToPrint; i < lines.length; i++) { - console.log((lines[i] || "").trim()) - } + DeployApi.setMachineToDeploy(captainNameToDeploy || options.host) + + DeployApi.setBranchToPush(branchToPush) + + DeployApi.setAppName(appName) + + printMessage(`Deploying to ${DeployApi.machineToDeploy.name}`) + + deployTo() + }) + } + + async function deployTo() { + // 1. Check if valid auth + const isAuthenticated = await DeployApi.isAuthTokenValid() + + // 2. Request login + // 3. Login + // 4. Update token + if (!isAuthenticated) { + requestLogin() } - if (data && !data.isAppBuilding) { - console.log(" ") - if (!data.isBuildFailed) { - console.log(chalk.green("Deployed successfully: ") + appName) - console.log( - chalk.magenta("App is available at ") + - machineToDeploy.baseUrl - .replace("//captain.", "//" + appName + ".") - .replace("https://", "http://") - ) - } else { - console.error( - chalk.red( - '\nSomething bad happened. Cannot deploy "' + appName + '"\n' - ) - ) - } - console.log(" ") + // Send from tar file + if (isTarFileProvided(options.tarFile)) { + const filePath = options.tarFile + const fileStream = getFileStream(filePath) + const gitHash = "sendviatarfile" + + printMessage(`Uploading file to ${DeployApi.machineToDeploy.baseUrl}`) + + const response = await DeployApi.sendFile(fileStream, gitHash) + // const data = JSON.parse(response) + + console.log(response) + return } - setTimeout(function() { - startFetchingBuildLogs(machineToDeploy, appName) - }, 2000) - } + // TODO - Deploy from git folder - function callback(error, response, body) { - try { - if (!error && response.statusCode === 200) { - let data = JSON.parse(body) + if (!commandExistsSync("git")) { + printError("'git' command not found...") - if (data.status !== 100) { - throw new Error(JSON.stringify(data, null, 2)) - } - - onLogRetrieved(data.data) - - return - } - - if (error) { - throw new Error(error) - } - - throw new Error( - response ? JSON.stringify(response, null, 2) : "Response NULL" + printErrorAndExit( + "Captain needs 'git' to create tar file of your source files..." ) - } catch (error) { - console.error( - chalk.red( - '\nSomething while retrieving app build logs.. "' + error + '"\n' - ) - ) - - onLogRetrieved(null) } - } - request(options, callback) + const zipFileNameToDeploy = "temporary-captain-to-deploy.tar" + const zipFileFullPath = path.join(process.cwd(), zipFileNameToDeploy) + + printMessage(`Saving tar file to:\n${zipFileFullPath}\n`) + + // Removes the temporarly file created + try { + fs.removeSync(zipFileFullPath) + } catch (e) { + // IgnoreError + } + + gitArchiveFile(zipFileFullPath, MachineHelper.branchToPush) + } } + +module.exports = deploy diff --git a/app-cli/lib/login.js b/app-cli/lib/login.js index b388bcc..d77abc2 100644 --- a/app-cli/lib/login.js +++ b/app-cli/lib/login.js @@ -1,11 +1,46 @@ const MachineHelper = require("../helpers/MachineHelper") -const { printGreenMessage, printError } = require("../utils/messageHandler") +const { + printMessage, + printGreenMessage, + printError +} = require("../utils/messageHandler") const inquirer = require("inquirer") const { cleanUpUrl, findDefaultCaptainName } = require("../utils/loginHelpers") -const { printMessage } = require("../utils/messageHandler") const { SAMPLE_DOMAIN } = require("../utils/constants") const LoginApi = require("../api/LoginApi") +// In case the token is expired +function requestLogin() { + const { baseUrl, name } = this.machineToDeploy + + printMessage("Your auth token is not valid anymore. Try to login again.") + + const questions = [ + { + type: "password", + name: "captainPassword", + message: "Please enter your password for " + baseUrl, + validate: function(value) { + if (value && value.trim()) { + return true + } + + return "Please enter your password for " + baseUrl + } + } + ] + + inquirer.prompt(questions).then(async passwordAnswers => { + const password = passwordAnswers.captainPassword + const response = await LoginApi.loginMachine(baseUrl, password) + const data = JSON.parse(response) + const newToken = data.token + + // Update the token to the machine that corresponds + MachineHelper.updateMachineAuthToken(name, newToken) + }) +} + function login() { printMessage("Login to a Captain Machine") @@ -118,3 +153,5 @@ function login() { } module.exports = login + +module.exports = requestLogin diff --git a/app-cli/lib/logout.js b/app-cli/lib/logout.js index 2eb7e46..4e52b31 100644 --- a/app-cli/lib/logout.js +++ b/app-cli/lib/logout.js @@ -17,7 +17,7 @@ function generateQuestions() { name: "confirmedToLogout", message: "Are you sure you want to logout from this Captain machine?", default: false, - when: answers => !!answers.captainNameToLogout + when: answers => answers.captainNameToLogout } ] } diff --git a/app-cli/lib/serversetup.js b/app-cli/lib/serversetup.js index ceb1899..458fce5 100644 --- a/app-cli/lib/serversetup.js +++ b/app-cli/lib/serversetup.js @@ -19,7 +19,7 @@ const questions = [ name: "hasInstalledCaptain", message: "Have you already installed Captain on your server by running the following line:" + - "\nmkdir /captain && docker run -v /var/run/docker.sock:/var/run/docker.sock dockersaturn/captainduckduck ?", + "\nmkdir /captain && docker run -p 80:80 -p 443:443 -p 3000:3000 -v /var/run/docker.sock:/var/run/docker.sock dockersaturn/captainduckduck ?", default: "Yes", choices: ["Yes", "No"], filter: value => { diff --git a/app-cli/package-lock.json b/app-cli/package-lock.json index dedc22c..4a96618 100644 --- a/app-cli/package-lock.json +++ b/app-cli/package-lock.json @@ -25,9 +25,9 @@ } }, "acorn": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.2.tgz", - "integrity": "sha512-GXmKIvbrN3TV7aVqAzVFaMW8F8wzVX7voEBRO3bDA64+EX37YSayggRJP5Xig6HYHBkWKpFg9W5gg6orklubhg==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.3.tgz", + "integrity": "sha512-xEnlTS2J0PKuub0pd2Y4W58iEo1sfRZ3h23E8AKmlnV8Nc6E/syRdVeo0DMuLSrgRJZHnFeDou2llXfB+wb1/A==", "dev": true }, "acorn-jsx": { @@ -104,9 +104,12 @@ "dev": true }, "asn1": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", - "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "requires": { + "safer-buffer": "~2.1.0" + } }, "assert-plus": { "version": "1.0.0", @@ -124,9 +127,9 @@ "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" }, "aws4": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", - "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==" + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" }, "balanced-match": { "version": "1.0.0", @@ -135,10 +138,9 @@ "dev": true }, "bcrypt-pbkdf": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", - "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", - "optional": true, + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "requires": { "tweetnacl": "^0.14.3" } @@ -193,9 +195,9 @@ "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" }, "capture-stack-trace": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz", - "integrity": "sha1-Sm+gc5nCa7pH8LJJa00PtAjFVQ0=" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz", + "integrity": "sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw==" }, "caseless": { "version": "0.12.0", @@ -218,9 +220,9 @@ "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=" }, "ci-info": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.1.3.tgz", - "integrity": "sha512-SK/846h/Rcy8q9Z9CAwGBLfCJ6EkjJWdpelWDufQpqVDYq2Wnnv8zlSO6AMQap02jvhVruKKpEtQOufo3pFhLg==" + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz", + "integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==" }, "circular-json": { "version": "0.3.3", @@ -257,11 +259,11 @@ "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" }, "color-convert": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", - "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "requires": { - "color-name": "^1.1.1" + "color-name": "1.1.3" } }, "color-name": { @@ -270,22 +272,22 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "combined-stream": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", + "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", "requires": { "delayed-stream": "~1.0.0" } }, "command-exists": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.6.tgz", - "integrity": "sha512-Qst/zUUNmS/z3WziPxyqjrcz09pm+2Knbs5mAZL4VAE0sSrNY1/w8+/YxeHcoBTsO6iojA6BW7eFf27Eg2MRuw==" + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.8.tgz", + "integrity": "sha512-PM54PkseWbiiD/mMsbvW351/u+dafwTJ0ye2qB60G1aGQP9j3xK2gmMDc+R34L3nDtx4qMCitXT75mkbkGJDLw==" }, "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==" + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", + "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==" }, "concat-map": { "version": "0.0.1", @@ -413,12 +415,12 @@ "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" }, "ecc-jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", - "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", - "optional": true, + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", "requires": { - "jsbn": "~0.1.0" + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" } }, "escape-string-regexp": { @@ -473,9 +475,9 @@ }, "dependencies": { "ajv": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.4.tgz", - "integrity": "sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg==", + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.5.tgz", + "integrity": "sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1", @@ -520,15 +522,6 @@ "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", "dev": true }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, "inquirer": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.0.tgz", @@ -555,19 +548,13 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true - }, - "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", - "dev": true } } }, "eslint-plugin-jest": { - "version": "21.26.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-21.26.2.tgz", - "integrity": "sha512-SCTBC6q182D4qQlQAN81D351jdte/YwTMo4f+l19Gvh1VemaNZP7ak3MLLvw6xkL9dO2FxVjCLk5DCdl1KfdLw==", + "version": "21.27.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-21.27.1.tgz", + "integrity": "sha512-K+S4Wa20MoRRXICfnQBqjl2g9+ipJBeDUVrB3Csg4wOrxXMGcNxYuPRaiyA0pqmb/vO2cgaLEzurORfsLrztxg==", "dev": true }, "eslint-scope": { @@ -654,13 +641,13 @@ } }, "extend": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", - "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, "external-editor": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", + "resolved": "http://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", "requires": { "chardet": "^0.4.0", @@ -675,7 +662,7 @@ }, "fast-deep-equal": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "resolved": "http://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" }, "fast-json-stable-stringify": { @@ -758,7 +745,7 @@ }, "get-stream": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" }, "getpass": { @@ -821,7 +808,7 @@ }, "got": { "version": "6.7.1", - "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", + "resolved": "http://registry.npmjs.org/got/-/got-6.7.1.tgz", "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", "requires": { "create-error-class": "^3.0.0", @@ -838,9 +825,9 @@ } }, "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==" }, "har-schema": { "version": "2.0.0", @@ -848,11 +835,11 @@ "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" }, "har-validator": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", - "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", + "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", "requires": { - "ajv": "^5.1.0", + "ajv": "^5.3.0", "har-schema": "^2.0.0" } }, @@ -872,9 +859,9 @@ } }, "iconv-lite": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", - "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "requires": { "safer-buffer": ">= 2.1.2 < 3" } @@ -938,11 +925,11 @@ } }, "is-ci": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.1.0.tgz", - "integrity": "sha512-c7TnwxLePuqIlxHgr7xtxzycJPegNHFuIrBkwbf8hc58//+Op1CqFkyS+xnIMkwn9UsJIwc174BIjkyBmSpjKg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", + "integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==", "requires": { - "ci-info": "^1.0.0" + "ci-info": "^1.5.0" } }, "is-fullwidth-code-point": { @@ -966,7 +953,7 @@ }, "is-obj": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" }, "is-path-cwd": { @@ -1052,8 +1039,7 @@ "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "optional": true + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" }, "json-schema": { "version": "0.2.3", @@ -1114,9 +1100,9 @@ } }, "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" }, "log-symbols": { "version": "2.2.0", @@ -1149,16 +1135,16 @@ } }, "mime-db": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", - "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==" + "version": "1.37.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", + "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==" }, "mime-types": { - "version": "2.1.18", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", - "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "version": "2.1.21", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", + "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", "requires": { - "mime-db": "~1.33.0" + "mime-db": "~1.37.0" } }, "mimic-fn": { @@ -1177,7 +1163,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" }, "mkdirp": { @@ -1229,9 +1215,9 @@ } }, "oauth-sign": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" }, "object-assign": { "version": "4.1.1", @@ -1367,15 +1353,20 @@ "dev": true }, "progress": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", - "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.1.tgz", + "integrity": "sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg==" }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" }, + "psl": { + "version": "1.1.29", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", + "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==" + }, "punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", @@ -1421,30 +1412,30 @@ } }, "request": { - "version": "2.87.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz", - "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==", + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", "requires": { "aws-sign2": "~0.7.0", - "aws4": "^1.6.0", + "aws4": "^1.8.0", "caseless": "~0.12.0", - "combined-stream": "~1.0.5", - "extend": "~3.0.1", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", "forever-agent": "~0.6.1", - "form-data": "~2.3.1", - "har-validator": "~5.0.3", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", "http-signature": "~1.2.0", "is-typedarray": "~1.0.0", "isstream": "~0.1.2", "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.17", - "oauth-sign": "~0.8.2", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", "performance-now": "^2.1.0", - "qs": "~6.5.1", - "safe-buffer": "^5.1.1", - "tough-cookie": "~2.3.3", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", "tunnel-agent": "^0.6.0", - "uuid": "^3.1.0" + "uuid": "^3.3.2" } }, "request-promise": { @@ -1541,9 +1532,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==" + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" }, "semver-diff": { "version": "2.1.0", @@ -1587,9 +1578,9 @@ "dev": true }, "sshpk": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz", - "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=", + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.15.2.tgz", + "integrity": "sha512-Ra/OXQtuh0/enyl4ETZAfTaeksa6BXks5ZcjpSUNrjBr0DvrJKX+1fsKDPpT9TBXgHAFsa4510aNVgI8g/+SzA==", "requires": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -1598,6 +1589,7 @@ "ecc-jsbn": "~0.1.1", "getpass": "^0.1.1", "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", "tweetnacl": "~0.14.0" } }, @@ -1625,7 +1617,7 @@ }, "strip-eof": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" }, "strip-json-comments": { @@ -1634,9 +1626,9 @@ "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" }, "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "requires": { "has-flag": "^3.0.0" } @@ -1654,9 +1646,9 @@ }, "dependencies": { "ajv": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.4.tgz", - "integrity": "sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg==", + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.5.tgz", + "integrity": "sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1", @@ -1695,7 +1687,7 @@ }, "through": { "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" }, "timed-out": { @@ -1712,10 +1704,11 @@ } }, "tough-cookie": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", - "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", "requires": { + "psl": "^1.1.24", "punycode": "^1.4.1" } }, @@ -1736,8 +1729,7 @@ "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "optional": true + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" }, "type-check": { "version": "0.3.2", @@ -1757,9 +1749,9 @@ } }, "universalify": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz", - "integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc=" + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" }, "unzip-response": { "version": "2.0.1", @@ -1809,9 +1801,9 @@ } }, "uuid": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", - "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" }, "verror": { "version": "1.10.0", @@ -1832,9 +1824,9 @@ } }, "widest-line": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.0.tgz", - "integrity": "sha1-AUKk6KJD+IgsAjOqDgKBqnYVInM=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", + "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", "requires": { "string-width": "^2.1.1" } diff --git a/app-cli/utils/constants.js b/app-cli/utils/constants.js index 5862009..c0b944b 100644 --- a/app-cli/utils/constants.js +++ b/app-cli/utils/constants.js @@ -1,5 +1,15 @@ const SAMPLE_DOMAIN = "captain.captainroot.yourdomain.com" const SAMPLE_IP = "123.123.123.123" const DEFAULT_PASSWORD = "captain42" +const DEFAULT_BRANCH_TO_PUSH = "branchToPush" +const DEFAULT_APP_NAME = "appName" +const EMPTY_STRING = "" -module.exports = { SAMPLE_DOMAIN, SAMPLE_IP, DEFAULT_PASSWORD } +module.exports = { + SAMPLE_DOMAIN, + SAMPLE_IP, + DEFAULT_PASSWORD, + DEFAULT_BRANCH_TO_PUSH, + DEFAULT_APP_NAME, + EMPTY_STRING +} diff --git a/app-cli/utils/fileHelper.js b/app-cli/utils/fileHelper.js new file mode 100644 index 0000000..567f7ff --- /dev/null +++ b/app-cli/utils/fileHelper.js @@ -0,0 +1,194 @@ +const fs = require("fs-extra") +const { + printMessage, + printError, + printGreenMessage, + printMagentaMessage +} = require("./messageHandler") +const { exec } = require("child_process") +const ProgressBar = require("progress") +const ora = require("ora") +const DeployApi = require("../api/DeployApi") +let lastLineNumberPrinted = -10000 // we want to show all lines to begin with! + +function gitArchiveFile(zipFileFullPath, branchToPush) { + exec( + `git archive --format tar --output "${zipFileFullPath}" ${branchToPush}`, + (err, stdout, stderr) => { + if (err) { + printError(`TAR file failed\n${err}\n`) + + fs.removeSync(zipFileFullPath) + + return + } + + exec(`git rev-parse ${branchToPush}`, (err, stdout, stderr) => { + const gitHash = (stdout || "").trim() + + if (err || !/^[a-f0-9]{40}$/.test(gitHash)) { + printError( + `Cannot find hash of last commit on this branch: ${branchToPush}\n${gitHash}\n${err}\n` + ) + + return + } + + printMessage(`Pushing last commit on ${branchToPush}: ${gitHash}`) + + // checkAuthAndSendFile(zipFileFullPath, gitHash) + }) + } + ) +} + +function onLogRetrieved(data) { + if (data) { + const lines = data.logs.lines + const firstLineNumberOfLogs = data.logs.firstLineNumber + let firstLinesToPrint = 0 + + if (firstLineNumberOfLogs > lastLineNumberPrinted) { + if (firstLineNumberOfLogs < 0) { + // This is the very first fetch, probably firstLineNumberOfLogs is around -50 + firstLinesToPrint = -firstLineNumberOfLogs + } else { + printMessage("[[ TRUNCATED ]]") + } + } else { + firstLinesToPrint = lastLineNumberPrinted - firstLineNumberOfLogs + } + + lastLineNumberPrinted = firstLineNumberOfLogs + lines.length + + for (var i = firstLinesToPrint; i < lines.length; i++) { + printMessage((lines[i] || "").trim()) + } + } + + const { baseUrl, appName } = DeployApi.machineToDeploy + + if (data && !data.isAppBuilding) { + if (!data.isBuildFailed) { + const machineBaseUrl = baseUrl + .replace("//captain.", "//" + appName + ".") + .replace("https://", "http://") + + printGreenMessage(`Deployed successfully: ${appName}`) + + printMagentaMessage(`App is available at ${machineBaseUrl}\n`) + } else { + printError(`\nSomething bad happened. Cannot deploy "${appName}"\n`) + } + + return + } + + setTimeout(() => { + startFetchingBuildLogs() + }, 2000) +} + +async function startFetchingBuildLogs() { + try { + const data = await DeployApi.fetchBuildLogs() + const response = JSON.parse(data) + + if (response.status !== 100) { + throw new Error(JSON.stringify(response, null, 2)) + } + + onLogRetrieved(data.data) + } catch (error) { + printError(`\nSomething while retrieving app build logs.. ${error}\n`) + + // onLogRetrieved() // TODO - should this be here? + } +} + +function getFileStream(zipFileFullPath) { + const fileSize = fs.statSync(zipFileFullPath).size + const fileStream = fs.createReadStream(zipFileFullPath) + const barOpts = { + width: 20, + total: fileSize, + clear: true + } + const bar = new ProgressBar( + " uploading [:bar] :percent (ETA :etas)", + barOpts + ) + + fileStream.on("data", chunk => { + bar.tick(chunk.length) + }) + + let spinner + + fileStream.on("end", () => { + printMessage("This might take several minutes. PLEASE BE PATIENT...") + + // spinner = ora("Building your source code...").start() + + // spinner.color = "yellow" + }) + + return fileStream +} + +async function sendFileToCaptain(fileStream, gitHash) { + printMessage(`Uploading file to ${DeployApi.machineToDeploy.baseUrl}`) + + // try { + const response = await DeployApi.sendFile(fileStream, gitHash) + const data = JSON.parse(response) + + // Uncomment this to remove the file + // if (fs.pathExistsSync(zipFileFullPath)) { + // if (!isTarFileProvided()) { + // fs.removeSync(zipFileFullPath) + // } + // } + + if (data.status === 1106) { + // // expired token + + printMessage("Expired token") + // requestLogin( + // DeployApi.machineToDeploy.name, + // DeployApi.machineToDeploy.baseUrl, + // function callback(machineToDeployNew) { + // deployTo() + // } + // ) + + return + } + + // if (data.status !== 100 && data.status !== 101) { + // throw new Error(JSON.stringify(data, null, 2)) + // } + + // savePropForDirectory(DEFAULT_APP_NAME, DeployApi.appName) + + // savePropForDirectory(DEFAULT_BRANCH_TO_PUSH, DeployApi.branchToPush) + + // savePropForDirectory(MACHINE_TO_DEPLOY, DeployApi.machineToDeploy) + + // if (data.status === 100) { + // printGreenMessage(`Deployed successfully: ${DeployApi.appName}\n`) + // } else if (data.status === 101) { + // printGreenMessage(`Building started: ${DeployApi.appName}\n`) + + // startFetchingBuildLogs() + // } + // } catch (e) { + // printError( + // `\nSomething bad happened. Cannot deploy "${DeployApi.appName}"\n` + // ) + + // errorHandler(e) + // } +} + +module.exports = { gitArchiveFile, sendFileToCaptain, getFileStream } diff --git a/app-cli/utils/messageHandler.js b/app-cli/utils/messageHandler.js index f681a14..fabe73a 100644 --- a/app-cli/utils/messageHandler.js +++ b/app-cli/utils/messageHandler.js @@ -14,6 +14,10 @@ function printGreenMessage(message) { console.log(`${chalk.green(message)}`) } +function printMagentaMessage(message) { + console.log(`${chalk.magenta(message)}`) +} + function printError(error) { console.log(`${chalk.bold.red(error)}`) } @@ -38,5 +42,6 @@ module.exports = { printErrorAndExit, printError, printGreenMessage, + printMagentaMessage, errorHandler } diff --git a/app-cli/utils/validationsHandler.js b/app-cli/utils/validationsHandler.js index 90a984f..d05c58d 100644 --- a/app-cli/utils/validationsHandler.js +++ b/app-cli/utils/validationsHandler.js @@ -19,6 +19,48 @@ function validateDefinitionFile() { "\n**** ERROR: captain-definition file cannot be found. Please see docs! ****\n" ) } + + const contents = fs.readFileSync("./captain-definition", "utf8") + let contentsJson = null + + try { + contentsJson = JSON.parse(contents) + } catch (e) { + printErrorAndExit( + `**** ERROR: captain-definition file is not a valid JSON! ****\n Error:${e}` + ) + } + + if (!contentsJson.schemaVersion) { + printErrorAndExit( + "**** ERROR: captain-definition needs schemaVersion. Please see docs! ****" + ) + } + + if (!contentsJson.templateId && !contentsJson.dockerfileLines) { + printErrorAndExit( + "**** ERROR: captain-definition needs templateId or dockerfileLines. Please see docs! ****" + ) + } + + if (contentsJson.templateId && contentsJson.dockerfileLines) { + printErrorAndExit( + "**** ERROR: captain-definition needs templateId or dockerfileLines, NOT BOTH! Please see docs! ****" + ) + } +} + +function isTarFileProvided(tarFilePath) { + return tarFilePath +} + +// Only show that question if there is no option given as argument +function optionIsGiven(allOptions, option) { + if (allOptions[option]) { + return false + } + + return true } function isIpAddress(ipaddress) { @@ -36,5 +78,7 @@ function isIpAddress(ipaddress) { module.exports = { validateIsGitRepository, validateDefinitionFile, - isIpAddress + isIpAddress, + isTarFileProvided, + optionIsGiven } From 0b31e30846155a7322786f0f014f2e3c588511f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Trevi=C3=B1o?= Date: Sun, 18 Nov 2018 19:33:30 +0100 Subject: [PATCH 10/44] Add post with file to MainApi --- app-cli/api/DeployApi.js | 2 +- app-cli/api/MainApi.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app-cli/api/DeployApi.js b/app-cli/api/DeployApi.js index 4f60980..3ba2821 100644 --- a/app-cli/api/DeployApi.js +++ b/app-cli/api/DeployApi.js @@ -72,7 +72,7 @@ class DeployApi { "x-captain-auth": authToken } } - const data = await MainApi.post(url, form, options) + const data = await MainApi.postWithFile(url, form, options) return data } catch (e) { diff --git a/app-cli/api/MainApi.js b/app-cli/api/MainApi.js index d60f8fe..7cacc75 100644 --- a/app-cli/api/MainApi.js +++ b/app-cli/api/MainApi.js @@ -46,6 +46,18 @@ class MainApi { return Request(optionsToSend) } + postWithFile(url, formData, options) { + const overrideOptions = this._buildOptions(options) + const optionsToSend = { + ...overrideOptions, + url, + method: "POST", + formData + } + + return Request(optionsToSend) + } + put(url, form, options) { const overrideOptions = this._buildOptions(options) const optionsToSend = { From 395971c378e32c5e31e7afc5f76433a47b17f180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Trevi=C3=B1o?= Date: Sun, 18 Nov 2018 22:16:04 +0100 Subject: [PATCH 11/44] Fix deploy with logs and refactor error messages --- app-cli/api/DeployApi.js | 6 +- app-cli/captainduckduck.js | 7 ++- app-cli/helpers/SpinnerHelper.js | 29 +++++++++ app-cli/lib/deploy.js | 22 ++----- app-cli/lib/serversetup.js | 10 +-- app-cli/utils/fileHelper.js | 98 +++++++++++++---------------- app-cli/utils/messageHandler.js | 21 +++---- app-cli/utils/spinner.js | 24 ------- app-cli/utils/validationsHandler.js | 32 ++++++---- 9 files changed, 120 insertions(+), 129 deletions(-) create mode 100644 app-cli/helpers/SpinnerHelper.js delete mode 100644 app-cli/utils/spinner.js diff --git a/app-cli/api/DeployApi.js b/app-cli/api/DeployApi.js index 3ba2821..c49821b 100644 --- a/app-cli/api/DeployApi.js +++ b/app-cli/api/DeployApi.js @@ -38,14 +38,16 @@ class DeployApi { setAppName(appName) { this.appName = appName + + console.log("App name is", appName) } async fetchBuildLogs() { try { - const { token, baseUrl } = this.machineToDeploy + const { authToken, baseUrl } = this.machineToDeploy const customOptions = { headers: { - "x-captain-auth": token + "x-captain-auth": authToken } } const data = await MainApi.get( diff --git a/app-cli/captainduckduck.js b/app-cli/captainduckduck.js index 4d6e666..4d53e3c 100755 --- a/app-cli/captainduckduck.js +++ b/app-cli/captainduckduck.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -const { printErrorAndExit } = require("./utils/messageHandler") +const { printError } = require("./utils/messageHandler") const packagejson = require("./package.json") const updateNotifier = require("update-notifier") const program = require("commander") @@ -78,8 +78,9 @@ program program.on("command:*", () => { const wrongCommands = program.args.join(" ") - printErrorAndExit( - `\nInvalid command: ${wrongCommands}\nSee --help for a list of available commands.` + printError( + `\nInvalid command: ${wrongCommands}\nSee --help for a list of available commands.`, + true ) }) diff --git a/app-cli/helpers/SpinnerHelper.js b/app-cli/helpers/SpinnerHelper.js new file mode 100644 index 0000000..b67c3a9 --- /dev/null +++ b/app-cli/helpers/SpinnerHelper.js @@ -0,0 +1,29 @@ +const ora = require("ora") + +class SpinnerHelper { + constructor() { + this.spinner + } + + setColor(color) { + this.spinner.color = color + } + + start(message) { + this.spinner = ora(message).start() + } + + stop() { + this.spinner.stop() + } + + succeed() { + this.spinner.succeed() + } + + fail() { + this.spinner.fail() + } +} + +module.exports = new SpinnerHelper() diff --git a/app-cli/lib/deploy.js b/app-cli/lib/deploy.js index c01e241..870d348 100644 --- a/app-cli/lib/deploy.js +++ b/app-cli/lib/deploy.js @@ -1,13 +1,7 @@ #!/usr/bin/env node const MachineHelper = require("../helpers/MachineHelper") const DeployApi = require("../api/DeployApi") -const { - printErrorAndExit, - printError, - printMessage, - printGreenMessage, - printMagentaMessage -} = require("../utils/messageHandler") +const { printError, printMessage } = require("../utils/messageHandler") const { validateIsGitRepository, validateDefinitionFile, @@ -15,7 +9,7 @@ const { optionIsGiven } = require("../utils/validationsHandler") const { requestLogin } = require("../lib/login") -const { getFileStream } = require("../utils/fileHelper") +const { getFileStream, uploadFile } = require("../utils/fileHelper") const { gitArchiveFile } = require("../utils/fileHelper") const fs = require("fs-extra") const path = require("path") @@ -203,12 +197,7 @@ function deploy(options) { const fileStream = getFileStream(filePath) const gitHash = "sendviatarfile" - printMessage(`Uploading file to ${DeployApi.machineToDeploy.baseUrl}`) - - const response = await DeployApi.sendFile(fileStream, gitHash) - // const data = JSON.parse(response) - - console.log(response) + uploadFile(filePath, fileStream, gitHash) return } @@ -218,8 +207,9 @@ function deploy(options) { if (!commandExistsSync("git")) { printError("'git' command not found...") - printErrorAndExit( - "Captain needs 'git' to create tar file of your source files..." + printError( + "Captain needs 'git' to create tar file of your source files...", + true ) } diff --git a/app-cli/lib/serversetup.js b/app-cli/lib/serversetup.js index 458fce5..f7596b8 100644 --- a/app-cli/lib/serversetup.js +++ b/app-cli/lib/serversetup.js @@ -7,7 +7,6 @@ const { isIpAddress } = require("../utils/validationsHandler") const { SAMPLE_IP, DEFAULT_PASSWORD } = require("../utils/constants") const { printMessage, - printErrorAndExit, printError, printMessageAndExit, errorHandler @@ -45,7 +44,7 @@ const questions = [ const ipFromUser = value.trim() if (ipFromUser === SAMPLE_IP || !isIpAddress(ipFromUser)) { - printErrorAndExit(`\nThis is an invalid IP Address: ${ipFromUser}`) + printError(`\nThis is an invalid IP Address: ${ipFromUser}`, true) } try { @@ -160,7 +159,7 @@ const questions = [ const machineUrl = `https://${customDomainFromUser}` if (newPasswordFirstTry !== confirmPasswordValueFromUser) { - printErrorAndExit("Passwords do not match") + printError("Passwords do not match", true) } const changePassData = await LoginApi.changePass( @@ -187,8 +186,9 @@ const questions = [ `\n- Go to https://${customDomainFromUser} login with default password and change the password in settings.` ) - printErrorAndExit( - `\n- In terminal (here), type captainduckduck login and enter this as your root domain: ${customDomainFromUser}` + printError( + `\n- In terminal (here), type captainduckduck login and enter this as your root domain: ${customDomainFromUser}`, + true ) } } diff --git a/app-cli/utils/fileHelper.js b/app-cli/utils/fileHelper.js index 567f7ff..015ccef 100644 --- a/app-cli/utils/fileHelper.js +++ b/app-cli/utils/fileHelper.js @@ -5,6 +5,8 @@ const { printGreenMessage, printMagentaMessage } = require("./messageHandler") +const { isTarFileProvided } = require("../utils/validationsHandler") +const SpinnerHelper = require("../helpers/SpinnerHelper") const { exec } = require("child_process") const ProgressBar = require("progress") const ora = require("ora") @@ -66,22 +68,22 @@ function onLogRetrieved(data) { } } - const { baseUrl, appName } = DeployApi.machineToDeploy + const finishedBuilding = data && !data.isAppBuilding - if (data && !data.isAppBuilding) { + if (finishedBuilding) { if (!data.isBuildFailed) { - const machineBaseUrl = baseUrl - .replace("//captain.", "//" + appName + ".") - .replace("https://", "http://") + printGreenMessage(`Deployed successfully: ${DeployApi.appName}`) - printGreenMessage(`Deployed successfully: ${appName}`) - - printMagentaMessage(`App is available at ${machineBaseUrl}\n`) + printMagentaMessage( + `App is available at ${DeployApi.machineToDeploy.baseUrl}\n`, + true + ) } else { - printError(`\nSomething bad happened. Cannot deploy "${appName}"\n`) + printError( + `\nSomething bad happened. Cannot deploy "${DeployApi.appName}"\n`, + true + ) } - - return } setTimeout(() => { @@ -98,7 +100,7 @@ async function startFetchingBuildLogs() { throw new Error(JSON.stringify(response, null, 2)) } - onLogRetrieved(data.data) + onLogRetrieved(response.data) } catch (error) { printError(`\nSomething while retrieving app build logs.. ${error}\n`) @@ -123,72 +125,58 @@ function getFileStream(zipFileFullPath) { bar.tick(chunk.length) }) - let spinner - fileStream.on("end", () => { printMessage("This might take several minutes. PLEASE BE PATIENT...") - // spinner = ora("Building your source code...").start() + SpinnerHelper.start("Building your source code...") - // spinner.color = "yellow" + SpinnerHelper.setColor("yellow") }) return fileStream } -async function sendFileToCaptain(fileStream, gitHash) { +async function uploadFile(filePath, fileStream, gitHash) { printMessage(`Uploading file to ${DeployApi.machineToDeploy.baseUrl}`) - // try { const response = await DeployApi.sendFile(fileStream, gitHash) const data = JSON.parse(response) + const somethingWentWrong = data.status !== 100 && data.status !== 101 + const isDeployedAndBuilding = data.status === 101 + const isDeployedSuccessfully = data.status === 100 - // Uncomment this to remove the file - // if (fs.pathExistsSync(zipFileFullPath)) { - // if (!isTarFileProvided()) { - // fs.removeSync(zipFileFullPath) - // } - // } - - if (data.status === 1106) { - // // expired token - - printMessage("Expired token") - // requestLogin( - // DeployApi.machineToDeploy.name, - // DeployApi.machineToDeploy.baseUrl, - // function callback(machineToDeployNew) { - // deployTo() - // } - // ) - - return + if (somethingWentWrong) { + throw new Error(JSON.stringify(data, null, 2)) } - // if (data.status !== 100 && data.status !== 101) { - // throw new Error(JSON.stringify(data, null, 2)) - // } + // deleteFileFromDisk(filePath) // Uncomment this + // Save app to local storage // savePropForDirectory(DEFAULT_APP_NAME, DeployApi.appName) // savePropForDirectory(DEFAULT_BRANCH_TO_PUSH, DeployApi.branchToPush) // savePropForDirectory(MACHINE_TO_DEPLOY, DeployApi.machineToDeploy) - // if (data.status === 100) { - // printGreenMessage(`Deployed successfully: ${DeployApi.appName}\n`) - // } else if (data.status === 101) { - // printGreenMessage(`Building started: ${DeployApi.appName}\n`) + if (isDeployedAndBuilding) { + startFetchingBuildLogs() + } - // startFetchingBuildLogs() - // } - // } catch (e) { - // printError( - // `\nSomething bad happened. Cannot deploy "${DeployApi.appName}"\n` - // ) - - // errorHandler(e) - // } + if (isDeployedSuccessfully) { + printGreenMessage(`Deployed successfully: ${DeployApi.appName}\n`, true) + } } -module.exports = { gitArchiveFile, sendFileToCaptain, getFileStream } +function deleteFileFromDisk(filePath) { + if (fs.pathExistsSync(filePath)) { + if (!isTarFileProvided()) { + fs.removeSync(filePath) + } + } +} + +module.exports = { + gitArchiveFile, + getFileStream, + uploadFile +} diff --git a/app-cli/utils/messageHandler.js b/app-cli/utils/messageHandler.js index fabe73a..77152ea 100644 --- a/app-cli/utils/messageHandler.js +++ b/app-cli/utils/messageHandler.js @@ -10,36 +10,35 @@ function printMessageAndExit(message) { process.exit(0) } -function printGreenMessage(message) { +function printGreenMessage(message, exit = false) { console.log(`${chalk.green(message)}`) + + exit && process.exit(0) } -function printMagentaMessage(message) { +function printMagentaMessage(message, exit = false) { console.log(`${chalk.magenta(message)}`) + + exit && process.exit(0) } -function printError(error) { +function printError(error, exit = false) { console.log(`${chalk.bold.red(error)}`) -} -function printErrorAndExit(error) { - console.log(`${printError(error)}`) - - process.exit(0) + exit && process.exit(0) } function errorHandler(error) { if (error.status) { - printErrorAndExit(`\nError: ${error.status}\nError: ${error.description}`) + printError(`\nError: ${error.status}\nError: ${error.description}`, true) } else { - printErrorAndExit(`\nError: ${error}`) + printError(`\nError: ${error}`, true) } } module.exports = { printMessage, printMessageAndExit, - printErrorAndExit, printError, printGreenMessage, printMagentaMessage, diff --git a/app-cli/utils/spinner.js b/app-cli/utils/spinner.js deleted file mode 100644 index 1912ab0..0000000 --- a/app-cli/utils/spinner.js +++ /dev/null @@ -1,24 +0,0 @@ -const ora = require("ora") - -function start(message) { - return ora(message).start() -} - -function stop(spinner) { - spinner.stop() -} - -function succeed(spinner) { - spinner.succeed() -} - -function fail(spinner) { - spinner.fail() -} - -module.exports = { - start: start, - stop: stop, - succeed: succeed, - fail: fail -} diff --git a/app-cli/utils/validationsHandler.js b/app-cli/utils/validationsHandler.js index d05c58d..75a30a5 100644 --- a/app-cli/utils/validationsHandler.js +++ b/app-cli/utils/validationsHandler.js @@ -1,12 +1,13 @@ const fs = require("fs-extra") -const { printErrorAndExit } = require("./messageHandler") +const { printError } = require("./messageHandler") function validateIsGitRepository() { const gitFolderExists = fs.pathExistsSync("./.git") if (!gitFolderExists) { - printErrorAndExit( - "\n**** ERROR: You are not in a git root directory. This command will only deploys the current directory ****\n" + printError( + "\n**** ERROR: You are not in a git root directory. This command will only deploys the current directory ****\n", + true ) } } @@ -15,8 +16,9 @@ function validateDefinitionFile() { const captainDefinitionExists = fs.pathExistsSync("./captain-definition") if (!captainDefinitionExists) { - printErrorAndExit( - "\n**** ERROR: captain-definition file cannot be found. Please see docs! ****\n" + printError( + "\n**** ERROR: captain-definition file cannot be found. Please see docs! ****\n", + true ) } @@ -26,26 +28,30 @@ function validateDefinitionFile() { try { contentsJson = JSON.parse(contents) } catch (e) { - printErrorAndExit( - `**** ERROR: captain-definition file is not a valid JSON! ****\n Error:${e}` + printError( + `**** ERROR: captain-definition file is not a valid JSON! ****\n Error:${e}`, + true ) } if (!contentsJson.schemaVersion) { - printErrorAndExit( - "**** ERROR: captain-definition needs schemaVersion. Please see docs! ****" + printError( + "**** ERROR: captain-definition needs schemaVersion. Please see docs! ****", + true ) } if (!contentsJson.templateId && !contentsJson.dockerfileLines) { - printErrorAndExit( - "**** ERROR: captain-definition needs templateId or dockerfileLines. Please see docs! ****" + printError( + "**** ERROR: captain-definition needs templateId or dockerfileLines. Please see docs! ****", + true ) } if (contentsJson.templateId && contentsJson.dockerfileLines) { - printErrorAndExit( - "**** ERROR: captain-definition needs templateId or dockerfileLines, NOT BOTH! Please see docs! ****" + printError( + "**** ERROR: captain-definition needs templateId or dockerfileLines, NOT BOTH! Please see docs! ****", + true ) } } From 6ac4545602aef00f99111fd025fe3a424d98c27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Trevi=C3=B1o?= Date: Sun, 18 Nov 2018 22:19:05 +0100 Subject: [PATCH 12/44] Add AppURL to DeployApi --- app-cli/api/DeployApi.js | 10 +++++++++- app-cli/utils/fileHelper.js | 5 +---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app-cli/api/DeployApi.js b/app-cli/api/DeployApi.js index c49821b..39d0794 100644 --- a/app-cli/api/DeployApi.js +++ b/app-cli/api/DeployApi.js @@ -12,6 +12,8 @@ class DeployApi { this.branchToPush = DEFAULT_BRANCH_TO_PUSH this.appName = DEFAULT_APP_NAME + + this.appUrl = "" } setMachineToDeploy(machineToDeploy) { @@ -39,7 +41,13 @@ class DeployApi { setAppName(appName) { this.appName = appName - console.log("App name is", appName) + this.setAppUrl() + } + + setAppUrl() { + this.appUrl = this.machineToDeploy.baseUrl + .replace("//captain.", "//" + this.appName + ".") + .replace("https://", "http://") } async fetchBuildLogs() { diff --git a/app-cli/utils/fileHelper.js b/app-cli/utils/fileHelper.js index 015ccef..8a94fb7 100644 --- a/app-cli/utils/fileHelper.js +++ b/app-cli/utils/fileHelper.js @@ -74,10 +74,7 @@ function onLogRetrieved(data) { if (!data.isBuildFailed) { printGreenMessage(`Deployed successfully: ${DeployApi.appName}`) - printMagentaMessage( - `App is available at ${DeployApi.machineToDeploy.baseUrl}\n`, - true - ) + printMagentaMessage(`App is available at ${DeployApi.appUrl}\n`, true) } else { printError( `\nSomething bad happened. Cannot deploy "${DeployApi.appName}"\n`, From 40a314f62b529c08360f0e432a6d7cdf6d770527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Trevi=C3=B1o?= Date: Sun, 9 Dec 2018 22:22:15 +0100 Subject: [PATCH 13/44] Read/Save app to localstorage after being deployed --- app-cli/api/DeployApi.js | 8 +- app-cli/captainduckduck.js | 2 +- app-cli/lib/deploy.js | 267 ++++++++++++---------------- app-cli/lib/login.js | 7 +- app-cli/utils/fileHelper.js | 79 +++++--- app-cli/utils/validationsHandler.js | 5 - 6 files changed, 185 insertions(+), 183 deletions(-) diff --git a/app-cli/api/DeployApi.js b/app-cli/api/DeployApi.js index 39d0794..58ccafa 100644 --- a/app-cli/api/DeployApi.js +++ b/app-cli/api/DeployApi.js @@ -16,7 +16,11 @@ class DeployApi { this.appUrl = "" } - setMachineToDeploy(machineToDeploy) { + setMachineToDeeploy(machineToDeploy) { + this.machineToDeploy = machineToDeploy + } + + updateMachineToDeploy(machineToDeploy) { let temp = [] // Look machine by host @@ -93,6 +97,8 @@ class DeployApi { // This is not moved to LoginAPI since it's related only for machineToDeploy async isAuthTokenValid() { try { + if (!this.machineToDeploy) return false + const url = `${this.machineToDeploy.baseUrl}/api/v1/user/appDefinitions/` const currentToken = this.machineToDeploy.authToken const options = { diff --git a/app-cli/captainduckduck.js b/app-cli/captainduckduck.js index 4d53e3c..b660525 100755 --- a/app-cli/captainduckduck.js +++ b/app-cli/captainduckduck.js @@ -9,7 +9,7 @@ updateNotifier({ pkg: packagejson }).notify({ isGlobal: true }) // Command actions const serversetup = require("./lib/serversetup") -const login = require("./lib/login") +const { login } = require("./lib/login") const logout = require("./lib/logout") const list = require("./lib/list") const deploy = require("./lib/deploy") diff --git a/app-cli/lib/deploy.js b/app-cli/lib/deploy.js index 870d348..55e6015 100644 --- a/app-cli/lib/deploy.js +++ b/app-cli/lib/deploy.js @@ -1,11 +1,11 @@ #!/usr/bin/env node const MachineHelper = require("../helpers/MachineHelper") const DeployApi = require("../api/DeployApi") +const LoginApi = require("../api/LoginApi") const { printError, printMessage } = require("../utils/messageHandler") const { validateIsGitRepository, validateDefinitionFile, - isTarFileProvided, optionIsGiven } = require("../utils/validationsHandler") const { requestLogin } = require("../lib/login") @@ -15,94 +15,134 @@ const fs = require("fs-extra") const path = require("path") const inquirer = require("inquirer") const commandExistsSync = require("command-exists").sync -const MACHINE_TO_DEPLOY = "machineToDeploy" -const { - EMPTY_STRING, - DEFAULT_BRANCH_TO_PUSH, - DEFAULT_APP_NAME -} = require("../utils/constants") -// Gets default value for propType that is stored in a directory. -// Replaces getAppForDirectory -// Check if the command is running inside the directory of an existing app -function getPropForDirectory(propType) { - const appDirectory = MachineHelper.apps - .map(app => { - if (app.cmd === process.cwd()) { - return app[propType] - } - }) - .filter(Boolean) +function initMachineFromLocalStorage() { + const possibleApp = MachineHelper.apps.find(app => app.cwd === process.cwd()) - return appDirectory.length ? appDirectory : undefined + if (possibleApp) { + DeployApi.setMachineToDeeploy(possibleApp.machineToDeploy) + + DeployApi.setAppName(possibleApp.appName) + + DeployApi.setBranchToPush(possibleApp.branchToPush) + } } -// Sets default value for propType that is stored in a directory to propValue. -// Replaces saveAppForDirectory -// Saves the app directory into local storage -function savePropForDirectory(propType, propValue) { - const apps = MachineHelper.apps +function deployAsDefaultValues() { + const { appName, branchToPush, machineToDeploy } = DeployApi - for (let i = 0; i < apps.length; i++) { - const app = apps[i] - - if (app.cwd === process.cwd()) { - app[propType] = propValue - - MachineHelper.setApps(apps) - - return - } + if (!appName || !branchToPush || !machineToDeploy) { + printError( + "Default deploy failed. There are no default options selected.", + true + ) } - const newApp = { - cwd: process.cwd(), - [propType]: propValue - } + printMessage(`Deploying to ${machineToDeploy.name}`) - apps.push(newApp) - - MachineHelper.setApps(apps) + deployFromGitProject() } -function getDefaultMachine() { - const machine = getPropForDirectory(MACHINE_TO_DEPLOY) +async function validateAuthentication() { + // 1. Check if valid auth + const isAuthenticated = await DeployApi.isAuthTokenValid() - if (machine) return machine.name + // 2. Request login + // 3. Login + // 4. Update token + if (!isAuthenticated) { + requestLogin() + } +} - if (MachineHelper.machines.length == 2) return 1 +async function deployAsStateless(stateless, host, appName, branch, pass) { + const isStateless = stateless && host && appName && pass - return EMPTY_STRING + if (isStateless) { + // login first + printMessage(`Trying to login to ${host}\n`) + + await LoginApi.loginMachine(host, pass) + + printMessage(`Starting stateless deploy to\n${host}\n${branch}\n${appName}`) + + await deployFromGitProject() + } +} + +async function deployFromTarFile(tarFile) { + try { + await validateAuthentication() + + // Send from tar file + const filePath = tarFile + const fileStream = getFileStream(filePath) + const gitHash = "sendviatarfile" + + await uploadFile(filePath, fileStream, gitHash) + } catch (e) { + printError(e.message, true) + } +} + +function deployFromGitProject() { + // TODO - Deploy from git folder + + if (!commandExistsSync("git")) { + printError("'git' command not found...") + + printError( + "Captain needs 'git' to create tar file of your source files...", + true + ) + } + + const zipFileNameToDeploy = "temporary-captain-to-deploy.tar" + const zipFileFullPath = path.join(process.cwd(), zipFileNameToDeploy) + + printMessage(`Saving tar file to:\n${zipFileFullPath}\n`) + + // Removes the temporarly file created + try { + fs.removeSync(zipFileFullPath) + } catch (e) { + // IgnoreError + } + + gitArchiveFile(zipFileFullPath, MachineHelper.branchToPush) } function deploy(options) { - if (!isTarFileProvided(options.tarFile)) { + // Reads local storage and sets the machine if found + initMachineFromLocalStorage() + + if (!options.tarFile) { validateIsGitRepository() validateDefinitionFile() } - console.log("Preparing deployment to Captain...\n") + printMessage("Preparing deployment to Captain...\n") const questions = [ { type: "list", name: "captainNameToDeploy", - default: getDefaultMachine(), + default: DeployApi.machineToDeploy.name || "", message: "Select the Captain Machine you want to deploy to:", choices: MachineHelper.getMachinesAsOptions(), when: () => optionIsGiven(options, "host") }, { type: "input", - default: getPropForDirectory(DEFAULT_BRANCH_TO_PUSH) || "master", + default: DeployApi.branchToPush || "master", name: "branchToPush", message: "Enter the 'git' branch you would like to deploy:", when: () => optionIsGiven(options, "branch") }, { type: "input", - default: getPropForDirectory(DEFAULT_APP_NAME), + default: DeployApi.appName, name: "appName", message: "Enter the Captain app name this directory will be deployed to:", when: () => optionIsGiven(options, "appName") @@ -116,117 +156,40 @@ function deploy(options) { when: () => optionIsGiven(options, "stateless") } ] - // TODO - Refactor - let defaultInvalid = false - if (options.default) { - if ( - !getDefaultMachine() || - !getPropForDirectory(options.branch || DEFAULT_BRANCH_TO_PUSH) || - !getPropForDirectory(DEFAULT_APP_NAME) - ) { - printError("Default deploy failed. Please select deploy options.") + inquirer.prompt(questions).then(answers => { + if (!answers.confirmedToDeploy) { + printMessage("\nOperation cancelled by the user...\n") - defaultInvalid = true - } else { - printMessage( - `Deploying to ${getPropForDirectory(MACHINE_TO_DEPLOY).name}` - ) - - deployTo( - getPropForDirectory(MACHINE_TO_DEPLOY), - getPropForDirectory(DEFAULT_BRANCH_TO_PUSH), - getPropForDirectory(DEFAULT_APP_NAME) - ) - } - } - - // TODO - Refactor - const isStateless = - options.stateless && options.host && options.appName && options.pass - - if (isStateless) { - // login first - printMessage(`Trying to login to ${options.host}\n`) - - printMessage( - `Starting stateless deploy to\n${options.host}\n${options.branch}\n${ - options.appName - }` - ) - - deployTo() - } else if (!options.default || defaultInvalid) { - inquirer.prompt(questions).then(answers => { - if (!answers.confirmedToDeploy) { - printMessage("\nOperation cancelled by the user...\n") - - process.exit(0) - } - - const captainNameToDeploy = answers.captainNameToDeploy - const branchToPush = answers.branchToPush || options.branch - const appName = answers.appName || options.appName - - DeployApi.setMachineToDeploy(captainNameToDeploy || options.host) - - DeployApi.setBranchToPush(branchToPush) - - DeployApi.setAppName(appName) - - printMessage(`Deploying to ${DeployApi.machineToDeploy.name}`) - - deployTo() - }) - } - - async function deployTo() { - // 1. Check if valid auth - const isAuthenticated = await DeployApi.isAuthTokenValid() - - // 2. Request login - // 3. Login - // 4. Update token - if (!isAuthenticated) { - requestLogin() + process.exit(0) } - // Send from tar file - if (isTarFileProvided(options.tarFile)) { - const filePath = options.tarFile - const fileStream = getFileStream(filePath) - const gitHash = "sendviatarfile" + const captainNameToDeploy = answers.captainNameToDeploy + const branchToPush = answers.branchToPush || options.branch + const appName = answers.appName || options.appName - uploadFile(filePath, fileStream, gitHash) + DeployApi.updateMachineToDeploy(captainNameToDeploy || options.host) - return + DeployApi.setBranchToPush(branchToPush) + + DeployApi.setAppName(appName) + + printMessage(`Deploying to ${DeployApi.machineToDeploy.name}`) + + if (options.tarFile) { + deployFromTarFile(options.tarFile) } - // TODO - Deploy from git folder + // if (options.default) { + // deployAsDefaultValues() + // } - if (!commandExistsSync("git")) { - printError("'git' command not found...") + // if (options.stateless) { + // deployAsStateless() + // } - printError( - "Captain needs 'git' to create tar file of your source files...", - true - ) - } - - const zipFileNameToDeploy = "temporary-captain-to-deploy.tar" - const zipFileFullPath = path.join(process.cwd(), zipFileNameToDeploy) - - printMessage(`Saving tar file to:\n${zipFileFullPath}\n`) - - // Removes the temporarly file created - try { - fs.removeSync(zipFileFullPath) - } catch (e) { - // IgnoreError - } - - gitArchiveFile(zipFileFullPath, MachineHelper.branchToPush) - } + // deployFromGitProject() + }) } module.exports = deploy diff --git a/app-cli/lib/login.js b/app-cli/lib/login.js index d77abc2..d4956bd 100644 --- a/app-cli/lib/login.js +++ b/app-cli/lib/login.js @@ -5,13 +5,14 @@ const { printError } = require("../utils/messageHandler") const inquirer = require("inquirer") +const DeployApi = require("../api/DeployApi") const { cleanUpUrl, findDefaultCaptainName } = require("../utils/loginHelpers") const { SAMPLE_DOMAIN } = require("../utils/constants") const LoginApi = require("../api/LoginApi") // In case the token is expired function requestLogin() { - const { baseUrl, name } = this.machineToDeploy + const { baseUrl, name } = DeployApi.machineToDeploy printMessage("Your auth token is not valid anymore. Try to login again.") @@ -152,6 +153,6 @@ function login() { }) } -module.exports = login +module.exports = { login, requestLogin } -module.exports = requestLogin +// module.exports = requestLogin diff --git a/app-cli/utils/fileHelper.js b/app-cli/utils/fileHelper.js index 8a94fb7..7473c54 100644 --- a/app-cli/utils/fileHelper.js +++ b/app-cli/utils/fileHelper.js @@ -11,6 +11,7 @@ const { exec } = require("child_process") const ProgressBar = require("progress") const ora = require("ora") const DeployApi = require("../api/DeployApi") +const MachineHelper = require("../helpers/MachineHelper") let lastLineNumberPrinted = -10000 // we want to show all lines to begin with! function gitArchiveFile(zipFileFullPath, branchToPush) { @@ -133,34 +134,70 @@ function getFileStream(zipFileFullPath) { return fileStream } +// Saves the app directory into local storage +function saveMachineToLocalStorage() { + const apps = MachineHelper.apps + const currentDirectory = process.cwd() + let appExists = false + + // Update app + apps.map(app => { + if (app.cwd === currentDirectory) { + appExists = true + + return { + cwd: app.cwd, + appName: DeployApi.appName, + branchToPush: DeployApi.branchToPush, + machineToDeploy: DeployApi.machineToDeploy + } + } + + return app + }) + + if (!appExists) { + const newApp = { + cwd: process.cwd(), + appName: DeployApi.appName, + branchToPush: DeployApi.branchToPush, + machineToDeploy: DeployApi.machineToDeploy + } + + apps.push(newApp) + + MachineHelper.setApps(apps) + } +} + async function uploadFile(filePath, fileStream, gitHash) { - printMessage(`Uploading file to ${DeployApi.machineToDeploy.baseUrl}`) + try { + printMessage(`Uploading file to ${DeployApi.machineToDeploy.baseUrl}`) - const response = await DeployApi.sendFile(fileStream, gitHash) - const data = JSON.parse(response) - const somethingWentWrong = data.status !== 100 && data.status !== 101 - const isDeployedAndBuilding = data.status === 101 - const isDeployedSuccessfully = data.status === 100 + const response = await DeployApi.sendFile(fileStream, gitHash) + const data = JSON.parse(response) + const somethingWentWrong = data.status !== 100 && data.status !== 101 + const isDeployedAndBuilding = data.status === 101 + const isDeployedSuccessfully = data.status === 100 - if (somethingWentWrong) { - throw new Error(JSON.stringify(data, null, 2)) - } + if (somethingWentWrong) { + throw new Error(JSON.stringify(data, null, 2)) + } - // deleteFileFromDisk(filePath) // Uncomment this + // deleteFileFromDisk(filePath) // Uncomment this - // Save app to local storage - // savePropForDirectory(DEFAULT_APP_NAME, DeployApi.appName) + // Save app to local storage + saveMachineToLocalStorage() - // savePropForDirectory(DEFAULT_BRANCH_TO_PUSH, DeployApi.branchToPush) + if (isDeployedAndBuilding) { + startFetchingBuildLogs() + } - // savePropForDirectory(MACHINE_TO_DEPLOY, DeployApi.machineToDeploy) - - if (isDeployedAndBuilding) { - startFetchingBuildLogs() - } - - if (isDeployedSuccessfully) { - printGreenMessage(`Deployed successfully: ${DeployApi.appName}\n`, true) + if (isDeployedSuccessfully) { + printGreenMessage(`Deployed successfully: ${DeployApi.appName}\n`, true) + } + } catch (e) { + printError(e.message, true) } } diff --git a/app-cli/utils/validationsHandler.js b/app-cli/utils/validationsHandler.js index 75a30a5..03e6d92 100644 --- a/app-cli/utils/validationsHandler.js +++ b/app-cli/utils/validationsHandler.js @@ -56,10 +56,6 @@ function validateDefinitionFile() { } } -function isTarFileProvided(tarFilePath) { - return tarFilePath -} - // Only show that question if there is no option given as argument function optionIsGiven(allOptions, option) { if (allOptions[option]) { @@ -85,6 +81,5 @@ module.exports = { validateIsGitRepository, validateDefinitionFile, isIpAddress, - isTarFileProvided, optionIsGiven } From eb2d702243c6b31f220cbf79b66cd4392383d8a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Trevi=C3=B1o?= Date: Mon, 10 Dec 2018 22:08:47 +0100 Subject: [PATCH 14/44] Add deploy as default values --- app-cli/api/DeployApi.js | 10 +- app-cli/helpers/MachineHelper.js | 24 ++++- app-cli/lib/deploy.js | 155 +++++++++++++++------------- app-cli/lib/login.js | 20 ++-- app-cli/utils/fileHelper.js | 12 +-- app-cli/utils/validationsHandler.js | 21 ++++ 6 files changed, 146 insertions(+), 96 deletions(-) diff --git a/app-cli/api/DeployApi.js b/app-cli/api/DeployApi.js index 58ccafa..fa7c50c 100644 --- a/app-cli/api/DeployApi.js +++ b/app-cli/api/DeployApi.js @@ -16,26 +16,26 @@ class DeployApi { this.appUrl = "" } - setMachineToDeeploy(machineToDeploy) { + setMachineToDeploy(machineToDeploy) { this.machineToDeploy = machineToDeploy } updateMachineToDeploy(machineToDeploy) { - let temp = [] + let possibleMachine = {} // Look machine by host if (machineToDeploy.startsWith("http")) { - temp = MachineHelper.machines.find( + possibleMachine = MachineHelper.machines.find( machine => machine.baseUrl === machineToDeploy ) } else { // Look machine by name - temp = MachineHelper.machines.find( + possibleMachine = MachineHelper.machines.find( machine => machine.name === machineToDeploy ) } - this.machineToDeploy = temp + this.machineToDeploy = possibleMachine } setBranchToPush(branchToPush) { diff --git a/app-cli/helpers/MachineHelper.js b/app-cli/helpers/MachineHelper.js index 0c43cce..8858727 100644 --- a/app-cli/helpers/MachineHelper.js +++ b/app-cli/helpers/MachineHelper.js @@ -38,18 +38,40 @@ class MachineHelper { } updateMachineAuthToken(machineName, authToken) { + let updatedMachine = {} const newMachines = this.machines.map(machine => { if (machine.name === machineName) { - return { + updatedMachine = { ...machine, authToken } + + return updatedMachine } return machine }) this.setMachines(newMachines) + + this.updateAppsAuthToken(updatedMachine) + } + + updateAppsAuthToken(updatedMachine) { + if (!updatedMachine) return + + const newApps = this.apps.map(app => { + if (app.machineToDeploy.name === updatedMachine.name) { + return { + ...app, + machineToDeploy: updatedMachine + } + } + + return app + }) + + this.setApps(newApps) } setApps(newApps) { diff --git a/app-cli/lib/deploy.js b/app-cli/lib/deploy.js index 55e6015..cb42cc0 100644 --- a/app-cli/lib/deploy.js +++ b/app-cli/lib/deploy.js @@ -6,10 +6,10 @@ const { printError, printMessage } = require("../utils/messageHandler") const { validateIsGitRepository, validateDefinitionFile, - optionIsGiven + optionIsGiven, + validateAuthentication } = require("../utils/validationsHandler") -const { requestLogin } = require("../lib/login") -const { getFileStream, uploadFile } = require("../utils/fileHelper") +const { uploadFile } = require("../utils/fileHelper") const { gitArchiveFile } = require("../utils/fileHelper") const fs = require("fs-extra") const path = require("path") @@ -20,7 +20,7 @@ function initMachineFromLocalStorage() { const possibleApp = MachineHelper.apps.find(app => app.cwd === process.cwd()) if (possibleApp) { - DeployApi.setMachineToDeeploy(possibleApp.machineToDeploy) + DeployApi.setMachineToDeploy(possibleApp.machineToDeploy) DeployApi.setAppName(possibleApp.appName) @@ -28,30 +28,31 @@ function initMachineFromLocalStorage() { } } -function deployAsDefaultValues() { - const { appName, branchToPush, machineToDeploy } = DeployApi +async function deployAsDefaultValues() { + try { + const isValidAuthentication = await validateAuthentication() - if (!appName || !branchToPush || !machineToDeploy) { - printError( - "Default deploy failed. There are no default options selected.", - true - ) - } + if (isValidAuthentication) { + // Refresh token in DeployApi + initMachineFromLocalStorage() - printMessage(`Deploying to ${machineToDeploy.name}`) + const { appName, branchToPush, machineToDeploy } = DeployApi - deployFromGitProject() -} + if (!appName || !branchToPush || !machineToDeploy) { + printError( + "Default deploy failed. There are no default options selected.", + true + ) + } -async function validateAuthentication() { - // 1. Check if valid auth - const isAuthenticated = await DeployApi.isAuthTokenValid() + printMessage(`Deploying to ${machineToDeploy.name}`) - // 2. Request login - // 3. Login - // 4. Update token - if (!isAuthenticated) { - requestLogin() + deployFromGitProject() + } else { + printError("Incorrect login details", true) + } + } catch (e) { + printError(e.message, true) } } @@ -66,28 +67,29 @@ async function deployAsStateless(stateless, host, appName, branch, pass) { printMessage(`Starting stateless deploy to\n${host}\n${branch}\n${appName}`) - await deployFromGitProject() + deployFromGitProject() } } async function deployFromTarFile(tarFile) { try { - await validateAuthentication() + const isValidAuthentication = await validateAuthentication() - // Send from tar file - const filePath = tarFile - const fileStream = getFileStream(filePath) - const gitHash = "sendviatarfile" + if (isValidAuthentication) { + // Send from tar file + const filePath = tarFile + const gitHash = "sendviatarfile" - await uploadFile(filePath, fileStream, gitHash) + await uploadFile(filePath, gitHash) + } else { + printError("Incorrect login details", true) + } } catch (e) { printError(e.message, true) } } function deployFromGitProject() { - // TODO - Deploy from git folder - if (!commandExistsSync("git")) { printError("'git' command not found...") @@ -104,15 +106,19 @@ function deployFromGitProject() { // Removes the temporarly file created try { - fs.removeSync(zipFileFullPath) + const tempFileExists = fs.pathExistsSync(zipFileFullPath) + + if (tempFileExists) { + fs.removeSync(zipFileFullPath) + } } catch (e) { // IgnoreError } - gitArchiveFile(zipFileFullPath, MachineHelper.branchToPush) + gitArchiveFile(zipFileFullPath, DeployApi.branchToPush) } -function deploy(options) { +async function deploy(options) { // Reads local storage and sets the machine if found initMachineFromLocalStorage() @@ -124,40 +130,44 @@ function deploy(options) { printMessage("Preparing deployment to Captain...\n") - const questions = [ - { - type: "list", - name: "captainNameToDeploy", - default: DeployApi.machineToDeploy.name || "", - message: "Select the Captain Machine you want to deploy to:", - choices: MachineHelper.getMachinesAsOptions(), - when: () => optionIsGiven(options, "host") - }, - { - type: "input", - default: DeployApi.branchToPush || "master", - name: "branchToPush", - message: "Enter the 'git' branch you would like to deploy:", - when: () => optionIsGiven(options, "branch") - }, - { - type: "input", - default: DeployApi.appName, - name: "appName", - message: "Enter the Captain app name this directory will be deployed to:", - when: () => optionIsGiven(options, "appName") - }, - { - type: "confirm", - name: "confirmedToDeploy", - message: - "Note that uncommitted files and files in gitignore (if any) will not be pushed to server. Please confirm so that deployment process can start.", - default: true, - when: () => optionIsGiven(options, "stateless") - } - ] + if (options.default) { + deployAsDefaultValues() + } else { + const questions = [ + { + type: "list", + name: "captainNameToDeploy", + default: DeployApi.machineToDeploy.name || "", + message: "Select the Captain Machine you want to deploy to:", + choices: MachineHelper.getMachinesAsOptions(), + when: () => optionIsGiven(options, "host") + }, + { + type: "input", + default: DeployApi.branchToPush || "master", + name: "branchToPush", + message: "Enter the 'git' branch you would like to deploy:", + when: () => optionIsGiven(options, "branch") + }, + { + type: "input", + default: DeployApi.appName, + name: "appName", + message: + "Enter the Captain app name this directory will be deployed to:", + when: () => optionIsGiven(options, "appName") + }, + { + type: "confirm", + name: "confirmedToDeploy", + message: + "Note that uncommitted files and files in gitignore (if any) will not be pushed to server. Please confirm so that deployment process can start.", + default: true, + when: () => optionIsGiven(options, "stateless") + } + ] + const answers = await inquirer.prompt(questions) - inquirer.prompt(questions).then(answers => { if (!answers.confirmedToDeploy) { printMessage("\nOperation cancelled by the user...\n") @@ -180,16 +190,13 @@ function deploy(options) { deployFromTarFile(options.tarFile) } - // if (options.default) { - // deployAsDefaultValues() - // } - // if (options.stateless) { // deployAsStateless() // } - // deployFromGitProject() - }) + // Normal deploy + deployFromGitProject() + } } module.exports = deploy diff --git a/app-cli/lib/login.js b/app-cli/lib/login.js index d4956bd..f681a64 100644 --- a/app-cli/lib/login.js +++ b/app-cli/lib/login.js @@ -11,7 +11,7 @@ const { SAMPLE_DOMAIN } = require("../utils/constants") const LoginApi = require("../api/LoginApi") // In case the token is expired -function requestLogin() { +async function requestLogin() { const { baseUrl, name } = DeployApi.machineToDeploy printMessage("Your auth token is not valid anymore. Try to login again.") @@ -30,16 +30,18 @@ function requestLogin() { } } ] + const loginPassword = await inquirer.prompt(questions) + const password = loginPassword.captainPassword + const response = await LoginApi.loginMachine(baseUrl, password) + const data = JSON.parse(response) + const newToken = data.token - inquirer.prompt(questions).then(async passwordAnswers => { - const password = passwordAnswers.captainPassword - const response = await LoginApi.loginMachine(baseUrl, password) - const data = JSON.parse(response) - const newToken = data.token + if (!newToken) return false - // Update the token to the machine that corresponds - MachineHelper.updateMachineAuthToken(name, newToken) - }) + // Update the token to the machine that corresponds + MachineHelper.updateMachineAuthToken(name, newToken) + + return true } function login() { diff --git a/app-cli/utils/fileHelper.js b/app-cli/utils/fileHelper.js index 7473c54..ed7c4ed 100644 --- a/app-cli/utils/fileHelper.js +++ b/app-cli/utils/fileHelper.js @@ -5,7 +5,6 @@ const { printGreenMessage, printMagentaMessage } = require("./messageHandler") -const { isTarFileProvided } = require("../utils/validationsHandler") const SpinnerHelper = require("../helpers/SpinnerHelper") const { exec } = require("child_process") const ProgressBar = require("progress") @@ -39,7 +38,7 @@ function gitArchiveFile(zipFileFullPath, branchToPush) { printMessage(`Pushing last commit on ${branchToPush}: ${gitHash}`) - // checkAuthAndSendFile(zipFileFullPath, gitHash) + uploadFile(zipFileFullPath, gitHash) }) } ) @@ -170,10 +169,11 @@ function saveMachineToLocalStorage() { } } -async function uploadFile(filePath, fileStream, gitHash) { +async function uploadFile(filePath, gitHash) { try { printMessage(`Uploading file to ${DeployApi.machineToDeploy.baseUrl}`) + const fileStream = getFileStream(filePath) const response = await DeployApi.sendFile(fileStream, gitHash) const data = JSON.parse(response) const somethingWentWrong = data.status !== 100 && data.status !== 101 @@ -184,7 +184,7 @@ async function uploadFile(filePath, fileStream, gitHash) { throw new Error(JSON.stringify(data, null, 2)) } - // deleteFileFromDisk(filePath) // Uncomment this + deleteFileFromDisk(filePath) // Uncomment this // Save app to local storage saveMachineToLocalStorage() @@ -203,9 +203,7 @@ async function uploadFile(filePath, fileStream, gitHash) { function deleteFileFromDisk(filePath) { if (fs.pathExistsSync(filePath)) { - if (!isTarFileProvided()) { - fs.removeSync(filePath) - } + fs.removeSync(filePath) } } diff --git a/app-cli/utils/validationsHandler.js b/app-cli/utils/validationsHandler.js index 03e6d92..6e5c821 100644 --- a/app-cli/utils/validationsHandler.js +++ b/app-cli/utils/validationsHandler.js @@ -1,5 +1,7 @@ const fs = require("fs-extra") +const DeployApi = require("../api/DeployApi") const { printError } = require("./messageHandler") +const { requestLogin } = require("../lib/login") function validateIsGitRepository() { const gitFolderExists = fs.pathExistsSync("./.git") @@ -77,7 +79,26 @@ function isIpAddress(ipaddress) { return false } +async function validateAuthentication() { + // 1. Check if valid auth + const isAuthenticated = await DeployApi.isAuthTokenValid() + + // 2. Request login + // 3. Login + // 4. Update token + if (!isAuthenticated) { + const loggedInStatus = await requestLogin() + + console.log("UpdatedEverything", loggedInStatus) + + return loggedInStatus + } else { + return Boolean(isAuthenticated) + } +} + module.exports = { + validateAuthentication, validateIsGitRepository, validateDefinitionFile, isIpAddress, From 967ecd74c3b2c80198bca60b20b6d290024304b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Trevi=C3=B1o?= Date: Mon, 10 Dec 2018 22:54:35 +0100 Subject: [PATCH 15/44] Add stateless deployment --- app-cli/lib/deploy.js | 52 +++++++++++++++++++---------- app-cli/utils/validationsHandler.js | 2 -- 2 files changed, 35 insertions(+), 19 deletions(-) diff --git a/app-cli/lib/deploy.js b/app-cli/lib/deploy.js index cb42cc0..34ef0fb 100644 --- a/app-cli/lib/deploy.js +++ b/app-cli/lib/deploy.js @@ -33,7 +33,7 @@ async function deployAsDefaultValues() { const isValidAuthentication = await validateAuthentication() if (isValidAuthentication) { - // Refresh token in DeployApi + // REFACTOR - Refresh token in DeployApi initMachineFromLocalStorage() const { appName, branchToPush, machineToDeploy } = DeployApi @@ -56,18 +56,35 @@ async function deployAsDefaultValues() { } } -async function deployAsStateless(stateless, host, appName, branch, pass) { - const isStateless = stateless && host && appName && pass +async function deployAsStateless(host, appName, branch, pass) { + const isStateless = host && appName && branch && pass if (isStateless) { // login first printMessage(`Trying to login to ${host}\n`) - await LoginApi.loginMachine(host, pass) + const { name } = DeployApi.machineToDeploy + const response = await LoginApi.loginMachine(host, pass) + const data = JSON.parse(response) + const newToken = data.token - printMessage(`Starting stateless deploy to\n${host}\n${branch}\n${appName}`) + // Update the token to the machine that corresponds (if needed) + MachineHelper.updateMachineAuthToken(name, newToken) - deployFromGitProject() + // REFACTOR - Refresh token in DeployApi + initMachineFromLocalStorage() + + if (data) { + printMessage( + `Starting stateless deploy to\n${host}\n${branch}\n${appName}` + ) + + deployFromGitProject() + } + } else { + printError( + "You are missing parameters for deploying on stateless. " + ) } } @@ -122,7 +139,7 @@ async function deploy(options) { // Reads local storage and sets the machine if found initMachineFromLocalStorage() - if (!options.tarFile) { + if (!options.tarFile || !options.stateless) { validateIsGitRepository() validateDefinitionFile() @@ -132,6 +149,15 @@ async function deploy(options) { if (options.default) { deployAsDefaultValues() + } else if (options.stateless) { + deployAsStateless( + options.host, + options.appName, + options.branch, + options.pass + ) + } else if (options.tarFile) { + deployFromTarFile(options.tarFile) } else { const questions = [ { @@ -168,7 +194,7 @@ async function deploy(options) { ] const answers = await inquirer.prompt(questions) - if (!answers.confirmedToDeploy) { + if (!answers.confirmedToDeploy && !options.stateless) { printMessage("\nOperation cancelled by the user...\n") process.exit(0) @@ -186,16 +212,8 @@ async function deploy(options) { printMessage(`Deploying to ${DeployApi.machineToDeploy.name}`) - if (options.tarFile) { - deployFromTarFile(options.tarFile) - } - - // if (options.stateless) { - // deployAsStateless() - // } - // Normal deploy - deployFromGitProject() + // deployFromGitProject() } } diff --git a/app-cli/utils/validationsHandler.js b/app-cli/utils/validationsHandler.js index 6e5c821..95b531e 100644 --- a/app-cli/utils/validationsHandler.js +++ b/app-cli/utils/validationsHandler.js @@ -89,8 +89,6 @@ async function validateAuthentication() { if (!isAuthenticated) { const loggedInStatus = await requestLogin() - console.log("UpdatedEverything", loggedInStatus) - return loggedInStatus } else { return Boolean(isAuthenticated) From 4b1a2ab6b6cd72cd72df9f807d9260010dd58080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Trevi=C3=B1o?= Date: Tue, 11 Dec 2018 20:05:57 +0100 Subject: [PATCH 16/44] Add manual deployment, adding some tests as well --- app-cli/lib/deploy.js | 28 +- app-cli/package-lock.json | 4566 ++++++++++++++++++ app-cli/package.json | 3 +- app-cli/utils/__tests__/loginHelpers.test.js | 48 + app-cli/utils/fileHelper.js | 41 +- app-cli/utils/loginHelpers.js | 14 +- app-cli/utils/machineUtils.js | 55 + 7 files changed, 4696 insertions(+), 59 deletions(-) create mode 100644 app-cli/utils/__tests__/loginHelpers.test.js create mode 100644 app-cli/utils/machineUtils.js diff --git a/app-cli/lib/deploy.js b/app-cli/lib/deploy.js index 34ef0fb..db7e58a 100644 --- a/app-cli/lib/deploy.js +++ b/app-cli/lib/deploy.js @@ -15,18 +15,7 @@ const fs = require("fs-extra") const path = require("path") const inquirer = require("inquirer") const commandExistsSync = require("command-exists").sync - -function initMachineFromLocalStorage() { - const possibleApp = MachineHelper.apps.find(app => app.cwd === process.cwd()) - - if (possibleApp) { - DeployApi.setMachineToDeploy(possibleApp.machineToDeploy) - - DeployApi.setAppName(possibleApp.appName) - - DeployApi.setBranchToPush(possibleApp.branchToPush) - } -} +const { initMachineFromLocalStorage } = require("../utils/machineUtils") async function deployAsDefaultValues() { try { @@ -213,7 +202,20 @@ async function deploy(options) { printMessage(`Deploying to ${DeployApi.machineToDeploy.name}`) // Normal deploy - // deployFromGitProject() + if (answers.confirmedToDeploy) { + try { + const isValidAuthentication = await validateAuthentication() + + if (isValidAuthentication) { + // REFACTOR - Refresh token in DeployApi + initMachineFromLocalStorage() + + deployFromGitProject() + } + } catch (e) { + printError("Incorrect login details", true) + } + } } } diff --git a/app-cli/package-lock.json b/app-cli/package-lock.json index 4a96618..f5a1265 100644 --- a/app-cli/package-lock.json +++ b/app-cli/package-lock.json @@ -24,18 +24,40 @@ "js-tokens": "^4.0.0" } }, + "abab": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz", + "integrity": "sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w==", + "dev": true + }, "acorn": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.3.tgz", "integrity": "sha512-xEnlTS2J0PKuub0pd2Y4W58iEo1sfRZ3h23E8AKmlnV8Nc6E/syRdVeo0DMuLSrgRJZHnFeDou2llXfB+wb1/A==", "dev": true }, + "acorn-globals": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.0.tgz", + "integrity": "sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw==", + "dev": true, + "requires": { + "acorn": "^6.0.1", + "acorn-walk": "^6.0.1" + } + }, "acorn-jsx": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.0.tgz", "integrity": "sha512-XkB50fn0MURDyww9+UYL3c1yLbOBz0ZFvrdYlGB8l+Ije1oSC75qAqrzSPjYQbdnQUzhlUGNKuesryAv0gxZOg==", "dev": true }, + "acorn-walk": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz", + "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", + "dev": true + }, "ajv": { "version": "5.5.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", @@ -73,6 +95,316 @@ "color-convert": "^1.9.0" } }, + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "append-transform": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-0.4.0.tgz", + "integrity": "sha1-126/jKlNJ24keja61EpLdKthGZE=", + "dev": true, + "requires": { + "default-require-extensions": "^1.0.0" + } + }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -82,6 +414,33 @@ "sprintf-js": "~1.0.2" } }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-equal": { + "version": "1.0.0", + "resolved": "http://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", + "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", + "dev": true + }, "array-union": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", @@ -97,6 +456,12 @@ "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", "dev": true }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", @@ -116,11 +481,44 @@ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, + "async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "dev": true, + "requires": { + "lodash": "^4.17.10" + } + }, + "async-limiter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", + "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", + "dev": true + }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", @@ -131,12 +529,357 @@ "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "babel-core": { + "version": "6.26.3", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", + "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-generator": "^6.26.0", + "babel-helpers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "convert-source-map": "^1.5.1", + "debug": "^2.6.9", + "json5": "^0.5.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.4", + "path-is-absolute": "^1.0.1", + "private": "^0.1.8", + "slash": "^1.0.0", + "source-map": "^0.5.7" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "babel-generator": { + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "dev": true, + "requires": { + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", + "lodash": "^4.17.4", + "source-map": "^0.5.7", + "trim-right": "^1.0.1" + } + }, + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-jest": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-23.6.0.tgz", + "integrity": "sha512-lqKGG6LYXYu+DQh/slrQ8nxXQkEkhugdXsU6St7GmhVS7Ilc/22ArwqXNJrf0QaOBjZB0360qZMwXqDYQHXaew==", + "dev": true, + "requires": { + "babel-plugin-istanbul": "^4.1.6", + "babel-preset-jest": "^23.2.0" + } + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-istanbul": { + "version": "4.1.6", + "resolved": "http://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz", + "integrity": "sha512-PWP9FQ1AhZhS01T/4qLSKoHGY/xvkZdVBGlKM/HuxxS3+sC66HhTNR7+MpbO/so/cz/wY94MeSWJuP1hXIPfwQ==", + "dev": true, + "requires": { + "babel-plugin-syntax-object-rest-spread": "^6.13.0", + "find-up": "^2.1.0", + "istanbul-lib-instrument": "^1.10.1", + "test-exclude": "^4.2.1" + } + }, + "babel-plugin-jest-hoist": { + "version": "23.2.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.2.0.tgz", + "integrity": "sha1-5h+uBaHKiAGq3uV6bWa4zvr0QWc=", + "dev": true + }, + "babel-plugin-syntax-object-rest-spread": { + "version": "6.13.0", + "resolved": "http://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", + "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", + "dev": true + }, + "babel-preset-jest": { + "version": "23.2.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-23.2.0.tgz", + "integrity": "sha1-jsegOhOPABoaj7HoETZSvxpV2kY=", + "dev": true, + "requires": { + "babel-plugin-jest-hoist": "^23.2.0", + "babel-plugin-syntax-object-rest-spread": "^6.13.0" + } + }, + "babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "dev": true, + "requires": { + "babel-core": "^6.26.0", + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "home-or-tmp": "^2.0.0", + "lodash": "^4.17.4", + "mkdirp": "^0.5.1", + "source-map-support": "^0.4.15" + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, + "babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" + } + }, + "babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "dev": true + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, "bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", @@ -174,6 +917,78 @@ "concat-map": "0.0.1" } }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "browser-process-hrtime": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", + "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==", + "dev": true + }, + "browser-resolve": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.3.tgz", + "integrity": "sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==", + "dev": true, + "requires": { + "resolve": "1.1.7" + } + }, + "bser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.0.0.tgz", + "integrity": "sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk=", + "dev": true, + "requires": { + "node-int64": "^0.4.0" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, "caller-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", @@ -194,6 +1009,15 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" }, + "capture-exit": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-1.2.0.tgz", + "integrity": "sha1-HF/MSJ/QqwDU8ax64QcuMXP7q28=", + "dev": true, + "requires": { + "rsvp": "^3.3.3" + } + }, "capture-stack-trace": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz", @@ -230,6 +1054,35 @@ "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", "dev": true }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, "cli-boxes": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", @@ -253,11 +1106,38 @@ "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=" }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -289,6 +1169,12 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==" }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -308,6 +1194,27 @@ "xdg-basedir": "^3.0.0" } }, + "convert-source-map": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", + "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "core-js": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.0.tgz", + "integrity": "sha512-kLRC6ncVpuEW/1kwrOXYX6KQASCVtrh1gQr/UiaVgFlf9WE5Vp+lNe5+h3LuMr5PAucWnnEXwH0nQHRH/gpGtw==", + "dev": true + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -336,6 +1243,21 @@ "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=" }, + "cssom": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.4.tgz", + "integrity": "sha512-+7prCSORpXNeR4/fUP3rL+TzqtiFfhMvTd7uEqMdgPvLPt4+uzFUeufx5RHjGTACCargg/DiEt/moMQmvnfkog==", + "dev": true + }, + "cssstyle": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.1.1.tgz", + "integrity": "sha512-364AI1l/M5TYcFH83JnOH/pSqgaNnKmYgKrm0didZMGKWjQB60dymwWy1rKUgL3J1ffdq9xVi2yGLHdSjjSNog==", + "dev": true, + "requires": { + "cssom": "0.3.x" + } + }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -344,6 +1266,30 @@ "assert-plus": "^1.0.0" } }, + "data-urls": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz", + "integrity": "sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ==", + "dev": true, + "requires": { + "abab": "^2.0.0", + "whatwg-mimetype": "^2.2.0", + "whatwg-url": "^7.0.0" + }, + "dependencies": { + "whatwg-url": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.0.0.tgz", + "integrity": "sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + } + } + }, "debug": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz", @@ -353,6 +1299,18 @@ "ms": "^2.1.1" } }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, "deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", @@ -364,6 +1322,77 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, + "default-require-extensions": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-1.0.0.tgz", + "integrity": "sha1-836hXT4T/9m0N9M+GnW1+5eHTLg=", + "dev": true, + "requires": { + "strip-bom": "^2.0.0" + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, "del": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", @@ -392,6 +1421,27 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, + "detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "detect-newline": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", + "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", + "dev": true + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, "doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", @@ -401,6 +1451,15 @@ "esutils": "^2.0.2" } }, + "domexception": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", + "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", + "dev": true, + "requires": { + "webidl-conversions": "^4.0.2" + } + }, "dot-prop": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", @@ -423,11 +1482,72 @@ "safer-buffer": "^2.1.0" } }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", + "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", + "dev": true, + "requires": { + "es-to-primitive": "^1.1.1", + "function-bind": "^1.1.1", + "has": "^1.0.1", + "is-callable": "^1.1.3", + "is-regex": "^1.0.4" + } + }, + "es-to-primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, + "escodegen": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.0.tgz", + "integrity": "sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw==", + "dev": true, + "requires": { + "esprima": "^3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "esprima": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true + } + } + }, "eslint": { "version": "5.8.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.8.0.tgz", @@ -626,6 +1746,15 @@ "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "dev": true }, + "exec-sh": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.2.2.tgz", + "integrity": "sha512-FIUCJz1RbuS0FKTdaAafAByGS0CPvU3R0MeHxgtl+djzCc//F8HakL8GzmVNZanasTbTAY/3DRFA0KpVqj/eAw==", + "dev": true, + "requires": { + "merge": "^1.2.0" + } + }, "execa": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", @@ -640,11 +1769,70 @@ "strip-eof": "^1.0.0" } }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "http://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "^2.1.0" + } + }, + "expect": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-23.6.0.tgz", + "integrity": "sha512-dgSoOHgmtn/aDGRVFWclQyPDKl2CQRq0hmIEoUAuQs/2rn2NcvCWcSCovm6BLeuB/7EZuLGu2QfnR+qRt5OM4w==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "jest-diff": "^23.6.0", + "jest-get-type": "^22.1.0", + "jest-matcher-utils": "^23.6.0", + "jest-message-util": "^23.4.0", + "jest-regex-util": "^23.3.0" + } + }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, "external-editor": { "version": "2.2.0", "resolved": "http://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", @@ -655,6 +1843,15 @@ "tmp": "^0.0.33" } }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", @@ -676,6 +1873,15 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "fb-watchman": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.0.tgz", + "integrity": "sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg=", + "dev": true, + "requires": { + "bser": "^2.0.0" + } + }, "figures": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", @@ -694,6 +1900,44 @@ "object-assign": "^4.0.1" } }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true + }, + "fileset": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/fileset/-/fileset-2.0.3.tgz", + "integrity": "sha1-jnVIqW08wjJ+5eZ0FocjozO7oqA=", + "dev": true, + "requires": { + "glob": "^7.0.3", + "minimatch": "^3.0.3" + } + }, + "fill-range": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "dev": true, + "requires": { + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, "flat-cache": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", @@ -706,6 +1950,21 @@ "write": "^0.2.1" } }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -721,6 +1980,15 @@ "mime-types": "^2.1.12" } }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, "fs-extra": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz", @@ -737,17 +2005,564 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "fsevents": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", + "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", + "dev": true, + "optional": true, + "requires": { + "nan": "^2.9.2", + "node-pre-gyp": "^0.10.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "debug": { + "version": "2.6.9", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.21", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safer-buffer": "^2.1.0" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "minipass": { + "version": "2.2.4", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "^5.1.1", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "needle": { + "version": "2.2.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "^2.1.2", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.10.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.0", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.1.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.1.10", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.7", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "^0.5.1", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-buffer": { + "version": "5.1.1", + "bundled": true, + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "dev": true, + "optional": true + }, + "semver": { + "version": "5.5.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "4.4.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "chownr": "^1.0.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.2.4", + "minizlib": "^1.1.0", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.1", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "^1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "yallist": { + "version": "3.0.2", + "bundled": true, + "dev": true + } + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, "get-stream": { "version": "3.0.0", "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -770,6 +2585,25 @@ "path-is-absolute": "^1.0.0" } }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "^2.0.0" + } + }, "global-dirs": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", @@ -829,6 +2663,32 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==" }, + "growly": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", + "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", + "dev": true + }, + "handlebars": { + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.12.tgz", + "integrity": "sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA==", + "dev": true, + "requires": { + "async": "^2.5.0", + "optimist": "^0.6.1", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -843,11 +2703,128 @@ "har-schema": "^2.0.0" } }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + } + } + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "home-or-tmp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.1" + } + }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "dev": true + }, + "html-encoding-sniffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", + "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", + "dev": true, + "requires": { + "whatwg-encoding": "^1.0.1" + } + }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -877,6 +2854,16 @@ "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=" }, + "import-local": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-1.0.0.tgz", + "integrity": "sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ==", + "dev": true, + "requires": { + "pkg-dir": "^2.0.0", + "resolve-cwd": "^2.0.0" + } + }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -924,6 +2911,57 @@ "through": "^2.3.6" } }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "^1.0.0" + } + }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "dev": true + }, "is-ci": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", @@ -932,11 +2970,96 @@ "ci-info": "^1.5.0" } }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "^2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, + "is-generator-fn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-1.0.0.tgz", + "integrity": "sha1-lp1J4bszKfa7fwkIm+JleLLd1Go=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, "is-installed-globally": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", @@ -951,6 +3074,15 @@ "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=" }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, "is-obj": { "version": "1.0.1", "resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", @@ -979,6 +3111,35 @@ "path-is-inside": "^1.0.1" } }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, "is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", @@ -989,6 +3150,15 @@ "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=" }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "^1.0.1" + } + }, "is-resolvable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", @@ -1005,21 +3175,577 @@ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.0" + } + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, + "istanbul-api": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-1.3.7.tgz", + "integrity": "sha512-4/ApBnMVeEPG3EkSzcw25wDe4N66wxwn+KKn6b47vyek8Xb3NBAcg4xfuQbS7BqcZuTX4wxfD5lVagdggR3gyA==", + "dev": true, + "requires": { + "async": "^2.1.4", + "fileset": "^2.0.2", + "istanbul-lib-coverage": "^1.2.1", + "istanbul-lib-hook": "^1.2.2", + "istanbul-lib-instrument": "^1.10.2", + "istanbul-lib-report": "^1.1.5", + "istanbul-lib-source-maps": "^1.2.6", + "istanbul-reports": "^1.5.1", + "js-yaml": "^3.7.0", + "mkdirp": "^0.5.1", + "once": "^1.4.0" + } + }, + "istanbul-lib-coverage": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz", + "integrity": "sha512-PzITeunAgyGbtY1ibVIUiV679EFChHjoMNRibEIobvmrCRaIgwLxNucOSimtNWUhEib/oO7QY2imD75JVgCJWQ==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.2.2.tgz", + "integrity": "sha512-/Jmq7Y1VeHnZEQ3TL10VHyb564mn6VrQXHchON9Jf/AEcmQ3ZIiyD1BVzNOKTZf/G3gE+kiGK6SmpF9y3qGPLw==", + "dev": true, + "requires": { + "append-transform": "^0.4.0" + } + }, + "istanbul-lib-instrument": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.2.tgz", + "integrity": "sha512-aWHxfxDqvh/ZlxR8BBaEPVSWDPUkGD63VjGQn3jcw8jCp7sHEMKcrj4xfJn/ABzdMEHiQNyvDQhqm5o8+SQg7A==", + "dev": true, + "requires": { + "babel-generator": "^6.18.0", + "babel-template": "^6.16.0", + "babel-traverse": "^6.18.0", + "babel-types": "^6.18.0", + "babylon": "^6.18.0", + "istanbul-lib-coverage": "^1.2.1", + "semver": "^5.3.0" + } + }, + "istanbul-lib-report": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-1.1.5.tgz", + "integrity": "sha512-UsYfRMoi6QO/doUshYNqcKJqVmFe9w51GZz8BS3WB0lYxAllQYklka2wP9+dGZeHYaWIdcXUx8JGdbqaoXRXzw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^1.2.1", + "mkdirp": "^0.5.1", + "path-parse": "^1.0.5", + "supports-color": "^3.1.2" + }, + "dependencies": { + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "requires": { + "has-flag": "^1.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.6.tgz", + "integrity": "sha512-TtbsY5GIHgbMsMiRw35YBHGpZ1DVFEO19vxxeiDMYaeOFOCzfnYVxvl6pOUIZR4dtPhAGpSMup8OyF8ubsaqEg==", + "dev": true, + "requires": { + "debug": "^3.1.0", + "istanbul-lib-coverage": "^1.2.1", + "mkdirp": "^0.5.1", + "rimraf": "^2.6.1", + "source-map": "^0.5.3" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "istanbul-reports": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-1.5.1.tgz", + "integrity": "sha512-+cfoZ0UXzWjhAdzosCPP3AN8vvef8XDkWtTfgaN+7L3YTpNYITnCaEkceo5SEYy644VkHka/P1FvkWvrG/rrJw==", + "dev": true, + "requires": { + "handlebars": "^4.0.3" + } + }, + "jest": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-23.6.0.tgz", + "integrity": "sha512-lWzcd+HSiqeuxyhG+EnZds6iO3Y3ZEnMrfZq/OTGvF/C+Z4fPMCdhWTGSAiO2Oym9rbEXfwddHhh6jqrTF3+Lw==", + "dev": true, + "requires": { + "import-local": "^1.0.0", + "jest-cli": "^23.6.0" + }, + "dependencies": { + "jest-cli": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-23.6.0.tgz", + "integrity": "sha512-hgeD1zRUp1E1zsiyOXjEn4LzRLWdJBV//ukAHGlx6s5mfCNJTbhbHjgxnDUXA8fsKWN/HqFFF6X5XcCwC/IvYQ==", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "glob": "^7.1.2", + "graceful-fs": "^4.1.11", + "import-local": "^1.0.0", + "is-ci": "^1.0.10", + "istanbul-api": "^1.3.1", + "istanbul-lib-coverage": "^1.2.0", + "istanbul-lib-instrument": "^1.10.1", + "istanbul-lib-source-maps": "^1.2.4", + "jest-changed-files": "^23.4.2", + "jest-config": "^23.6.0", + "jest-environment-jsdom": "^23.4.0", + "jest-get-type": "^22.1.0", + "jest-haste-map": "^23.6.0", + "jest-message-util": "^23.4.0", + "jest-regex-util": "^23.3.0", + "jest-resolve-dependencies": "^23.6.0", + "jest-runner": "^23.6.0", + "jest-runtime": "^23.6.0", + "jest-snapshot": "^23.6.0", + "jest-util": "^23.4.0", + "jest-validate": "^23.6.0", + "jest-watcher": "^23.4.0", + "jest-worker": "^23.2.0", + "micromatch": "^2.3.11", + "node-notifier": "^5.2.1", + "prompts": "^0.1.9", + "realpath-native": "^1.0.0", + "rimraf": "^2.5.4", + "slash": "^1.0.0", + "string-length": "^2.0.0", + "strip-ansi": "^4.0.0", + "which": "^1.2.12", + "yargs": "^11.0.0" + } + } + } + }, + "jest-changed-files": { + "version": "23.4.2", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-23.4.2.tgz", + "integrity": "sha512-EyNhTAUWEfwnK0Is/09LxoqNDOn7mU7S3EHskG52djOFS/z+IT0jT3h3Ql61+dklcG7bJJitIWEMB4Sp1piHmA==", + "dev": true, + "requires": { + "throat": "^4.0.0" + } + }, + "jest-config": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-23.6.0.tgz", + "integrity": "sha512-i8V7z9BeDXab1+VNo78WM0AtWpBRXJLnkT+lyT+Slx/cbP5sZJ0+NDuLcmBE5hXAoK0aUp7vI+MOxR+R4d8SRQ==", + "dev": true, + "requires": { + "babel-core": "^6.0.0", + "babel-jest": "^23.6.0", + "chalk": "^2.0.1", + "glob": "^7.1.1", + "jest-environment-jsdom": "^23.4.0", + "jest-environment-node": "^23.4.0", + "jest-get-type": "^22.1.0", + "jest-jasmine2": "^23.6.0", + "jest-regex-util": "^23.3.0", + "jest-resolve": "^23.6.0", + "jest-util": "^23.4.0", + "jest-validate": "^23.6.0", + "micromatch": "^2.3.11", + "pretty-format": "^23.6.0" + } + }, + "jest-diff": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-23.6.0.tgz", + "integrity": "sha512-Gz9l5Ov+X3aL5L37IT+8hoCUsof1CVYBb2QEkOupK64XyRR3h+uRpYIm97K7sY8diFxowR8pIGEdyfMKTixo3g==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "diff": "^3.2.0", + "jest-get-type": "^22.1.0", + "pretty-format": "^23.6.0" + } + }, + "jest-docblock": { + "version": "23.2.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-23.2.0.tgz", + "integrity": "sha1-8IXh8YVI2Z/dabICB+b9VdkTg6c=", + "dev": true, + "requires": { + "detect-newline": "^2.1.0" + } + }, + "jest-each": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-23.6.0.tgz", + "integrity": "sha512-x7V6M/WGJo6/kLoissORuvLIeAoyo2YqLOoCDkohgJ4XOXSqOtyvr8FbInlAWS77ojBsZrafbozWoKVRdtxFCg==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "pretty-format": "^23.6.0" + } + }, + "jest-environment-jsdom": { + "version": "23.4.0", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-23.4.0.tgz", + "integrity": "sha1-BWp5UrP+pROsYqFAosNox52eYCM=", + "dev": true, + "requires": { + "jest-mock": "^23.2.0", + "jest-util": "^23.4.0", + "jsdom": "^11.5.1" + } + }, + "jest-environment-node": { + "version": "23.4.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-23.4.0.tgz", + "integrity": "sha1-V+gO0IQd6jAxZ8zozXlSHeuv3hA=", + "dev": true, + "requires": { + "jest-mock": "^23.2.0", + "jest-util": "^23.4.0" + } + }, + "jest-get-type": { + "version": "22.4.3", + "resolved": "http://registry.npmjs.org/jest-get-type/-/jest-get-type-22.4.3.tgz", + "integrity": "sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w==", + "dev": true + }, + "jest-haste-map": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-23.6.0.tgz", + "integrity": "sha512-uyNhMyl6dr6HaXGHp8VF7cK6KpC6G9z9LiMNsst+rJIZ8l7wY0tk8qwjPmEghczojZ2/ZhtEdIabZ0OQRJSGGg==", + "dev": true, + "requires": { + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.1.11", + "invariant": "^2.2.4", + "jest-docblock": "^23.2.0", + "jest-serializer": "^23.0.1", + "jest-worker": "^23.2.0", + "micromatch": "^2.3.11", + "sane": "^2.0.0" + } + }, + "jest-jasmine2": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-23.6.0.tgz", + "integrity": "sha512-pe2Ytgs1nyCs8IvsEJRiRTPC0eVYd8L/dXJGU08GFuBwZ4sYH/lmFDdOL3ZmvJR8QKqV9MFuwlsAi/EWkFUbsQ==", + "dev": true, + "requires": { + "babel-traverse": "^6.0.0", + "chalk": "^2.0.1", + "co": "^4.6.0", + "expect": "^23.6.0", + "is-generator-fn": "^1.0.0", + "jest-diff": "^23.6.0", + "jest-each": "^23.6.0", + "jest-matcher-utils": "^23.6.0", + "jest-message-util": "^23.4.0", + "jest-snapshot": "^23.6.0", + "jest-util": "^23.4.0", + "pretty-format": "^23.6.0" + } + }, + "jest-leak-detector": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-23.6.0.tgz", + "integrity": "sha512-f/8zA04rsl1Nzj10HIyEsXvYlMpMPcy0QkQilVZDFOaPbv2ur71X5u2+C4ZQJGyV/xvVXtCCZ3wQ99IgQxftCg==", + "dev": true, + "requires": { + "pretty-format": "^23.6.0" + } + }, + "jest-matcher-utils": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-23.6.0.tgz", + "integrity": "sha512-rosyCHQfBcol4NsckTn01cdelzWLU9Cq7aaigDf8VwwpIRvWE/9zLgX2bON+FkEW69/0UuYslUe22SOdEf2nog==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "jest-get-type": "^22.1.0", + "pretty-format": "^23.6.0" + } + }, + "jest-message-util": { + "version": "23.4.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-23.4.0.tgz", + "integrity": "sha1-F2EMUJQjSVCNAaPR4L2iwHkIap8=", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0-beta.35", + "chalk": "^2.0.1", + "micromatch": "^2.3.11", + "slash": "^1.0.0", + "stack-utils": "^1.0.1" + } + }, + "jest-mock": { + "version": "23.2.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-23.2.0.tgz", + "integrity": "sha1-rRxg8p6HGdR8JuETgJi20YsmETQ=", + "dev": true + }, + "jest-regex-util": { + "version": "23.3.0", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-23.3.0.tgz", + "integrity": "sha1-X4ZylUfCeFxAAs6qj4Sf6MpHG8U=", + "dev": true + }, + "jest-resolve": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-23.6.0.tgz", + "integrity": "sha512-XyoRxNtO7YGpQDmtQCmZjum1MljDqUCob7XlZ6jy9gsMugHdN2hY4+Acz9Qvjz2mSsOnPSH7skBmDYCHXVZqkA==", + "dev": true, + "requires": { + "browser-resolve": "^1.11.3", + "chalk": "^2.0.1", + "realpath-native": "^1.0.0" + } + }, + "jest-resolve-dependencies": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-23.6.0.tgz", + "integrity": "sha512-EkQWkFWjGKwRtRyIwRwI6rtPAEyPWlUC2MpzHissYnzJeHcyCn1Hc8j7Nn1xUVrS5C6W5+ZL37XTem4D4pLZdA==", + "dev": true, + "requires": { + "jest-regex-util": "^23.3.0", + "jest-snapshot": "^23.6.0" + } + }, + "jest-runner": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-23.6.0.tgz", + "integrity": "sha512-kw0+uj710dzSJKU6ygri851CObtCD9cN8aNkg8jWJf4ewFyEa6kwmiH/r/M1Ec5IL/6VFa0wnAk6w+gzUtjJzA==", + "dev": true, + "requires": { + "exit": "^0.1.2", + "graceful-fs": "^4.1.11", + "jest-config": "^23.6.0", + "jest-docblock": "^23.2.0", + "jest-haste-map": "^23.6.0", + "jest-jasmine2": "^23.6.0", + "jest-leak-detector": "^23.6.0", + "jest-message-util": "^23.4.0", + "jest-runtime": "^23.6.0", + "jest-util": "^23.4.0", + "jest-worker": "^23.2.0", + "source-map-support": "^0.5.6", + "throat": "^4.0.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-support": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz", + "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + } + } + }, + "jest-runtime": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-23.6.0.tgz", + "integrity": "sha512-ycnLTNPT2Gv+TRhnAYAQ0B3SryEXhhRj1kA6hBPSeZaNQkJ7GbZsxOLUkwg6YmvWGdX3BB3PYKFLDQCAE1zNOw==", + "dev": true, + "requires": { + "babel-core": "^6.0.0", + "babel-plugin-istanbul": "^4.1.6", + "chalk": "^2.0.1", + "convert-source-map": "^1.4.0", + "exit": "^0.1.2", + "fast-json-stable-stringify": "^2.0.0", + "graceful-fs": "^4.1.11", + "jest-config": "^23.6.0", + "jest-haste-map": "^23.6.0", + "jest-message-util": "^23.4.0", + "jest-regex-util": "^23.3.0", + "jest-resolve": "^23.6.0", + "jest-snapshot": "^23.6.0", + "jest-util": "^23.4.0", + "jest-validate": "^23.6.0", + "micromatch": "^2.3.11", + "realpath-native": "^1.0.0", + "slash": "^1.0.0", + "strip-bom": "3.0.0", + "write-file-atomic": "^2.1.0", + "yargs": "^11.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, + "jest-serializer": { + "version": "23.0.1", + "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-23.0.1.tgz", + "integrity": "sha1-o3dq6zEekP6D+rnlM+hRAr0WQWU=", + "dev": true + }, + "jest-snapshot": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-23.6.0.tgz", + "integrity": "sha512-tM7/Bprftun6Cvj2Awh/ikS7zV3pVwjRYU2qNYS51VZHgaAMBs5l4o/69AiDHhQrj5+LA2Lq4VIvK7zYk/bswg==", + "dev": true, + "requires": { + "babel-types": "^6.0.0", + "chalk": "^2.0.1", + "jest-diff": "^23.6.0", + "jest-matcher-utils": "^23.6.0", + "jest-message-util": "^23.4.0", + "jest-resolve": "^23.6.0", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "pretty-format": "^23.6.0", + "semver": "^5.5.0" + } + }, + "jest-util": { + "version": "23.4.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-23.4.0.tgz", + "integrity": "sha1-TQY8uSe68KI4Mf9hvsLLv0l5NWE=", + "dev": true, + "requires": { + "callsites": "^2.0.0", + "chalk": "^2.0.1", + "graceful-fs": "^4.1.11", + "is-ci": "^1.0.10", + "jest-message-util": "^23.4.0", + "mkdirp": "^0.5.1", + "slash": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "callsites": { + "version": "2.0.0", + "resolved": "http://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "jest-validate": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-23.6.0.tgz", + "integrity": "sha512-OFKapYxe72yz7agrDAWi8v2WL8GIfVqcbKRCLbRG9PAxtzF9b1SEDdTpytNDN12z2fJynoBwpMpvj2R39plI2A==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "jest-get-type": "^22.1.0", + "leven": "^2.1.0", + "pretty-format": "^23.6.0" + } + }, + "jest-watcher": { + "version": "23.4.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-23.4.0.tgz", + "integrity": "sha1-0uKM50+NrWxq/JIrksq+9u0FyRw=", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.1", + "string-length": "^2.0.0" + } + }, + "jest-worker": { + "version": "23.2.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-23.2.0.tgz", + "integrity": "sha1-+vcGqNo2+uYOsmlXJX+ntdjqArk=", + "dev": true, + "requires": { + "merge-stream": "^1.0.1" + } + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -1041,6 +3767,54 @@ "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" }, + "jsdom": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz", + "integrity": "sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==", + "dev": true, + "requires": { + "abab": "^2.0.0", + "acorn": "^5.5.3", + "acorn-globals": "^4.1.0", + "array-equal": "^1.0.0", + "cssom": ">= 0.3.2 < 0.4.0", + "cssstyle": "^1.0.0", + "data-urls": "^1.0.0", + "domexception": "^1.0.1", + "escodegen": "^1.9.1", + "html-encoding-sniffer": "^1.0.2", + "left-pad": "^1.3.0", + "nwsapi": "^2.0.7", + "parse5": "4.0.0", + "pn": "^1.1.0", + "request": "^2.87.0", + "request-promise-native": "^1.0.5", + "sax": "^1.2.4", + "symbol-tree": "^3.2.2", + "tough-cookie": "^2.3.4", + "w3c-hr-time": "^1.0.1", + "webidl-conversions": "^4.0.2", + "whatwg-encoding": "^1.0.3", + "whatwg-mimetype": "^2.1.0", + "whatwg-url": "^6.4.1", + "ws": "^5.2.0", + "xml-name-validator": "^3.0.0" + }, + "dependencies": { + "acorn": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", + "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "dev": true + } + } + }, + "jsesc": { + "version": "1.3.0", + "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true + }, "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", @@ -1062,6 +3836,12 @@ "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, + "json5": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -1081,6 +3861,21 @@ "verror": "1.10.0" } }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "kleur": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-2.0.2.tgz", + "integrity": "sha512-77XF9iTllATmG9lSlIv0qdQ2BQ/h9t0bJllHlbvsQ0zUWfU7Yi0S8L5JXzPZgkefIiajLmBJJ4BsMJmqcf7oxQ==", + "dev": true + }, "latest-version": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-3.1.0.tgz", @@ -1089,6 +3884,27 @@ "package-json": "^4.0.0" } }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "left-pad": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", + "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==", + "dev": true + }, + "leven": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", + "integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=", + "dev": true + }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -1099,11 +3915,48 @@ "type-check": "~0.3.2" } }, + "load-json-file": { + "version": "1.1.0", + "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, "lodash": { "version": "4.17.11", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" }, + "lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", + "dev": true + }, "log-symbols": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", @@ -1112,6 +3965,15 @@ "chalk": "^2.0.1" } }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, "lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", @@ -1134,6 +3996,81 @@ "pify": "^3.0.0" } }, + "makeerror": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz", + "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=", + "dev": true, + "requires": { + "tmpl": "1.0.x" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "math-random": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", + "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", + "dev": true + }, + "mem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "merge": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.1.tgz", + "integrity": "sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ==", + "dev": true + }, + "merge-stream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", + "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", + "dev": true, + "requires": { + "readable-stream": "^2.0.1" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + }, "mime-db": { "version": "1.37.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", @@ -1166,6 +4103,27 @@ "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, "mkdirp": { "version": "0.5.1", "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", @@ -1194,6 +4152,52 @@ "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=" }, + "nan": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", + "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==", + "dev": true, + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -1206,6 +4210,45 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, + "node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "dev": true + }, + "node-notifier": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.3.0.tgz", + "integrity": "sha512-AhENzCSGZnZJgBARsUjnQ7DnZbzyP+HxlVXuD0xqAnvL8q+OqtSX7lGg9e8nHzwXkMMXNdVeqq4E2M3EUAqX6Q==", + "dev": true, + "requires": { + "growly": "^1.3.0", + "semver": "^5.5.0", + "shellwords": "^0.1.1", + "which": "^1.3.0" + } + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, "npm-run-path": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", @@ -1214,6 +4257,18 @@ "path-key": "^2.0.0" } }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "nwsapi": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.0.9.tgz", + "integrity": "sha512-nlWFSCTYQcHk/6A9FFnfhKc14c3aFhfdNBXgo8Qgi9QTBu/qg3Ww+Uiz9wMzXd1T8GFxPc2QIHB6Qtf2XFryFQ==", + "dev": true + }, "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", @@ -1225,6 +4280,88 @@ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "object-keys": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", + "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", + "dev": true + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "object.getownpropertydescriptors": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", + "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.5.1" + } + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "requires": { + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -1242,6 +4379,30 @@ "mimic-fn": "^1.0.0" } }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + }, + "dependencies": { + "minimist": { + "version": "0.0.10", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + } + } + }, "optionator": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", @@ -1267,6 +4428,23 @@ "log-symbols": "^2.1.0" } }, + "os-homedir": { + "version": "1.0.2", + "resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "dev": true, + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + } + }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -1277,6 +4455,30 @@ "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, "package-json": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz", @@ -1288,6 +4490,45 @@ "semver": "^5.1.0" } }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "parse5": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", + "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", + "dev": true + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -1304,6 +4545,31 @@ "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -1329,12 +4595,33 @@ "pinkie": "^2.0.0" } }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + }, "pluralize": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", "dev": true }, + "pn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", + "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", + "dev": true + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -1346,17 +4633,55 @@ "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, "prettier": { "version": "1.14.3", "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.14.3.tgz", "integrity": "sha512-qZDVnCrnpsRJJq5nSsiHCE3BYMED2OtsI+cmzIzF1QIfqm5ALf8tEJcO27zV1gKNKRPdhjO0dNWnrzssDQ1tFg==", "dev": true }, + "pretty-format": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-23.6.0.tgz", + "integrity": "sha512-zf9NV1NSlDLDjycnwm6hpFATCGl/K1lt0R/GdkAK2O5LN/rwJoB+Mh93gGJjut4YbmecbfgLWVGSTCr0Ewvvbw==", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0", + "ansi-styles": "^3.2.0" + } + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, "progress": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.1.tgz", "integrity": "sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg==" }, + "prompts": { + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-0.1.14.tgz", + "integrity": "sha512-rxkyiE9YH6zAz/rZpywySLKkpaj0NMVyNw1qhsubdbjjSgcayjTShDreZGlFMcGSu5sab3bAKPfFk78PB90+8w==", + "dev": true, + "requires": { + "kleur": "^2.0.1", + "sisteransi": "^0.1.1" + } + }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", @@ -1377,6 +4702,31 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, + "randomatic": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", + "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", + "dev": true, + "requires": { + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, "rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -1388,6 +4738,97 @@ "strip-json-comments": "~2.0.1" } }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + } + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "realpath-native": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/realpath-native/-/realpath-native-1.0.2.tgz", + "integrity": "sha512-+S3zTvVt9yTntFrBpm7TQmQ3tzpCrnA1a/y+3cUHAc9ZR6aIjG0WNLR+Rj79QpJktY+VeW/TQtFlQ1bzsehI8g==", + "dev": true, + "requires": { + "util.promisify": "^1.0.0" + } + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "^0.1.3" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, "regexpp": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", @@ -1411,6 +4852,33 @@ "rc": "^1.0.1" } }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, "request": { "version": "2.88.0", "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", @@ -1457,6 +4925,29 @@ "lodash": "^4.13.1" } }, + "request-promise-native": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.5.tgz", + "integrity": "sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU=", + "dev": true, + "requires": { + "request-promise-core": "1.1.1", + "stealthy-require": "^1.1.0", + "tough-cookie": ">=2.3.3" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, "require-uncached": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", @@ -1467,12 +4958,41 @@ "resolve-from": "^1.0.0" } }, + "resolve": { + "version": "1.1.7", + "resolved": "http://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + }, + "resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "dev": true, + "requires": { + "resolve-from": "^3.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + } + } + }, "resolve-from": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", "dev": true }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, "restore-cursor": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", @@ -1482,6 +5002,12 @@ "signal-exit": "^3.0.2" } }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, "rimraf": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", @@ -1491,6 +5017,12 @@ "glob": "^7.0.5" } }, + "rsvp": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-3.6.2.tgz", + "integrity": "sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw==", + "dev": true + }, "run-async": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", @@ -1526,11 +5058,334 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, + "safe-regex": { + "version": "1.1.0", + "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, + "sane": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/sane/-/sane-2.5.2.tgz", + "integrity": "sha1-tNwYYcIbQn6SlQej51HiosuKs/o=", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "capture-exit": "^1.2.0", + "exec-sh": "^0.2.0", + "fb-watchman": "^2.0.0", + "fsevents": "^1.2.3", + "micromatch": "^3.1.4", + "minimist": "^1.1.1", + "walker": "~1.0.5", + "watch": "~0.18.0" + }, + "dependencies": { + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, "semver": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", @@ -1544,6 +5399,35 @@ "semver": "^5.0.3" } }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -1557,11 +5441,29 @@ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" }, + "shellwords": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", + "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", + "dev": true + }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, + "sisteransi": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-0.1.1.tgz", + "integrity": "sha512-PmGOd02bM9YO5ifxpw36nrNMBTptEtfRl4qUYl9SndkolplkrZZOW7PGHjrZL53QvMVj9nQ+TKqUnRsw4tJa4g==", + "dev": true + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + }, "slice-ansi": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", @@ -1571,6 +5473,204 @@ "is-fullwidth-code-point": "^2.0.0" } }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dev": true, + "requires": { + "source-map": "^0.5.6" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.2.tgz", + "integrity": "sha512-qky9CVt0lVIECkEsYbNILVnPvycuEBkXoMFLRWsREkomQLevYhtRKC+R91a5TOAQ3bCMjikRwhyaRqj1VYatYg==", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -1593,11 +5693,48 @@ "tweetnacl": "~0.14.0" } }, + "stack-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.2.tgz", + "integrity": "sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA==", + "dev": true + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, "stealthy-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=" }, + "string-length": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-2.0.0.tgz", + "integrity": "sha1-1A27aGo6zpYMHP/KVivyxF+DY+0=", + "dev": true, + "requires": { + "astral-regex": "^1.0.0", + "strip-ansi": "^4.0.0" + } + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -1607,6 +5744,15 @@ "strip-ansi": "^4.0.0" } }, + "string_decoder": { + "version": "1.1.1", + "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", @@ -1615,6 +5761,15 @@ "ansi-regex": "^3.0.0" } }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + }, "strip-eof": { "version": "1.0.0", "resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", @@ -1633,6 +5788,12 @@ "has-flag": "^3.0.0" } }, + "symbol-tree": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", + "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", + "dev": true + }, "table": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/table/-/table-5.1.0.tgz", @@ -1679,12 +5840,31 @@ "execa": "^0.7.0" } }, + "test-exclude": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-4.2.3.tgz", + "integrity": "sha512-SYbXgY64PT+4GAL2ocI3HwPa4Q4TBKm0cwAVeKOt/Aoc0gSpNRjJX8w0pA1LMKZ3LBmd8pYBqApFNQLII9kavA==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "micromatch": "^2.3.11", + "object-assign": "^4.1.0", + "read-pkg-up": "^1.0.1", + "require-main-filename": "^1.0.1" + } + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, + "throat": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/throat/-/throat-4.1.0.tgz", + "integrity": "sha1-iQN8vJLFarGJJua6TLsgDhVnKmo=", + "dev": true + }, "through": { "version": "2.3.8", "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -1703,6 +5883,60 @@ "os-tmpdir": "~1.0.2" } }, + "tmpl": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", + "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=", + "dev": true + }, + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + } + } + }, "tough-cookie": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", @@ -1712,6 +5946,29 @@ "punycode": "^1.4.1" } }, + "tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "dev": true, + "requires": { + "punycode": "^2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + } + } + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, "tslib": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", @@ -1740,6 +5997,68 @@ "prelude-ls": "~1.1.2" } }, + "uglify-js": { + "version": "3.4.9", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", + "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", + "dev": true, + "optional": true, + "requires": { + "commander": "~2.17.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "commander": { + "version": "2.17.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", + "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", + "dev": true, + "optional": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "optional": true + } + } + }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + } + } + } + }, "unique-string": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", @@ -1753,6 +6072,52 @@ "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, "unzip-response": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz", @@ -1792,6 +6157,12 @@ } } }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, "url-parse-lax": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", @@ -1800,11 +6171,43 @@ "prepend-http": "^1.0.1" } }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "util.promisify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", + "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "object.getownpropertydescriptors": "^2.0.3" + } + }, "uuid": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", @@ -1815,6 +6218,66 @@ "extsprintf": "^1.2.0" } }, + "w3c-hr-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", + "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", + "dev": true, + "requires": { + "browser-process-hrtime": "^0.1.2" + } + }, + "walker": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz", + "integrity": "sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=", + "dev": true, + "requires": { + "makeerror": "1.0.x" + } + }, + "watch": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/watch/-/watch-0.18.0.tgz", + "integrity": "sha1-KAlUdsbffJDJYxOJkMClQj60uYY=", + "dev": true, + "requires": { + "exec-sh": "^0.2.0", + "minimist": "^1.2.0" + } + }, + "webidl-conversions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "dev": true + }, + "whatwg-encoding": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", + "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", + "dev": true, + "requires": { + "iconv-lite": "0.4.24" + } + }, + "whatwg-mimetype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", + "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", + "dev": true + }, + "whatwg-url": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.5.0.tgz", + "integrity": "sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -1823,6 +6286,12 @@ "isexe": "^2.0.0" } }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, "widest-line": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", @@ -1837,6 +6306,53 @@ "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -1862,15 +6378,65 @@ "signal-exit": "^3.0.2" } }, + "ws": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", + "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", + "dev": true, + "requires": { + "async-limiter": "~1.0.0" + } + }, "xdg-basedir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=" }, + "xml-name-validator": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", + "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "dev": true + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + }, "yallist": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + }, + "yargs": { + "version": "11.1.0", + "resolved": "http://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz", + "integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^9.0.2" + } + }, + "yargs-parser": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", + "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", + "dev": true, + "requires": { + "camelcase": "^4.1.0" + } } } } diff --git a/app-cli/package.json b/app-cli/package.json index 108796a..edacf1e 100644 --- a/app-cli/package.json +++ b/app-cli/package.json @@ -4,7 +4,7 @@ "description": "CLI tool for CaptainDuckDuck. See CaptainDuckDuck.com for more details.", "main": "captainduckduck.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "jest" }, "bin": { "captainduckduck": "./captainduckduck.js" @@ -50,6 +50,7 @@ "devDependencies": { "eslint": "^5.8.0", "eslint-plugin-jest": "^21.26.2", + "jest": "^23.6.0", "prettier": "^1.14.3" } } diff --git a/app-cli/utils/__tests__/loginHelpers.test.js b/app-cli/utils/__tests__/loginHelpers.test.js new file mode 100644 index 0000000..834e0c7 --- /dev/null +++ b/app-cli/utils/__tests__/loginHelpers.test.js @@ -0,0 +1,48 @@ +const { + cleanUpUrl, + findDefaultCaptainName, + isSuffixValid, + getCaptainFullName +} = require("../loginHelpers") + +jest.mock("../../helpers/MachineHelper", () => { + return { + machines: [ + { + baseUrl: "https://captain.myfirstmachine.com", + name: "machine-01", + authToken: "token1" + }, + { + baseUrl: "https://captain.mysecondmachine.com", + name: "machine-02", + authToken: "token2" + } + ] + } +}) + +describe("Login helpers", () => { + it("should clean a url", () => { + const mockUrl = "https://www.google.com" + const expectedResult = "www.google.com" + const result = cleanUpUrl(mockUrl) + + expect(result).toBe(expectedResult) + }) + + it("should get a captain machine name", () => { + const result = getCaptainFullName(1) + const expectedResult = "captain-01" + + expect(result).toBe(expectedResult) + }) + + it("should find an unused name for a possible new captain machine", () => { + // If machines are 2, then it should be with suffix 03 + const result = findDefaultCaptainName() + const expectedResult = "captain-03" + + expect(result).toBe(expectedResult) + }) +}) diff --git a/app-cli/utils/fileHelper.js b/app-cli/utils/fileHelper.js index ed7c4ed..3b464be 100644 --- a/app-cli/utils/fileHelper.js +++ b/app-cli/utils/fileHelper.js @@ -8,9 +8,8 @@ const { const SpinnerHelper = require("../helpers/SpinnerHelper") const { exec } = require("child_process") const ProgressBar = require("progress") -const ora = require("ora") const DeployApi = require("../api/DeployApi") -const MachineHelper = require("../helpers/MachineHelper") +const { saveMachineToLocalStorage } = require("../utils/machineUtils") let lastLineNumberPrinted = -10000 // we want to show all lines to begin with! function gitArchiveFile(zipFileFullPath, branchToPush) { @@ -63,7 +62,7 @@ function onLogRetrieved(data) { lastLineNumberPrinted = firstLineNumberOfLogs + lines.length - for (var i = firstLinesToPrint; i < lines.length; i++) { + for (let i = firstLinesToPrint; i < lines.length; i++) { printMessage((lines[i] || "").trim()) } } @@ -133,42 +132,6 @@ function getFileStream(zipFileFullPath) { return fileStream } -// Saves the app directory into local storage -function saveMachineToLocalStorage() { - const apps = MachineHelper.apps - const currentDirectory = process.cwd() - let appExists = false - - // Update app - apps.map(app => { - if (app.cwd === currentDirectory) { - appExists = true - - return { - cwd: app.cwd, - appName: DeployApi.appName, - branchToPush: DeployApi.branchToPush, - machineToDeploy: DeployApi.machineToDeploy - } - } - - return app - }) - - if (!appExists) { - const newApp = { - cwd: process.cwd(), - appName: DeployApi.appName, - branchToPush: DeployApi.branchToPush, - machineToDeploy: DeployApi.machineToDeploy - } - - apps.push(newApp) - - MachineHelper.setApps(apps) - } -} - async function uploadFile(filePath, gitHash) { try { printMessage(`Uploading file to ${DeployApi.machineToDeploy.baseUrl}`) diff --git a/app-cli/utils/loginHelpers.js b/app-cli/utils/loginHelpers.js index 6190357..187c417 100644 --- a/app-cli/utils/loginHelpers.js +++ b/app-cli/utils/loginHelpers.js @@ -20,25 +20,27 @@ function cleanUpUrl(url) { function findDefaultCaptainName() { let currentSuffix = MachineHelper.machines.length + 1 - while (!_isSuffixValid(currentSuffix)) { + while (!isSuffixValid(currentSuffix)) { currentSuffix++ } - return _getCaptainFullName(currentSuffix) + return getCaptainFullName(currentSuffix) } -function _getCaptainFullName(suffix) { +function getCaptainFullName(suffix) { const formatSuffix = suffix < 10 ? `0${suffix}` : suffix return `captain-${formatSuffix}` } -const _isSuffixValid = suffixNumber => +const isSuffixValid = suffixNumber => MachineHelper.machines.map(machine => { - machine.name !== _getCaptainFullName(suffixNumber) + machine.name !== getCaptainFullName(suffixNumber) }) module.exports = { cleanUpUrl, - findDefaultCaptainName + findDefaultCaptainName, + isSuffixValid, + getCaptainFullName } diff --git a/app-cli/utils/machineUtils.js b/app-cli/utils/machineUtils.js new file mode 100644 index 0000000..8de2b2f --- /dev/null +++ b/app-cli/utils/machineUtils.js @@ -0,0 +1,55 @@ +const DeployApi = require("../api/DeployApi") +const MachineHelper = require("../helpers/MachineHelper") + +function initMachineFromLocalStorage() { + const possibleApp = MachineHelper.apps.find(app => app.cwd === process.cwd()) + + if (possibleApp) { + DeployApi.setMachineToDeploy(possibleApp.machineToDeploy) + + DeployApi.setAppName(possibleApp.appName) + + DeployApi.setBranchToPush(possibleApp.branchToPush) + } +} + +// Saves the app directory into local storage +function saveMachineToLocalStorage() { + const apps = MachineHelper.apps + const currentDirectory = process.cwd() + let appExists = false + + // Update app + apps.map(app => { + if (app.cwd === currentDirectory) { + appExists = true + + return { + cwd: app.cwd, + appName: DeployApi.appName, + branchToPush: DeployApi.branchToPush, + machineToDeploy: DeployApi.machineToDeploy + } + } + + return app + }) + + if (!appExists) { + const newApp = { + cwd: process.cwd(), + appName: DeployApi.appName, + branchToPush: DeployApi.branchToPush, + machineToDeploy: DeployApi.machineToDeploy + } + + apps.push(newApp) + + MachineHelper.setApps(apps) + } +} + +module.exports = { + initMachineFromLocalStorage, + saveMachineToLocalStorage +} From 38ff3077cbbee40cafbeaa6df4b9679d1b8336ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Trevi=C3=B1o?= Date: Tue, 11 Dec 2018 20:18:47 +0100 Subject: [PATCH 17/44] Refactor on validateAuthentication method --- app-cli/lib/deploy.js | 13 +++---------- app-cli/utils/validationsHandler.js | 4 ++++ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/app-cli/lib/deploy.js b/app-cli/lib/deploy.js index db7e58a..5b71f03 100644 --- a/app-cli/lib/deploy.js +++ b/app-cli/lib/deploy.js @@ -22,9 +22,6 @@ async function deployAsDefaultValues() { const isValidAuthentication = await validateAuthentication() if (isValidAuthentication) { - // REFACTOR - Refresh token in DeployApi - initMachineFromLocalStorage() - const { appName, branchToPush, machineToDeploy } = DeployApi if (!appName || !branchToPush || !machineToDeploy) { @@ -60,9 +57,6 @@ async function deployAsStateless(host, appName, branch, pass) { // Update the token to the machine that corresponds (if needed) MachineHelper.updateMachineAuthToken(name, newToken) - // REFACTOR - Refresh token in DeployApi - initMachineFromLocalStorage() - if (data) { printMessage( `Starting stateless deploy to\n${host}\n${branch}\n${appName}` @@ -207,13 +201,12 @@ async function deploy(options) { const isValidAuthentication = await validateAuthentication() if (isValidAuthentication) { - // REFACTOR - Refresh token in DeployApi - initMachineFromLocalStorage() - deployFromGitProject() + } else { + printError("Incorrect login details", true) } } catch (e) { - printError("Incorrect login details", true) + printError(e.message, true) } } } diff --git a/app-cli/utils/validationsHandler.js b/app-cli/utils/validationsHandler.js index 95b531e..e580135 100644 --- a/app-cli/utils/validationsHandler.js +++ b/app-cli/utils/validationsHandler.js @@ -2,6 +2,7 @@ const fs = require("fs-extra") const DeployApi = require("../api/DeployApi") const { printError } = require("./messageHandler") const { requestLogin } = require("../lib/login") +const { initMachineFromLocalStorage } = require("../utils/machineUtils") function validateIsGitRepository() { const gitFolderExists = fs.pathExistsSync("./.git") @@ -89,6 +90,9 @@ async function validateAuthentication() { if (!isAuthenticated) { const loggedInStatus = await requestLogin() + // Refresh token in DeployApi + initMachineFromLocalStorage() + return loggedInStatus } else { return Boolean(isAuthenticated) From 766901911effa00b0f55a485bbcad19c9467b51a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Trevi=C3=B1o?= Date: Fri, 14 Dec 2018 10:45:49 +0100 Subject: [PATCH 18/44] Finish adding tests for utils --- app-cli/lib/deploy.js | 10 +- app-cli/utils/__tests__/machineUtils.js | 71 ++++++++++++++ .../__tests__/validationsHandler.test.js | 92 +++++++++++++++++++ app-cli/utils/fileHelper.js | 4 +- app-cli/utils/machineUtils.js | 7 +- app-cli/utils/validationsHandler.js | 41 +++++---- 6 files changed, 196 insertions(+), 29 deletions(-) create mode 100644 app-cli/utils/__tests__/machineUtils.js create mode 100644 app-cli/utils/__tests__/validationsHandler.test.js diff --git a/app-cli/lib/deploy.js b/app-cli/lib/deploy.js index 5b71f03..dac3cca 100644 --- a/app-cli/lib/deploy.js +++ b/app-cli/lib/deploy.js @@ -6,7 +6,7 @@ const { printError, printMessage } = require("../utils/messageHandler") const { validateIsGitRepository, validateDefinitionFile, - optionIsGiven, + optionIsNotGiven, validateAuthentication } = require("../utils/validationsHandler") const { uploadFile } = require("../utils/fileHelper") @@ -149,14 +149,14 @@ async function deploy(options) { default: DeployApi.machineToDeploy.name || "", message: "Select the Captain Machine you want to deploy to:", choices: MachineHelper.getMachinesAsOptions(), - when: () => optionIsGiven(options, "host") + when: () => optionIsNotGiven(options, "host") }, { type: "input", default: DeployApi.branchToPush || "master", name: "branchToPush", message: "Enter the 'git' branch you would like to deploy:", - when: () => optionIsGiven(options, "branch") + when: () => optionIsNotGiven(options, "branch") }, { type: "input", @@ -164,7 +164,7 @@ async function deploy(options) { name: "appName", message: "Enter the Captain app name this directory will be deployed to:", - when: () => optionIsGiven(options, "appName") + when: () => optionIsNotGiven(options, "appName") }, { type: "confirm", @@ -172,7 +172,7 @@ async function deploy(options) { message: "Note that uncommitted files and files in gitignore (if any) will not be pushed to server. Please confirm so that deployment process can start.", default: true, - when: () => optionIsGiven(options, "stateless") + when: () => optionIsNotGiven(options, "stateless") } ] const answers = await inquirer.prompt(questions) diff --git a/app-cli/utils/__tests__/machineUtils.js b/app-cli/utils/__tests__/machineUtils.js new file mode 100644 index 0000000..f1246fa --- /dev/null +++ b/app-cli/utils/__tests__/machineUtils.js @@ -0,0 +1,71 @@ +const { + initMachineFromLocalStorage, + saveMachineToLocalStorage +} = require("../machineUtils") +const DeployApi = require("../../api/DeployApi") +const MachineHelper = require("../../helpers/MachineHelper") +const mockUpdatedApps = [ + { + cwd: process.cwd(), + appName: "captain-node-app-new-name", + branchToPush: "master", + machineToDeploy: { + baseUrl: "https://int-test.captainduckduck.com", + name: "int-test", + authToken: "token1" + } + } +] + +jest.mock("../../helpers/MachineHelper", () => { + return { + apps: [ + { + cwd: process.cwd(), + appName: "captain-node-app", + branchToPush: "master", + machineToDeploy: { + baseUrl: "https://int-test.captainduckduck.com", + name: "int-test", + authToken: "token1" + } + } + ], + setApps: jest.fn() + } +}) + +jest.mock("../../api/DeployApi", () => { + return { + setMachineToDeploy: jest.fn(), + setAppName: jest.fn(), + setBranchToPush: jest.fn(), + appName: "captain-node-app-new-name", + branchToPush: "master", + machineToDeploy: { + baseUrl: "https://int-test.captainduckduck.com", + name: "int-test", + authToken: "token1" + } + } +}) + +describe("Machine utils", () => { + it("should init machine from localStorage", () => { + initMachineFromLocalStorage() + + expect(DeployApi.setMachineToDeploy).toHaveBeenCalledTimes(1) + + expect(DeployApi.setAppName).toHaveBeenCalledTimes(1) + + expect(DeployApi.setBranchToPush).toHaveBeenCalledTimes(1) + }) + + it("should update an app from localstorage", () => { + saveMachineToLocalStorage() + + const updatedApps = mockUpdatedApps + + expect(MachineHelper.setApps).toBeCalledWith(updatedApps) + }) +}) diff --git a/app-cli/utils/__tests__/validationsHandler.test.js b/app-cli/utils/__tests__/validationsHandler.test.js new file mode 100644 index 0000000..6416636 --- /dev/null +++ b/app-cli/utils/__tests__/validationsHandler.test.js @@ -0,0 +1,92 @@ +const { + validateIsGitRepository, + validateDefinitionFile, + optionIsNotGiven, + isIpAddress, + validateAuthentication +} = require("../validationsHandler") +const { printError } = require("../messageHandler") +const { requestLogin } = require("../../lib/login") +const { initMachineFromLocalStorage } = require("../machineUtils") + +jest.mock("fs") + +jest.mock("../messageHandler", () => { + return { + printError: jest.fn() + } +}) + +jest.mock("../../api/DeployApi", () => { + return { + isAuthTokenValid: jest.fn(() => false) // Simulates it's not authenticated + } +}) + +jest.mock("../../lib/login", () => { + return { + requestLogin: jest.fn() + } +}) + +jest.mock("../machineUtils", () => { + return { + initMachineFromLocalStorage: jest.fn() + } +}) + +describe("Validations handler", () => { + it("should printError if not on a git repository", () => { + validateIsGitRepository() + + expect(printError).toHaveBeenCalledTimes(1) + }) + + it("should printError if there is no captain definition file", () => { + validateDefinitionFile() + + // 2nd time because file was not found + // 3rd time because it tried to read from a file and was not valid json + expect(printError).toHaveBeenCalledTimes(3) + }) + + it("should return false if the option is included", () => { + const options = { + branch: "master" + } + const result = optionIsNotGiven(options, "branch") + + expect(result).toBe(false) + }) + + it("should return true if the option is not given", () => { + const options = { + test: "something" + } + const result = optionIsNotGiven(options, "branch") + + expect(result).toBe(true) + }) + + it("should be a valid IP Address", () => { + const validIpAddress = "192.168.1.1" + const result = isIpAddress(validIpAddress) + + expect(result).toBe(true) + }) + + it("should be an invalid IP Address", () => { + const validIpAddress = "192.168.1" + const result = isIpAddress(validIpAddress) + + expect(result).toBe(false) + }) + + it("should promt the login option and initialize from the machine in localstorage", async () => { + await validateAuthentication() + + expect(requestLogin).toBeCalledTimes(1) + + expect(initMachineFromLocalStorage).toBeCalledTimes(1) + }) +}) diff --git a/app-cli/utils/fileHelper.js b/app-cli/utils/fileHelper.js index 3b464be..497888c 100644 --- a/app-cli/utils/fileHelper.js +++ b/app-cli/utils/fileHelper.js @@ -95,7 +95,6 @@ async function startFetchingBuildLogs() { if (response.status !== 100) { throw new Error(JSON.stringify(response, null, 2)) } - onLogRetrieved(response.data) } catch (error) { printError(`\nSomething while retrieving app build logs.. ${error}\n`) @@ -173,5 +172,6 @@ function deleteFileFromDisk(filePath) { module.exports = { gitArchiveFile, getFileStream, - uploadFile + uploadFile, + startFetchingBuildLogs } diff --git a/app-cli/utils/machineUtils.js b/app-cli/utils/machineUtils.js index 8de2b2f..53b27a7 100644 --- a/app-cli/utils/machineUtils.js +++ b/app-cli/utils/machineUtils.js @@ -18,9 +18,8 @@ function saveMachineToLocalStorage() { const apps = MachineHelper.apps const currentDirectory = process.cwd() let appExists = false - // Update app - apps.map(app => { + const updatedApps = apps.map(app => { if (app.cwd === currentDirectory) { appExists = true @@ -35,6 +34,8 @@ function saveMachineToLocalStorage() { return app }) + MachineHelper.setApps(updatedApps) + if (!appExists) { const newApp = { cwd: process.cwd(), @@ -43,7 +44,7 @@ function saveMachineToLocalStorage() { machineToDeploy: DeployApi.machineToDeploy } - apps.push(newApp) + updatedApps.push(newApp) MachineHelper.setApps(apps) } diff --git a/app-cli/utils/validationsHandler.js b/app-cli/utils/validationsHandler.js index e580135..ad8fa58 100644 --- a/app-cli/utils/validationsHandler.js +++ b/app-cli/utils/validationsHandler.js @@ -37,30 +37,33 @@ function validateDefinitionFile() { ) } - if (!contentsJson.schemaVersion) { - printError( - "**** ERROR: captain-definition needs schemaVersion. Please see docs! ****", - true - ) - } + if (contentsJson) { + if (!contentsJson.schemaVersion) { + printError( + "**** ERROR: captain-definition needs schemaVersion. Please see docs! ****", + true + ) + } - if (!contentsJson.templateId && !contentsJson.dockerfileLines) { - printError( - "**** ERROR: captain-definition needs templateId or dockerfileLines. Please see docs! ****", - true - ) - } + if (!contentsJson.templateId && !contentsJson.dockerfileLines) { + printError( + "**** ERROR: captain-definition needs templateId or dockerfileLines. Please see docs! ****", + true + ) + } - if (contentsJson.templateId && contentsJson.dockerfileLines) { - printError( - "**** ERROR: captain-definition needs templateId or dockerfileLines, NOT BOTH! Please see docs! ****", - true - ) + if (contentsJson.templateId && contentsJson.dockerfileLines) { + printError( + "**** ERROR: captain-definition needs templateId or dockerfileLines, NOT BOTH! Please see docs! ****", + true + ) + } } } // Only show that question if there is no option given as argument -function optionIsGiven(allOptions, option) { +function optionIsNotGiven(allOptions, option) { + // console.log(allOptions) if (allOptions[option]) { return false } @@ -104,5 +107,5 @@ module.exports = { validateIsGitRepository, validateDefinitionFile, isIpAddress, - optionIsGiven + optionIsNotGiven } From 180b458bf6b09a1c5c932b22932e9becbaa42c10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Trevi=C3=B1o?= Date: Fri, 14 Dec 2018 15:31:14 +0100 Subject: [PATCH 19/44] Code cleaning --- app-cli/lib/list.js | 5 +- app-cli/lib/login.js | 74 +++++++++---------- app-cli/utils/__tests__/loginHelpers.test.js | 1 - .../{machineUtils.js => machineUtils.test.js} | 0 4 files changed, 38 insertions(+), 42 deletions(-) rename app-cli/utils/__tests__/{machineUtils.js => machineUtils.test.js} (100%) diff --git a/app-cli/lib/list.js b/app-cli/lib/list.js index 855fc61..898eb67 100644 --- a/app-cli/lib/list.js +++ b/app-cli/lib/list.js @@ -1,5 +1,6 @@ const chalk = require("chalk") const MachineHelper = require("../helpers/MachineHelper") +const { printMessage } = require("../utils/messageHandler") function _displayMachine(machine) { console.log( @@ -11,13 +12,13 @@ function _displayMachine(machine) { } function list() { - console.log("\nLogged in Captain Machines:\n") + printMessage("\nLogged in Captain Machines:\n") MachineHelper.machines.map(machine => { _displayMachine(machine) }) - console.log("") + printMessage("") } module.exports = list diff --git a/app-cli/lib/login.js b/app-cli/lib/login.js index f681a64..9f22435 100644 --- a/app-cli/lib/login.js +++ b/app-cli/lib/login.js @@ -44,7 +44,7 @@ async function requestLogin() { return true } -function login() { +async function login() { printMessage("Login to a Captain Machine") const questions = [ @@ -114,47 +114,43 @@ function login() { } } ] + const answers = await inquirer.prompt(questions) + const { + captainHasRootSsl, + captainPassword, + captainAddress, + captainName + } = answers + const handleHttp = captainHasRootSsl ? "https://" : "http://" + const baseUrl = `${handleHttp}${cleanUpUrl(captainAddress)}` - inquirer.prompt(questions).then(async answers => { - const { - captainHasRootSsl, - captainPassword, - captainAddress, - captainName - } = answers - const handleHttp = captainHasRootSsl ? "https://" : "http://" - const baseUrl = `${handleHttp}${cleanUpUrl(captainAddress)}` + try { + const data = await LoginApi.loginMachine(baseUrl, captainPassword) + const response = JSON.parse(data) - try { - const data = await LoginApi.loginMachine(baseUrl, captainPassword) - const response = JSON.parse(data) - - // TODO - This status should be 200 maybe? - if (response.status !== 100) { - throw new Error(JSON.stringify(response, null, 2)) - } - - const newMachine = { - authToken: response.token, - baseUrl, - name: captainName - } - - MachineHelper.addMachine(newMachine) - - printGreenMessage(`Logged in successfully to ${baseUrl}`) - - printGreenMessage(`Authorization token is now saved as ${captainName} \n`) - } catch (error) { - const errorMessage = error.message ? error.message : error - - printError( - `Something bad happened. Cannot save "${captainName}" \n${errorMessage}` - ) + // TODO - This status should be 200 maybe? + if (response.status !== 100) { + throw new Error(JSON.stringify(response, null, 2)) } - }) + + const newMachine = { + authToken: response.token, + baseUrl, + name: captainName + } + + MachineHelper.addMachine(newMachine) + + printGreenMessage(`Logged in successfully to ${baseUrl}`) + + printGreenMessage(`Authorization token is now saved as ${captainName} \n`) + } catch (error) { + const errorMessage = error.message ? error.message : error + + printError( + `Something bad happened. Cannot save "${captainName}" \n${errorMessage}` + ) + } } module.exports = { login, requestLogin } - -// module.exports = requestLogin diff --git a/app-cli/utils/__tests__/loginHelpers.test.js b/app-cli/utils/__tests__/loginHelpers.test.js index 834e0c7..92c14e8 100644 --- a/app-cli/utils/__tests__/loginHelpers.test.js +++ b/app-cli/utils/__tests__/loginHelpers.test.js @@ -1,7 +1,6 @@ const { cleanUpUrl, findDefaultCaptainName, - isSuffixValid, getCaptainFullName } = require("../loginHelpers") diff --git a/app-cli/utils/__tests__/machineUtils.js b/app-cli/utils/__tests__/machineUtils.test.js similarity index 100% rename from app-cli/utils/__tests__/machineUtils.js rename to app-cli/utils/__tests__/machineUtils.test.js From a0927bd2654a9ca2ed2ff1014e086813319006ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Trevi=C3=B1o?= Date: Fri, 14 Dec 2018 16:04:50 +0100 Subject: [PATCH 20/44] Refactor inquirer promt to use async/await --- app-cli/lib/logout.js | 17 +++++++---------- app-cli/lib/serversetup.js | 28 +++++++++++++--------------- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/app-cli/lib/logout.js b/app-cli/lib/logout.js index 4e52b31..4301af9 100644 --- a/app-cli/lib/logout.js +++ b/app-cli/lib/logout.js @@ -22,22 +22,19 @@ function generateQuestions() { ] } -function logout() { +async function logout() { const questions = generateQuestions() printMessage("Logout from a Captain Machine and clear auth info") - inquirer.prompt(questions).then(answers => { - const { captainNameToLogout } = answers + const answers = await inquirer.prompt(questions) + const { captainNameToLogout } = answers - if (!captainNameToLogout) { - printMessage("\nOperation cancelled by the user...\n") + if (!captainNameToLogout) { + printMessage("\nOperation cancelled by the user...\n", true) + } - return - } - - MachineHelper.logoutMachine(captainNameToLogout) - }) + MachineHelper.logoutMachine(captainNameToLogout) } module.exports = logout diff --git a/app-cli/lib/serversetup.js b/app-cli/lib/serversetup.js index f7596b8..3164084 100644 --- a/app-cli/lib/serversetup.js +++ b/app-cli/lib/serversetup.js @@ -216,26 +216,24 @@ const questions = [ } ] -function serversetup() { +async function serversetup() { printMessage("\nSetup your Captain server\n") - inquirer.prompt(questions).then(answers => { - var captainAddress = `https://${SystemApi.customDomainFromUser}` + const answers = await inquirer.prompt(questions) + const captainAddress = `https://${SystemApi.customDomainFromUser}` + const newMachine = { + authToken: LoginApi.token, + baseUrl: captainAddress, + name: answers.captainName + } - const newMachine = { - authToken: LoginApi.token, - baseUrl: captainAddress, - name: answers.captainName - } + MachineHelper.addMachine(newMachine) - MachineHelper.addMachine(newMachine) + printMessage(`\n\nCaptain is available at ${captainAddress}`) - printMessage(`\n\nCaptain is available at ${captainAddress}`) - - printMessage( - "\nFor more details and docs see http://www.captainduckduck.com\n\n" - ) - }) + printMessage( + "\nFor more details and docs see http://www.captainduckduck.com\n\n" + ) } module.exports = serversetup From 60e1152fb2febfa604e3716c37249cb0b5038468 Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Wed, 19 Dec 2018 17:36:28 -0800 Subject: [PATCH 21/44] Update run-locally.md --- docs/run-locally.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/run-locally.md b/docs/run-locally.md index 1825884..a7e40fc 100644 --- a/docs/run-locally.md +++ b/docs/run-locally.md @@ -9,7 +9,9 @@ Note that this is an advanced process. Some of the concepts used in this section - Docker installed on your machine. - A local DNS server on your machine. You need to point `*.captain.x` to `127.0.0.1` or `192.168.1.2` (your local ip). **NOTE** that `etc/hosts` won't be enough as Captain needs a wildcard entry and `etc/hosts` does not allow wildcards, i.e. `*.something`. - - On ubuntu 16, `dnsmasq` (a local DNS server) is built-in. So, it's as simple of editing this file: `/etc/NetworkManager/dnsmasq.d/dnsmasq-localhost.conf` (create if does not exist) And add this line to it: `address=/captain.x/192.168.1.2` where `192.168.1.2` is your local IP address. To make sure you have `dnsmasq`, you can run `which dnsmasq` on your terminal, if it's available, path of it will be printed on the terminal, otherwise, there won't be anything printed on your terminal + - On ubuntu 16, `dnsmasq` (a local DNS server) is built-in. So, it's as simple of editing this file: `/etc/NetworkManager/dnsmasq.d/dnsmasq-localhost.conf` (create if does not exist) And add this line to it: `address=/captain.x/192.168.1.2` where `192.168.1.2` is your local IP address. To make sure you have `dnsmasq`, you can run `which dnsmasq` on your terminal, if it's available, path of it will be printed on the terminal, otherwise, there won't be anything printed on your terminal. + +Note: For Ubuntu 18, read https://askubuntu.com/questions/1029882/how-can-i-set-up-local-wildcard-127-0-0-1-domain-resolution-on-18-04 To verify you have both prerequisites mentioned above: - Run `docker version` and make sure your version is at least the version mentioned in the [docs](get-started.md#c-install-docker-on-server-at-least-version-1706x) From a1ff473853001726793e3977bc04ffb438dad09e Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Sat, 29 Dec 2018 10:43:25 -0800 Subject: [PATCH 22/44] Fixed yarn installation. --- app-cli/package.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app-cli/package.json b/app-cli/package.json index 970bbbf..b754f1f 100644 --- a/app-cli/package.json +++ b/app-cli/package.json @@ -1,13 +1,18 @@ { "name": "captainduckduck", - "version": "1.0.16", + "version": "1.0.17", "description": "CLI tool for CaptainDuckDuck. See CaptainDuckDuck.com for more details.", "main": "captainduckduck.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "bin": { - "captainduckduck": "./captainduckduck.js" + "captainduckduck": "./captainduckduck.js", + "captainduckduck-deploy": "./captainduckduck-deploy.js", + "captainduckduck-list": "./captainduckduck-list.js", + "captainduckduck-login": "./captainduckduck-login.js", + "captainduckduck-logout": "./captainduckduck-logout.js", + "captainduckduck-serversetup": "./captainduckduck-serversetup.js" }, "repository": { "type": "git", From 00312e5dacb19c9b51811845d6b382e5e69db6bf Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Sat, 29 Dec 2018 10:58:21 -0800 Subject: [PATCH 23/44] updated CLI commands to use the node env values - fix the issue with yarn, see the previous commit --- app-cli/captainduckduck-deploy.js | 1 + app-cli/captainduckduck-list.js | 2 ++ app-cli/captainduckduck-login.js | 2 ++ app-cli/captainduckduck-logout.js | 2 ++ app-cli/captainduckduck-serversetup.js | 2 ++ app-cli/package.json | 2 +- 6 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app-cli/captainduckduck-deploy.js b/app-cli/captainduckduck-deploy.js index a0190e2..a7aa507 100755 --- a/app-cli/captainduckduck-deploy.js +++ b/app-cli/captainduckduck-deploy.js @@ -1,4 +1,5 @@ #!/usr/bin/env node + const program = require('commander'); const fs = require('fs-extra'); const path = require('path'); diff --git a/app-cli/captainduckduck-list.js b/app-cli/captainduckduck-list.js index dc3d049..1b0cd78 100644 --- a/app-cli/captainduckduck-list.js +++ b/app-cli/captainduckduck-list.js @@ -1,3 +1,5 @@ +#!/usr/bin/env node + const program = require('commander'); const fs = require('fs'); const path = require('path'); diff --git a/app-cli/captainduckduck-login.js b/app-cli/captainduckduck-login.js index 2e9ac23..79bbc72 100644 --- a/app-cli/captainduckduck-login.js +++ b/app-cli/captainduckduck-login.js @@ -1,3 +1,5 @@ +#!/usr/bin/env node + const program = require('commander'); const fs = require('fs'); const path = require('path'); diff --git a/app-cli/captainduckduck-logout.js b/app-cli/captainduckduck-logout.js index 0ae3d1b..aeef205 100644 --- a/app-cli/captainduckduck-logout.js +++ b/app-cli/captainduckduck-logout.js @@ -1,3 +1,5 @@ +#!/usr/bin/env node + const program = require('commander'); const fs = require('fs'); const path = require('path'); diff --git a/app-cli/captainduckduck-serversetup.js b/app-cli/captainduckduck-serversetup.js index acb5cae..d250656 100755 --- a/app-cli/captainduckduck-serversetup.js +++ b/app-cli/captainduckduck-serversetup.js @@ -1,3 +1,5 @@ +#!/usr/bin/env node + const program = require('commander'); const fs = require('fs'); const path = require('path'); diff --git a/app-cli/package.json b/app-cli/package.json index b754f1f..14fb864 100644 --- a/app-cli/package.json +++ b/app-cli/package.json @@ -1,6 +1,6 @@ { "name": "captainduckduck", - "version": "1.0.17", + "version": "1.0.18", "description": "CLI tool for CaptainDuckDuck. See CaptainDuckDuck.com for more details.", "main": "captainduckduck.js", "scripts": { From 574d490c9e8572c78d13a925f50c507ba355c8d1 Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Wed, 2 Jan 2019 22:57:58 -0800 Subject: [PATCH 24/44] Re-apply fixes in https://github.com/githubsaturn/captainduckduck/issues/338 --- app-cli/lib/deploy.js | 1 + app-cli/lib/list.js | 2 ++ app-cli/lib/login.js | 2 ++ app-cli/lib/logout.js | 2 ++ app-cli/lib/serversetup.js | 2 ++ app-cli/package-lock.json | 38 ++++++++++++++++++++++++++------------ app-cli/package.json | 18 +++++++++--------- 7 files changed, 44 insertions(+), 21 deletions(-) diff --git a/app-cli/lib/deploy.js b/app-cli/lib/deploy.js index dac3cca..971a855 100644 --- a/app-cli/lib/deploy.js +++ b/app-cli/lib/deploy.js @@ -1,4 +1,5 @@ #!/usr/bin/env node + const MachineHelper = require("../helpers/MachineHelper") const DeployApi = require("../api/DeployApi") const LoginApi = require("../api/LoginApi") diff --git a/app-cli/lib/list.js b/app-cli/lib/list.js index 898eb67..d0172df 100644 --- a/app-cli/lib/list.js +++ b/app-cli/lib/list.js @@ -1,3 +1,5 @@ +#!/usr/bin/env node + const chalk = require("chalk") const MachineHelper = require("../helpers/MachineHelper") const { printMessage } = require("../utils/messageHandler") diff --git a/app-cli/lib/login.js b/app-cli/lib/login.js index 9f22435..1f4ef74 100644 --- a/app-cli/lib/login.js +++ b/app-cli/lib/login.js @@ -1,3 +1,5 @@ +#!/usr/bin/env node + const MachineHelper = require("../helpers/MachineHelper") const { printMessage, diff --git a/app-cli/lib/logout.js b/app-cli/lib/logout.js index 4301af9..ddcc401 100644 --- a/app-cli/lib/logout.js +++ b/app-cli/lib/logout.js @@ -1,3 +1,5 @@ +#!/usr/bin/env node + const MachineHelper = require("../helpers/MachineHelper") const { printMessage } = require("../utils/messageHandler") const inquirer = require("inquirer") diff --git a/app-cli/lib/serversetup.js b/app-cli/lib/serversetup.js index 3164084..7b9f753 100644 --- a/app-cli/lib/serversetup.js +++ b/app-cli/lib/serversetup.js @@ -1,3 +1,5 @@ +#!/usr/bin/env node + const MachineHelper = require("../helpers/MachineHelper") const SystemApi = require("../api/SystemApi") const LoginApi = require("../api/LoginApi") diff --git a/app-cli/package-lock.json b/app-cli/package-lock.json index a19363b..cc02170 100644 --- a/app-cli/package-lock.json +++ b/app-cli/package-lock.json @@ -1,6 +1,6 @@ { "name": "captainduckduck", - "version": "1.0.16", + "version": "1.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -985,7 +985,7 @@ }, "callsites": { "version": "0.2.0", - "resolved": "http://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", "dev": true }, @@ -1536,9 +1536,9 @@ } }, "eslint": { - "version": "5.11.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.11.0.tgz", - "integrity": "sha512-gbEg0ttToZPkZUv2yYjpipxuYrv/9aSSmgM4V6GkiO3u04QosHYBtduUCqLEulEg3YvNDAkk3OWzyQJ/heZ3Nw==", + "version": "5.11.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.11.1.tgz", + "integrity": "sha512-gOKhM8JwlFOc2acbOrkYR05NW8M6DCMSvfcJiBB5NDxRE1gv8kbvxKaC9u69e6ZGEMWXcswA/7eKR229cEIpvg==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -1979,12 +1979,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1999,17 +2001,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -2126,7 +2131,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -2138,6 +2144,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2152,6 +2159,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -2159,12 +2167,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -2183,6 +2193,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -2263,7 +2274,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -2275,6 +2287,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -2396,6 +2409,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", diff --git a/app-cli/package.json b/app-cli/package.json index d5752cf..d1e2650 100644 --- a/app-cli/package.json +++ b/app-cli/package.json @@ -1,6 +1,6 @@ { "name": "captainduckduck", - "version": "1.0.18", + "version": "1.1.0", "description": "CLI tool for CaptainDuckDuck. See CaptainDuckDuck.com for more details.", "main": "captainduckduck.js", "scripts": { @@ -8,11 +8,11 @@ }, "bin": { "captainduckduck": "./captainduckduck.js", - "captainduckduck-deploy": "./captainduckduck-deploy.js", - "captainduckduck-list": "./captainduckduck-list.js", - "captainduckduck-login": "./captainduckduck-login.js", - "captainduckduck-logout": "./captainduckduck-logout.js", - "captainduckduck-serversetup": "./captainduckduck-serversetup.js" + "captainduckduck-deploy": "./lib/deploy.js", + "captainduckduck-list": "./lib/list.js", + "captainduckduck-login": "./lib/login.js", + "captainduckduck-logout": "./lib/logout.js", + "captainduckduck-serversetup": "./lib/serversetup.js" }, "repository": { "type": "git", @@ -53,9 +53,9 @@ "update-notifier": "^2.5.0" }, "devDependencies": { - "eslint": "^5.8.0", - "eslint-plugin-jest": "^21.26.2", + "eslint": "^5.11.1", + "eslint-plugin-jest": "^21.27.2", "jest": "^23.6.0", - "prettier": "^1.14.3" + "prettier": "^1.15.3" } } From caf6e6b5740fe04994f1be214cf4bd4e77dc8a91 Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Wed, 2 Jan 2019 23:33:07 -0800 Subject: [PATCH 25/44] Building TypeScript scaffolding for cli --- app-cli/built/api/DeployApi.js | 164 ++++++++++ app-cli/built/api/LoginApi.js | 105 +++++++ app-cli/built/api/MainApi.js | 61 ++++ app-cli/built/api/SystemApi.js | 134 +++++++++ app-cli/built/commands/captainduckduck.js | 59 ++++ app-cli/built/commands/deploy.js | 254 ++++++++++++++++ app-cli/built/commands/list.js | 18 ++ app-cli/built/commands/login.js | 187 ++++++++++++ app-cli/built/commands/logout.js | 79 +++++ app-cli/built/commands/serversetup.js | 279 ++++++++++++++++++ app-cli/built/helpers/MachineHelper.js | 86 ++++++ app-cli/built/helpers/SpinnerHelper.js | 23 ++ .../utils/__tests__/loginHelpers.test.js | 36 +++ .../utils/__tests__/machineUtils.test.js | 59 ++++ .../__tests__/validationsHandler.test.js | 109 +++++++ app-cli/built/utils/constants.js | 14 + app-cli/built/utils/fileHelper.js | 190 ++++++++++++ app-cli/built/utils/loginHelpers.js | 37 +++ app-cli/built/utils/machineUtils.js | 44 +++ app-cli/built/utils/messageHandler.js | 39 +++ app-cli/built/utils/validationsHandler.js | 118 ++++++++ app-cli/package-lock.json | 39 ++- app-cli/package.json | 19 +- app-cli/{ => src}/api/DeployApi.js | 0 app-cli/{ => src}/api/LoginApi.js | 0 app-cli/{ => src}/api/MainApi.js | 0 app-cli/{ => src}/api/SystemApi.js | 0 app-cli/{ => src/commands}/captainduckduck.js | 14 +- app-cli/{lib => src/commands}/deploy.js | 0 app-cli/{lib => src/commands}/list.js | 0 app-cli/{lib => src/commands}/login.js | 0 app-cli/{lib => src/commands}/logout.js | 0 app-cli/{lib => src/commands}/serversetup.js | 0 app-cli/{ => src}/helpers/MachineHelper.js | 2 +- app-cli/{ => src}/helpers/SpinnerHelper.js | 0 .../utils/__tests__/loginHelpers.test.js | 0 .../utils/__tests__/machineUtils.test.js | 0 .../__tests__/validationsHandler.test.js | 4 +- app-cli/{ => src}/utils/constants.js | 0 app-cli/{ => src}/utils/fileHelper.js | 0 app-cli/{ => src}/utils/loginHelpers.js | 0 app-cli/{ => src}/utils/machineUtils.js | 0 app-cli/{ => src}/utils/messageHandler.js | 0 app-cli/{ => src}/utils/validationsHandler.js | 2 +- app-cli/tsconfig.json | 11 + 45 files changed, 2146 insertions(+), 40 deletions(-) create mode 100755 app-cli/built/api/DeployApi.js create mode 100755 app-cli/built/api/LoginApi.js create mode 100755 app-cli/built/api/MainApi.js create mode 100755 app-cli/built/api/SystemApi.js create mode 100755 app-cli/built/commands/captainduckduck.js create mode 100755 app-cli/built/commands/deploy.js create mode 100755 app-cli/built/commands/list.js create mode 100755 app-cli/built/commands/login.js create mode 100755 app-cli/built/commands/logout.js create mode 100755 app-cli/built/commands/serversetup.js create mode 100755 app-cli/built/helpers/MachineHelper.js create mode 100755 app-cli/built/helpers/SpinnerHelper.js create mode 100755 app-cli/built/utils/__tests__/loginHelpers.test.js create mode 100755 app-cli/built/utils/__tests__/machineUtils.test.js create mode 100755 app-cli/built/utils/__tests__/validationsHandler.test.js create mode 100755 app-cli/built/utils/constants.js create mode 100755 app-cli/built/utils/fileHelper.js create mode 100755 app-cli/built/utils/loginHelpers.js create mode 100755 app-cli/built/utils/machineUtils.js create mode 100755 app-cli/built/utils/messageHandler.js create mode 100755 app-cli/built/utils/validationsHandler.js rename app-cli/{ => src}/api/DeployApi.js (100%) rename app-cli/{ => src}/api/LoginApi.js (100%) rename app-cli/{ => src}/api/MainApi.js (100%) rename app-cli/{ => src}/api/SystemApi.js (100%) rename app-cli/{ => src/commands}/captainduckduck.js (86%) rename app-cli/{lib => src/commands}/deploy.js (100%) rename app-cli/{lib => src/commands}/list.js (100%) rename app-cli/{lib => src/commands}/login.js (100%) rename app-cli/{lib => src/commands}/logout.js (100%) rename app-cli/{lib => src/commands}/serversetup.js (100%) rename app-cli/{ => src}/helpers/MachineHelper.js (97%) rename app-cli/{ => src}/helpers/SpinnerHelper.js (100%) rename app-cli/{ => src}/utils/__tests__/loginHelpers.test.js (100%) rename app-cli/{ => src}/utils/__tests__/machineUtils.test.js (100%) rename app-cli/{ => src}/utils/__tests__/validationsHandler.test.js (95%) rename app-cli/{ => src}/utils/constants.js (100%) rename app-cli/{ => src}/utils/fileHelper.js (100%) rename app-cli/{ => src}/utils/loginHelpers.js (100%) rename app-cli/{ => src}/utils/machineUtils.js (100%) rename app-cli/{ => src}/utils/messageHandler.js (100%) rename app-cli/{ => src}/utils/validationsHandler.js (98%) create mode 100644 app-cli/tsconfig.json diff --git a/app-cli/built/api/DeployApi.js b/app-cli/built/api/DeployApi.js new file mode 100755 index 0000000..cd6d750 --- /dev/null +++ b/app-cli/built/api/DeployApi.js @@ -0,0 +1,164 @@ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var MainApi = require("./MainApi"); +var MachineHelper = require("../helpers/MachineHelper"); +var _a = require("../utils/constants"), DEFAULT_BRANCH_TO_PUSH = _a.DEFAULT_BRANCH_TO_PUSH, DEFAULT_APP_NAME = _a.DEFAULT_APP_NAME; +var DeployApi = /** @class */ (function () { + function DeployApi() { + this.machineToDeploy = {}; + this.branchToPush = DEFAULT_BRANCH_TO_PUSH; + this.appName = DEFAULT_APP_NAME; + this.appUrl = ""; + } + DeployApi.prototype.setMachineToDeploy = function (machineToDeploy) { + this.machineToDeploy = machineToDeploy; + }; + DeployApi.prototype.updateMachineToDeploy = function (machineToDeploy) { + var possibleMachine = {}; + // Look machine by host + if (machineToDeploy.startsWith("http")) { + possibleMachine = MachineHelper.machines.find(function (machine) { return machine.baseUrl === machineToDeploy; }); + } + else { + // Look machine by name + possibleMachine = MachineHelper.machines.find(function (machine) { return machine.name === machineToDeploy; }); + } + this.machineToDeploy = possibleMachine; + }; + DeployApi.prototype.setBranchToPush = function (branchToPush) { + this.branchToPush = branchToPush; + }; + DeployApi.prototype.setAppName = function (appName) { + this.appName = appName; + this.setAppUrl(); + }; + DeployApi.prototype.setAppUrl = function () { + this.appUrl = this.machineToDeploy.baseUrl + .replace("//captain.", "//" + this.appName + ".") + .replace("https://", "http://"); + }; + DeployApi.prototype.fetchBuildLogs = function () { + return __awaiter(this, void 0, void 0, function () { + var _a, authToken, baseUrl, customOptions, data, e_1; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _b.trys.push([0, 2, , 3]); + _a = this.machineToDeploy, authToken = _a.authToken, baseUrl = _a.baseUrl; + customOptions = { + headers: { + "x-captain-auth": authToken + } + }; + return [4 /*yield*/, MainApi.get(baseUrl + "/api/v1/user/appData/" + this.appName, customOptions)]; + case 1: + data = _b.sent(); + return [2 /*return*/, data]; + case 2: + e_1 = _b.sent(); + throw e_1; + case 3: return [2 /*return*/]; + } + }); + }); + }; + DeployApi.prototype.sendFile = function (sourceFile, gitHash) { + return __awaiter(this, void 0, void 0, function () { + var _a, authToken, baseUrl, url, form, options, data, e_2; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _b.trys.push([0, 2, , 3]); + _a = this.machineToDeploy, authToken = _a.authToken, baseUrl = _a.baseUrl; + url = baseUrl + "/api/v1/user/appData/" + this.appName + "/?detached=1"; + form = { + sourceFile: sourceFile, + gitHash: gitHash + }; + options = { + headers: { + "x-captain-auth": authToken + } + }; + return [4 /*yield*/, MainApi.postWithFile(url, form, options)]; + case 1: + data = _b.sent(); + return [2 /*return*/, data]; + case 2: + e_2 = _b.sent(); + throw e_2; + case 3: return [2 /*return*/]; + } + }); + }); + }; + // This is not moved to LoginAPI since it's related only for machineToDeploy + DeployApi.prototype.isAuthTokenValid = function () { + return __awaiter(this, void 0, void 0, function () { + var url, currentToken, options, response, data, e_3; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + if (!this.machineToDeploy) + return [2 /*return*/, false]; + url = this.machineToDeploy.baseUrl + "/api/v1/user/appDefinitions/"; + currentToken = this.machineToDeploy.authToken; + options = { + headers: { + "x-captain-auth": currentToken + } + }; + return [4 /*yield*/, MainApi.get(url, options)]; + case 1: + response = _a.sent(); + data = JSON.parse(response); + // Tolken is not valid + if (data.status === 1106 || data.status === 1105) { + return [2 /*return*/, false]; + } + return [2 /*return*/, true]; + case 2: + e_3 = _a.sent(); + throw e_3; + case 3: return [2 /*return*/]; + } + }); + }); + }; + return DeployApi; +}()); +module.exports = new DeployApi(); diff --git a/app-cli/built/api/LoginApi.js b/app-cli/built/api/LoginApi.js new file mode 100755 index 0000000..9bb8651 --- /dev/null +++ b/app-cli/built/api/LoginApi.js @@ -0,0 +1,105 @@ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var MainApi = require("./MainApi"); +var SystemApi = require("./SystemApi"); +var DEFAULT_PASSWORD = require("../utils/constants").DEFAULT_PASSWORD; +var LoginApi = /** @class */ (function () { + function LoginApi() { + this.token = ""; + this.oldPassword = DEFAULT_PASSWORD; + } + LoginApi.prototype.setOldPassword = function (newPassword) { + this.oldPassword = newPassword; + }; + LoginApi.prototype.setToken = function (newToken) { + this.token = newToken; + }; + LoginApi.prototype.loginMachine = function (baseUrl, password) { + return __awaiter(this, void 0, void 0, function () { + var data, dataAsObject, e_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + return [4 /*yield*/, MainApi.post(baseUrl + "/api/v1/login", { password: password })]; + case 1: + data = _a.sent(); + dataAsObject = JSON.parse(data); + if (dataAsObject) { + this.setToken(dataAsObject.token); + } + return [2 /*return*/, data]; + case 2: + e_1 = _a.sent(); + throw e_1; + case 3: return [2 /*return*/]; + } + }); + }); + }; + LoginApi.prototype.changePass = function (baseUrl, newPassword) { + return __awaiter(this, void 0, void 0, function () { + var customOptions, form, data, e_2; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + customOptions = { + headers: { + "x-captain-auth": LoginApi.token + } + }; + form = { + oldPassword: this.oldPassword, + newPassword: newPassword + }; + return [4 /*yield*/, MainApi.post(baseUrl + "/api/v1/user/changepassword/", form, customOptions)]; + case 1: + data = _a.sent(); + this.setToken(data.token); + SystemApi.setIpAddressOfServer(baseUrl); + return [2 /*return*/, data]; + case 2: + e_2 = _a.sent(); + throw e_2; + case 3: return [2 /*return*/]; + } + }); + }); + }; + return LoginApi; +}()); +module.exports = new LoginApi(); diff --git a/app-cli/built/api/MainApi.js b/app-cli/built/api/MainApi.js new file mode 100755 index 0000000..fc4324b --- /dev/null +++ b/app-cli/built/api/MainApi.js @@ -0,0 +1,61 @@ +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var Request = require("request-promise"); +var MainApi = /** @class */ (function () { + function MainApi() { + this.sharedOptions = { + headers: { + "x-namespace": "captain" + } + }; + } + MainApi.prototype._buildOptions = function (options) { + if (!options) + return this.sharedOptions; + if (options.headers) { + options.headers = Object.assign({}, this.sharedOptions.headers, options.headers); + } + return Object.assign({}, this.sharedOptions, options); + }; + MainApi.prototype.get = function (url, options) { + var overrideOptions = this._buildOptions(options); + var optionsToSend = __assign({}, overrideOptions, { url: url, method: "GET" }); + return Request(optionsToSend); + }; + MainApi.prototype.post = function (url, form, options) { + var overrideOptions = this._buildOptions(options); + var optionsToSend = __assign({}, overrideOptions, { url: url, method: "POST", form: form }); + return Request(optionsToSend); + }; + MainApi.prototype.postWithFile = function (url, formData, options) { + var overrideOptions = this._buildOptions(options); + var optionsToSend = __assign({}, overrideOptions, { url: url, method: "POST", formData: formData }); + return Request(optionsToSend); + }; + MainApi.prototype.put = function (url, form, options) { + var overrideOptions = this._buildOptions(options); + var optionsToSend = __assign({}, overrideOptions, { url: url, method: "PUT", form: form }); + return Request(optionsToSend); + }; + MainApi.prototype.patch = function (url, form, options) { + var overrideOptions = this._buildOptions(options); + var optionsToSend = __assign({}, overrideOptions, { url: url, method: "PATCH", form: form }); + return Request(optionsToSend); + }; + MainApi.prototype.delete = function (url, options) { + var overrideOptions = this._buildOptions(options); + var optionsToSend = __assign({}, overrideOptions, { url: url, method: "DELETE" }); + return Request(optionsToSend); + }; + return MainApi; +}()); +module.exports = new MainApi(); diff --git a/app-cli/built/api/SystemApi.js b/app-cli/built/api/SystemApi.js new file mode 100755 index 0000000..113e8e2 --- /dev/null +++ b/app-cli/built/api/SystemApi.js @@ -0,0 +1,134 @@ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var MainApi = require("./MainApi"); +var LoginApi = require("./LoginApi"); +// const spinnerUtil = require("../../utils/spinner") +var SystemApi = /** @class */ (function () { + function SystemApi() { + this.ipAddressOfServer = ""; + this.customDomainFromUser = ""; + this.newPasswordFirstTry = ""; + } + SystemApi.prototype.setCustomDomainFromUser = function (newCustomDomainFromUser) { + this.customDomainFromUser = newCustomDomainFromUser; + }; + SystemApi.prototype.setIpAddressOfServer = function (newIpAddress) { + this.ipAddressOfServer = newIpAddress.trim(); + }; + SystemApi.prototype.setCustomDomain = function (baseUrl, rootDomain) { + return __awaiter(this, void 0, void 0, function () { + var customOptions, data, e_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + customOptions = { + headers: { + "x-captain-auth": LoginApi.token + } + }; + return [4 /*yield*/, MainApi.post(baseUrl + "/api/v1/user/system/changerootdomain/", { + rootDomain: rootDomain + }, customOptions)]; + case 1: + data = _a.sent(); + return [2 /*return*/, data]; + case 2: + e_1 = _a.sent(); + throw e_1; + case 3: return [2 /*return*/]; + } + }); + }); + }; + SystemApi.prototype.enableHttps = function (baseUrl, emailAddress) { + return __awaiter(this, void 0, void 0, function () { + var customOptions, data, e_2; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + customOptions = { + headers: { + "x-captain-auth": LoginApi.token + } + }; + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4 /*yield*/, MainApi.post(baseUrl + "/api/v1/user/system/enablessl/", { + emailAddress: emailAddress + }, customOptions)]; + case 2: + data = _a.sent(); + return [2 /*return*/, data]; + case 3: + e_2 = _a.sent(); + throw e_2; + case 4: return [2 /*return*/]; + } + }); + }); + }; + SystemApi.prototype.forceHttps = function (baseUrl, isEnabled) { + if (isEnabled === void 0) { isEnabled = true; } + return __awaiter(this, void 0, void 0, function () { + var customOptions, data, e_3; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + customOptions = { + headers: { + "x-captain-auth": LoginApi.token + } + }; + return [4 /*yield*/, MainApi.post(baseUrl + "/api/v1/user/system/forcessl/", { + isEnabled: isEnabled + }, customOptions)]; + case 1: + data = _a.sent(); + return [2 /*return*/, data]; + case 2: + e_3 = _a.sent(); + throw e_3; + case 3: return [2 /*return*/]; + } + }); + }); + }; + return SystemApi; +}()); +module.exports = new SystemApi(); diff --git a/app-cli/built/commands/captainduckduck.js b/app-cli/built/commands/captainduckduck.js new file mode 100755 index 0000000..cd65890 --- /dev/null +++ b/app-cli/built/commands/captainduckduck.js @@ -0,0 +1,59 @@ +#!/usr/bin/env node +var printError = require("../utils/messageHandler").printError; +var packagejson = require("../../package.json"); +var updateNotifier = require("update-notifier"); +var program = require("commander"); +updateNotifier({ pkg: packagejson }).notify({ isGlobal: true }); +// Command actions +var serversetup = require("./serversetup"); +var login = require("./login").login; +var logout = require("./logout"); +var list = require("./list"); +var deploy = require("./deploy"); +// Setup +program.version(packagejson.version).description(packagejson.description); +// Commands +program + .command("serversetup") + .description("Performs necessary actions and prepares your Captain server.") + .action(function () { + serversetup(); +}); +program + .command("login") + .description("Login to a CaptainDuckDuck machine. You can be logged in to multiple machines simultaneously.") + .action(function () { + login(); +}); +program + .command("logout") + .description("Logout from a specific Captain machine.") + .action(function () { + logout(); +}); +program + .command("list") + .alias("ls") + .description("List all Captain machines currently logged in.") + .action(function () { + list(); +}); +program + .command("deploy") + .description("Deploy your app (current directory) to a specific Captain machine. You'll be prompted to choose your Captain machine.") + .option("-t, --tarFile ", "Specify file to be uploaded (rather than using git archive)") + .option("-d, --default", "Run with default options") + .option("-s, --stateless", "Run deploy stateless") + .option("-h, --host ", "Only for stateless mode: Host of the captain machine") + .option("-a, --appName ", "Only for stateless mode: Name of the app") + .option("-p, --pass ", "Only for stateless mode: Password for Captain") + .option("-b, --branch ", "Only for stateless mode: Branch name (default master)") + .action(function (options) { + deploy(options); +}); +// Error on unknown commands +program.on("command:*", function () { + var wrongCommands = program.args.join(" "); + printError("\nInvalid command: " + wrongCommands + "\nSee --help for a list of available commands.", true); +}); +program.parse(process.argv); diff --git a/app-cli/built/commands/deploy.js b/app-cli/built/commands/deploy.js new file mode 100755 index 0000000..acc87e0 --- /dev/null +++ b/app-cli/built/commands/deploy.js @@ -0,0 +1,254 @@ +#!/usr/bin/env node +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var MachineHelper = require("../helpers/MachineHelper"); +var DeployApi = require("../api/DeployApi"); +var LoginApi = require("../api/LoginApi"); +var _a = require("../utils/messageHandler"), printError = _a.printError, printMessage = _a.printMessage; +var _b = require("../utils/validationsHandler"), validateIsGitRepository = _b.validateIsGitRepository, validateDefinitionFile = _b.validateDefinitionFile, optionIsNotGiven = _b.optionIsNotGiven, validateAuthentication = _b.validateAuthentication; +var uploadFile = require("../utils/fileHelper").uploadFile; +var gitArchiveFile = require("../utils/fileHelper").gitArchiveFile; +var fs = require("fs-extra"); +var path = require("path"); +var inquirer = require("inquirer"); +var commandExistsSync = require("command-exists").sync; +var initMachineFromLocalStorage = require("../utils/machineUtils").initMachineFromLocalStorage; +function deployAsDefaultValues() { + return __awaiter(this, void 0, void 0, function () { + var isValidAuthentication, appName, branchToPush, machineToDeploy, e_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + return [4 /*yield*/, validateAuthentication()]; + case 1: + isValidAuthentication = _a.sent(); + if (isValidAuthentication) { + appName = DeployApi.appName, branchToPush = DeployApi.branchToPush, machineToDeploy = DeployApi.machineToDeploy; + if (!appName || !branchToPush || !machineToDeploy) { + printError("Default deploy failed. There are no default options selected.", true); + } + printMessage("Deploying to " + machineToDeploy.name); + deployFromGitProject(); + } + else { + printError("Incorrect login details", true); + } + return [3 /*break*/, 3]; + case 2: + e_1 = _a.sent(); + printError(e_1.message, true); + return [3 /*break*/, 3]; + case 3: return [2 /*return*/]; + } + }); + }); +} +function deployAsStateless(host, appName, branch, pass) { + return __awaiter(this, void 0, void 0, function () { + var isStateless, name_1, response, data, newToken; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + isStateless = host && appName && branch && pass; + if (!isStateless) return [3 /*break*/, 2]; + // login first + printMessage("Trying to login to " + host + "\n"); + name_1 = DeployApi.machineToDeploy.name; + return [4 /*yield*/, LoginApi.loginMachine(host, pass)]; + case 1: + response = _a.sent(); + data = JSON.parse(response); + newToken = data.token; + // Update the token to the machine that corresponds (if needed) + MachineHelper.updateMachineAuthToken(name_1, newToken); + if (data) { + printMessage("Starting stateless deploy to\n" + host + "\n" + branch + "\n" + appName); + deployFromGitProject(); + } + return [3 /*break*/, 3]; + case 2: + printError("You are missing parameters for deploying on stateless. "); + _a.label = 3; + case 3: return [2 /*return*/]; + } + }); + }); +} +function deployFromTarFile(tarFile) { + return __awaiter(this, void 0, void 0, function () { + var isValidAuthentication, filePath, gitHash, e_2; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 5, , 6]); + return [4 /*yield*/, validateAuthentication()]; + case 1: + isValidAuthentication = _a.sent(); + if (!isValidAuthentication) return [3 /*break*/, 3]; + filePath = tarFile; + gitHash = "sendviatarfile"; + return [4 /*yield*/, uploadFile(filePath, gitHash)]; + case 2: + _a.sent(); + return [3 /*break*/, 4]; + case 3: + printError("Incorrect login details", true); + _a.label = 4; + case 4: return [3 /*break*/, 6]; + case 5: + e_2 = _a.sent(); + printError(e_2.message, true); + return [3 /*break*/, 6]; + case 6: return [2 /*return*/]; + } + }); + }); +} +function deployFromGitProject() { + if (!commandExistsSync("git")) { + printError("'git' command not found..."); + printError("Captain needs 'git' to create tar file of your source files...", true); + } + var zipFileNameToDeploy = "temporary-captain-to-deploy.tar"; + var zipFileFullPath = path.join(process.cwd(), zipFileNameToDeploy); + printMessage("Saving tar file to:\n" + zipFileFullPath + "\n"); + // Removes the temporarly file created + try { + var tempFileExists = fs.pathExistsSync(zipFileFullPath); + if (tempFileExists) { + fs.removeSync(zipFileFullPath); + } + } + catch (e) { + // IgnoreError + } + gitArchiveFile(zipFileFullPath, DeployApi.branchToPush); +} +function deploy(options) { + return __awaiter(this, void 0, void 0, function () { + var questions, answers, captainNameToDeploy, branchToPush, appName, isValidAuthentication, e_3; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + // Reads local storage and sets the machine if found + initMachineFromLocalStorage(); + if (!options.tarFile || !options.stateless) { + validateIsGitRepository(); + validateDefinitionFile(); + } + printMessage("Preparing deployment to Captain...\n"); + if (!options.default) return [3 /*break*/, 1]; + deployAsDefaultValues(); + return [3 /*break*/, 8]; + case 1: + if (!options.stateless) return [3 /*break*/, 2]; + deployAsStateless(options.host, options.appName, options.branch, options.pass); + return [3 /*break*/, 8]; + case 2: + if (!options.tarFile) return [3 /*break*/, 3]; + deployFromTarFile(options.tarFile); + return [3 /*break*/, 8]; + case 3: + questions = [ + { + type: "list", + name: "captainNameToDeploy", + default: DeployApi.machineToDeploy.name || "", + message: "Select the Captain Machine you want to deploy to:", + choices: MachineHelper.getMachinesAsOptions(), + when: function () { return optionIsNotGiven(options, "host"); } + }, + { + type: "input", + default: DeployApi.branchToPush || "master", + name: "branchToPush", + message: "Enter the 'git' branch you would like to deploy:", + when: function () { return optionIsNotGiven(options, "branch"); } + }, + { + type: "input", + default: DeployApi.appName, + name: "appName", + message: "Enter the Captain app name this directory will be deployed to:", + when: function () { return optionIsNotGiven(options, "appName"); } + }, + { + type: "confirm", + name: "confirmedToDeploy", + message: "Note that uncommitted files and files in gitignore (if any) will not be pushed to server. Please confirm so that deployment process can start.", + default: true, + when: function () { return optionIsNotGiven(options, "stateless"); } + } + ]; + return [4 /*yield*/, inquirer.prompt(questions)]; + case 4: + answers = _a.sent(); + if (!answers.confirmedToDeploy && !options.stateless) { + printMessage("\nOperation cancelled by the user...\n"); + process.exit(0); + } + captainNameToDeploy = answers.captainNameToDeploy; + branchToPush = answers.branchToPush || options.branch; + appName = answers.appName || options.appName; + DeployApi.updateMachineToDeploy(captainNameToDeploy || options.host); + DeployApi.setBranchToPush(branchToPush); + DeployApi.setAppName(appName); + printMessage("Deploying to " + DeployApi.machineToDeploy.name); + if (!answers.confirmedToDeploy) return [3 /*break*/, 8]; + _a.label = 5; + case 5: + _a.trys.push([5, 7, , 8]); + return [4 /*yield*/, validateAuthentication()]; + case 6: + isValidAuthentication = _a.sent(); + if (isValidAuthentication) { + deployFromGitProject(); + } + else { + printError("Incorrect login details", true); + } + return [3 /*break*/, 8]; + case 7: + e_3 = _a.sent(); + printError(e_3.message, true); + return [3 /*break*/, 8]; + case 8: return [2 /*return*/]; + } + }); + }); +} +module.exports = deploy; diff --git a/app-cli/built/commands/list.js b/app-cli/built/commands/list.js new file mode 100755 index 0000000..359c0e7 --- /dev/null +++ b/app-cli/built/commands/list.js @@ -0,0 +1,18 @@ +#!/usr/bin/env node +var chalk = require("chalk"); +var MachineHelper = require("../helpers/MachineHelper"); +var printMessage = require("../utils/messageHandler").printMessage; +function _displayMachine(machine) { + console.log(">> " + + chalk.greenBright(machine.name) + + " at " + + chalk.cyan(machine.baseUrl)); +} +function list() { + printMessage("\nLogged in Captain Machines:\n"); + MachineHelper.machines.map(function (machine) { + _displayMachine(machine); + }); + printMessage(""); +} +module.exports = list; diff --git a/app-cli/built/commands/login.js b/app-cli/built/commands/login.js new file mode 100755 index 0000000..ecd264b --- /dev/null +++ b/app-cli/built/commands/login.js @@ -0,0 +1,187 @@ +#!/usr/bin/env node +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var MachineHelper = require("../helpers/MachineHelper"); +var _a = require("../utils/messageHandler"), printMessage = _a.printMessage, printGreenMessage = _a.printGreenMessage, printError = _a.printError; +var inquirer = require("inquirer"); +var DeployApi = require("../api/DeployApi"); +var _b = require("../utils/loginHelpers"), cleanUpUrl = _b.cleanUpUrl, findDefaultCaptainName = _b.findDefaultCaptainName; +var SAMPLE_DOMAIN = require("../utils/constants").SAMPLE_DOMAIN; +var LoginApi = require("../api/LoginApi"); +// In case the token is expired +function requestLogin() { + return __awaiter(this, void 0, void 0, function () { + var _a, baseUrl, name, questions, loginPassword, password, response, data, newToken; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _a = DeployApi.machineToDeploy, baseUrl = _a.baseUrl, name = _a.name; + printMessage("Your auth token is not valid anymore. Try to login again."); + questions = [ + { + type: "password", + name: "captainPassword", + message: "Please enter your password for " + baseUrl, + validate: function (value) { + if (value && value.trim()) { + return true; + } + return "Please enter your password for " + baseUrl; + } + } + ]; + return [4 /*yield*/, inquirer.prompt(questions)]; + case 1: + loginPassword = _b.sent(); + password = loginPassword.captainPassword; + return [4 /*yield*/, LoginApi.loginMachine(baseUrl, password)]; + case 2: + response = _b.sent(); + data = JSON.parse(response); + newToken = data.token; + if (!newToken) + return [2 /*return*/, false + // Update the token to the machine that corresponds + ]; + // Update the token to the machine that corresponds + MachineHelper.updateMachineAuthToken(name, newToken); + return [2 /*return*/, true]; + } + }); + }); +} +function login() { + return __awaiter(this, void 0, void 0, function () { + var questions, answers, captainHasRootSsl, captainPassword, captainAddress, captainName, handleHttp, baseUrl, data, response, newMachine, error_1, errorMessage; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + printMessage("Login to a Captain Machine"); + questions = [ + { + type: "input", + default: SAMPLE_DOMAIN, + name: "captainAddress", + message: "\nEnter address of the Captain machine. \nIt is captain.[your-captain-root-domain] :", + validate: function (value) { + if (value === SAMPLE_DOMAIN) { + return "Enter a valid URL"; + } + if (!cleanUpUrl(value)) + return "This is an invalid URL: " + value; + MachineHelper.machines.map(function (machine) { + if (cleanUpUrl(machine.baseUrl) === cleanUpUrl(value)) { + return value + " already exist as " + machine.name + ". If you want to replace the existing entry, you have to first use command, and then re-login."; + } + }); + if (value && value.trim()) { + return true; + } + return "Please enter a valid address."; + } + }, + { + type: "confirm", + name: "captainHasRootSsl", + message: "Is HTTPS activated for this Captain machine?", + default: true + }, + { + type: "password", + name: "captainPassword", + message: "Enter your password:", + validate: function (value) { + if (value && value.trim()) { + return true; + } + return "Please enter your password."; + } + }, + { + type: "input", + name: "captainName", + message: "Enter a name for this Captain machine:", + default: findDefaultCaptainName(), + validate: function (value) { + MachineHelper.machines.map(function (machine) { + if (machine.name === value) { + return value + " already exist. If you want to replace the existing entry, you have to first use command, and then re-login."; + } + }); + if (value.match(/^[-\d\w]+$/i)) { + return true; + } + return "Please enter a Captain Name."; + } + } + ]; + return [4 /*yield*/, inquirer.prompt(questions)]; + case 1: + answers = _a.sent(); + captainHasRootSsl = answers.captainHasRootSsl, captainPassword = answers.captainPassword, captainAddress = answers.captainAddress, captainName = answers.captainName; + handleHttp = captainHasRootSsl ? "https://" : "http://"; + baseUrl = "" + handleHttp + cleanUpUrl(captainAddress); + _a.label = 2; + case 2: + _a.trys.push([2, 4, , 5]); + return [4 /*yield*/, LoginApi.loginMachine(baseUrl, captainPassword)]; + case 3: + data = _a.sent(); + response = JSON.parse(data); + // TODO - This status should be 200 maybe? + if (response.status !== 100) { + throw new Error(JSON.stringify(response, null, 2)); + } + newMachine = { + authToken: response.token, + baseUrl: baseUrl, + name: captainName + }; + MachineHelper.addMachine(newMachine); + printGreenMessage("Logged in successfully to " + baseUrl); + printGreenMessage("Authorization token is now saved as " + captainName + " \n"); + return [3 /*break*/, 5]; + case 4: + error_1 = _a.sent(); + errorMessage = error_1.message ? error_1.message : error_1; + printError("Something bad happened. Cannot save \"" + captainName + "\" \n" + errorMessage); + return [3 /*break*/, 5]; + case 5: return [2 /*return*/]; + } + }); + }); +} +module.exports = { login: login, requestLogin: requestLogin }; diff --git a/app-cli/built/commands/logout.js b/app-cli/built/commands/logout.js new file mode 100755 index 0000000..cf0a8a3 --- /dev/null +++ b/app-cli/built/commands/logout.js @@ -0,0 +1,79 @@ +#!/usr/bin/env node +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var MachineHelper = require("../helpers/MachineHelper"); +var printMessage = require("../utils/messageHandler").printMessage; +var inquirer = require("inquirer"); +function generateQuestions() { + var listOfMachines = MachineHelper.getMachinesAsOptions(); + return [ + { + type: "list", + name: "captainNameToLogout", + message: "Select the Captain Machine you want to logout from:", + choices: listOfMachines + }, + { + type: "confirm", + name: "confirmedToLogout", + message: "Are you sure you want to logout from this Captain machine?", + default: false, + when: function (answers) { return answers.captainNameToLogout; } + } + ]; +} +function logout() { + return __awaiter(this, void 0, void 0, function () { + var questions, answers, captainNameToLogout; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + questions = generateQuestions(); + printMessage("Logout from a Captain Machine and clear auth info"); + return [4 /*yield*/, inquirer.prompt(questions)]; + case 1: + answers = _a.sent(); + captainNameToLogout = answers.captainNameToLogout; + if (!captainNameToLogout) { + printMessage("\nOperation cancelled by the user...\n", true); + } + MachineHelper.logoutMachine(captainNameToLogout); + return [2 /*return*/]; + } + }); + }); +} +module.exports = logout; diff --git a/app-cli/built/commands/serversetup.js b/app-cli/built/commands/serversetup.js new file mode 100755 index 0000000..afb156e --- /dev/null +++ b/app-cli/built/commands/serversetup.js @@ -0,0 +1,279 @@ +#!/usr/bin/env node +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var _this = this; +var MachineHelper = require("../helpers/MachineHelper"); +var SystemApi = require("../api/SystemApi"); +var LoginApi = require("../api/LoginApi"); +var inquirer = require("inquirer"); +var findDefaultCaptainName = require("../utils/loginHelpers").findDefaultCaptainName; +var isIpAddress = require("../utils/validationsHandler").isIpAddress; +var _a = require("../utils/constants"), SAMPLE_IP = _a.SAMPLE_IP, DEFAULT_PASSWORD = _a.DEFAULT_PASSWORD; +var _b = require("../utils/messageHandler"), printMessage = _b.printMessage, printError = _b.printError, printMessageAndExit = _b.printMessageAndExit, errorHandler = _b.errorHandler; +var newPasswordFirstTry = undefined; +var questions = [ + { + type: "list", + name: "hasInstalledCaptain", + message: "Have you already installed Captain on your server by running the following line:" + + "\nmkdir /captain && docker run -p 80:80 -p 443:443 -p 3000:3000 -v /var/run/docker.sock:/var/run/docker.sock dockersaturn/captainduckduck ?", + default: "Yes", + choices: ["Yes", "No"], + filter: function (value) { + var answerFromUser = value.trim(); + if (answerFromUser === "Yes") + return answerFromUser; + printMessage("\n\nCannot start the setup process if Captain is not installed."); + printMessageAndExit("Please read tutorial on CaptainDuckDuck.com to learn how to install CaptainDuckDuck on a server."); + } + }, + { + type: "input", + default: SAMPLE_IP, + name: "captainAddress", + message: "Enter IP address of your captain server:", + filter: function (value) { return __awaiter(_this, void 0, void 0, function () { + var ipFromUser, data, e_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + ipFromUser = value.trim(); + if (ipFromUser === SAMPLE_IP || !isIpAddress(ipFromUser)) { + printError("\nThis is an invalid IP Address: " + ipFromUser, true); + } + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4 /*yield*/, LoginApi.loginMachine("http://" + ipFromUser + ":3000", DEFAULT_PASSWORD)]; + case 2: + data = _a.sent(); + SystemApi.setIpAddressOfServer(ipFromUser); + // All went well + if (data) + return [2 /*return*/, ipFromUser]; + return [3 /*break*/, 4]; + case 3: + e_1 = _a.sent(); + errorHandler(e_1); + return [3 /*break*/, 4]; + case 4: return [2 /*return*/]; + } + }); + }); } + }, + { + type: "password", + name: "captainOriginalPassword", + message: "Enter your current password:", + when: function () { return !LoginApi.token; }, + filter: function (value) { return __awaiter(_this, void 0, void 0, function () { + var captainPasswordFromUser, data, e_2; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + captainPasswordFromUser = value.trim(); + return [4 /*yield*/, LoginApi.loginMachine("http://" + SystemApi.ipAddressOfServer + ":3000", captainPasswordFromUser)]; + case 1: + data = _a.sent(); + if (data) { + SystemApi.setIpAddressOfServer(captainPasswordFromUser); + LoginApi.setOldPassword(captainPasswordFromUser); + } + return [3 /*break*/, 3]; + case 2: + e_2 = _a.sent(); + errorHandler(e_2); + return [3 /*break*/, 3]; + case 3: return [2 /*return*/]; + } + }); + }); } + }, + { + type: "input", + name: "captainRootDomain", + message: "Enter a root domain for this Captain server. For example, enter test.yourdomain.com if you" + + " setup your DNS to point *.test.yourdomain.com to ip address of your server" + + ": ", + filter: function (value) { return __awaiter(_this, void 0, void 0, function () { + var captainRootDomainFromUser, data, newCustomDomainFromUser, e_3; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + captainRootDomainFromUser = value.trim(); + return [4 /*yield*/, SystemApi.setCustomDomain("http://" + SystemApi.ipAddressOfServer + ":3000", captainRootDomainFromUser)]; + case 1: + data = _a.sent(); + if (data) { + newCustomDomainFromUser = "captain." + captainRootDomainFromUser; + SystemApi.setCustomDomainFromUser(newCustomDomainFromUser); + return [2 /*return*/, captainRootDomainFromUser]; + } + return [3 /*break*/, 3]; + case 2: + e_3 = _a.sent(); + errorHandler(e_3); + return [3 /*break*/, 3]; + case 3: return [2 /*return*/]; + } + }); + }); } + }, + { + type: "input", + name: "emailAddress", + message: "Enter your 'valid' email address to enable HTTPS: ", + filter: function (value) { return __awaiter(_this, void 0, void 0, function () { + var emailAddressFromUser, customDomainFromUser, data, e_4; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 3, , 4]); + emailAddressFromUser = value.trim(); + customDomainFromUser = SystemApi.customDomainFromUser; + return [4 /*yield*/, SystemApi.enableHttps("http://" + customDomainFromUser, emailAddressFromUser)]; + case 1: + _a.sent(); + return [4 /*yield*/, SystemApi.forceHttps("https://" + customDomainFromUser)]; + case 2: + data = _a.sent(); + if (data) + return [2 /*return*/, emailAddressFromUser]; + return [3 /*break*/, 4]; + case 3: + e_4 = _a.sent(); + errorHandler(e_4); + return [3 /*break*/, 4]; + case 4: return [2 /*return*/]; + } + }); + }); } + }, + { + type: "password", + name: "newPasswordFirstTry", + message: "Enter a new password:", + filter: function (value) { + newPasswordFirstTry = value; + return value; + } + }, + { + type: "password", + name: "newPassword", + message: "Enter a new password:", + filter: function (value) { return __awaiter(_this, void 0, void 0, function () { + var customDomainFromUser, confirmPasswordValueFromUser, machineUrl, changePassData, loginData, e_5; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + customDomainFromUser = SystemApi.customDomainFromUser; + _a.label = 1; + case 1: + _a.trys.push([1, 5, , 6]); + confirmPasswordValueFromUser = value; + machineUrl = "https://" + customDomainFromUser; + if (newPasswordFirstTry !== confirmPasswordValueFromUser) { + printError("Passwords do not match", true); + } + return [4 /*yield*/, LoginApi.changePass(machineUrl, confirmPasswordValueFromUser)]; + case 2: + changePassData = _a.sent(); + if (!changePassData) return [3 /*break*/, 4]; + return [4 /*yield*/, LoginApi.login(machineUrl, confirmPasswordValueFromUser)]; + case 3: + loginData = _a.sent(); + if (loginData) + return [2 /*return*/]; + _a.label = 4; + case 4: return [3 /*break*/, 6]; + case 5: + e_5 = _a.sent(); + printError("\nIMPORTANT!! Server setup is completed by password is not changed."); + printError("\nYou CANNOT use serversetup anymore. To continue:"); + printError("\n- Go to https://" + customDomainFromUser + " login with default password and change the password in settings."); + printError("\n- In terminal (here), type captainduckduck login and enter this as your root domain: " + customDomainFromUser, true); + return [3 /*break*/, 6]; + case 6: return [2 /*return*/]; + } + }); + }); } + }, + { + type: "input", + name: "captainName", + message: "Enter a name for this Captain machine:", + default: findDefaultCaptainName(), + validate: function (value) { + var newMachineName = value.trim(); + MachineHelper.machines.map(function (machine) { + return machine.name === newMachineName && + newMachineName + " already exist. If you want to replace the existing entry, you have to first use command, and then re-login."; + }); + if (value.match(/^[-\d\w]+$/i)) { + return true; + } + return "Please enter a Captain Name."; + } + } +]; +function serversetup() { + return __awaiter(this, void 0, void 0, function () { + var answers, captainAddress, newMachine; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + printMessage("\nSetup your Captain server\n"); + return [4 /*yield*/, inquirer.prompt(questions)]; + case 1: + answers = _a.sent(); + captainAddress = "https://" + SystemApi.customDomainFromUser; + newMachine = { + authToken: LoginApi.token, + baseUrl: captainAddress, + name: answers.captainName + }; + MachineHelper.addMachine(newMachine); + printMessage("\n\nCaptain is available at " + captainAddress); + printMessage("\nFor more details and docs see http://www.captainduckduck.com\n\n"); + return [2 /*return*/]; + } + }); + }); +} +module.exports = serversetup; diff --git a/app-cli/built/helpers/MachineHelper.js b/app-cli/built/helpers/MachineHelper.js new file mode 100755 index 0000000..b404c0a --- /dev/null +++ b/app-cli/built/helpers/MachineHelper.js @@ -0,0 +1,86 @@ +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var printMessage = require("../utils/messageHandler").printMessage; +var configstore = require("configstore"); +var packagejson = require("../../package.json"); +var configs = new configstore(packagejson.name, { + captainMachines: [] +}); +var MachineHelper = /** @class */ (function () { + function MachineHelper() { + this.machines = configs.get("captainMachines"); + this.apps = configs.get("apps"); + } + MachineHelper.prototype.getMachinesAsOptions = function () { + var firstItemInOption = [ + { + name: "-- CANCEL --", + value: "", + short: "" + } + ]; + var listOfMachines = this.machines.map(function (machine) { + return { + name: machine.name + " at " + machine.baseUrl, + value: "" + machine.name, + short: machine.name + " at " + machine.baseUrl + }; + }); + return firstItemInOption.concat(listOfMachines); + }; + MachineHelper.prototype.setMachines = function (newMachines) { + this.machines = newMachines; + configs.set("captainMachines", newMachines); + }; + MachineHelper.prototype.updateMachineAuthToken = function (machineName, authToken) { + var updatedMachine = {}; + var newMachines = this.machines.map(function (machine) { + if (machine.name === machineName) { + updatedMachine = __assign({}, machine, { authToken: authToken }); + return updatedMachine; + } + return machine; + }); + this.setMachines(newMachines); + this.updateAppsAuthToken(updatedMachine); + }; + MachineHelper.prototype.updateAppsAuthToken = function (updatedMachine) { + if (!updatedMachine) + return; + var newApps = this.apps.map(function (app) { + if (app.machineToDeploy.name === updatedMachine.name) { + return __assign({}, app, { machineToDeploy: updatedMachine }); + } + return app; + }); + this.setApps(newApps); + }; + MachineHelper.prototype.setApps = function (newApps) { + this.apps = newApps; + configs.set("apps", newApps); + }; + MachineHelper.prototype.addMachine = function (newMachine) { + var tempMachines = this.machines; + var newMachines = tempMachines.concat([newMachine]); + // Add to local storage + configs.set("captainMachines", newMachines); + this.setMachines(configs.get("captainMachines")); + }; + MachineHelper.prototype.logoutMachine = function (machineName) { + var removedMachine = this.machines.filter(function (machine) { return machine.name === machineName; })[0]; + var newMachines = this.machines.filter(function (machine) { return machine.name !== machineName; }); + this.setMachines(newMachines); + printMessage("You are now logged out from " + removedMachine.name + " at " + removedMachine.baseUrl + "...\n"); + }; + return MachineHelper; +}()); +module.exports = new MachineHelper(); diff --git a/app-cli/built/helpers/SpinnerHelper.js b/app-cli/built/helpers/SpinnerHelper.js new file mode 100755 index 0000000..9b35f6c --- /dev/null +++ b/app-cli/built/helpers/SpinnerHelper.js @@ -0,0 +1,23 @@ +var ora = require("ora"); +var SpinnerHelper = /** @class */ (function () { + function SpinnerHelper() { + this.spinner; + } + SpinnerHelper.prototype.setColor = function (color) { + this.spinner.color = color; + }; + SpinnerHelper.prototype.start = function (message) { + this.spinner = ora(message).start(); + }; + SpinnerHelper.prototype.stop = function () { + this.spinner.stop(); + }; + SpinnerHelper.prototype.succeed = function () { + this.spinner.succeed(); + }; + SpinnerHelper.prototype.fail = function () { + this.spinner.fail(); + }; + return SpinnerHelper; +}()); +module.exports = new SpinnerHelper(); diff --git a/app-cli/built/utils/__tests__/loginHelpers.test.js b/app-cli/built/utils/__tests__/loginHelpers.test.js new file mode 100755 index 0000000..1e2ed56 --- /dev/null +++ b/app-cli/built/utils/__tests__/loginHelpers.test.js @@ -0,0 +1,36 @@ +var _a = require("../loginHelpers"), cleanUpUrl = _a.cleanUpUrl, findDefaultCaptainName = _a.findDefaultCaptainName, getCaptainFullName = _a.getCaptainFullName; +jest.mock("../../helpers/MachineHelper", function () { + return { + machines: [ + { + baseUrl: "https://captain.myfirstmachine.com", + name: "machine-01", + authToken: "token1" + }, + { + baseUrl: "https://captain.mysecondmachine.com", + name: "machine-02", + authToken: "token2" + } + ] + }; +}); +describe("Login helpers", function () { + it("should clean a url", function () { + var mockUrl = "https://www.google.com"; + var expectedResult = "www.google.com"; + var result = cleanUpUrl(mockUrl); + expect(result).toBe(expectedResult); + }); + it("should get a captain machine name", function () { + var result = getCaptainFullName(1); + var expectedResult = "captain-01"; + expect(result).toBe(expectedResult); + }); + it("should find an unused name for a possible new captain machine", function () { + // If machines are 2, then it should be with suffix 03 + var result = findDefaultCaptainName(); + var expectedResult = "captain-03"; + expect(result).toBe(expectedResult); + }); +}); diff --git a/app-cli/built/utils/__tests__/machineUtils.test.js b/app-cli/built/utils/__tests__/machineUtils.test.js new file mode 100755 index 0000000..c031f33 --- /dev/null +++ b/app-cli/built/utils/__tests__/machineUtils.test.js @@ -0,0 +1,59 @@ +var _a = require("../machineUtils"), initMachineFromLocalStorage = _a.initMachineFromLocalStorage, saveMachineToLocalStorage = _a.saveMachineToLocalStorage; +var DeployApi = require("../../api/DeployApi"); +var MachineHelper = require("../../helpers/MachineHelper"); +var mockUpdatedApps = [ + { + cwd: process.cwd(), + appName: "captain-node-app-new-name", + branchToPush: "master", + machineToDeploy: { + baseUrl: "https://int-test.captainduckduck.com", + name: "int-test", + authToken: "token1" + } + } +]; +jest.mock("../../helpers/MachineHelper", function () { + return { + apps: [ + { + cwd: process.cwd(), + appName: "captain-node-app", + branchToPush: "master", + machineToDeploy: { + baseUrl: "https://int-test.captainduckduck.com", + name: "int-test", + authToken: "token1" + } + } + ], + setApps: jest.fn() + }; +}); +jest.mock("../../api/DeployApi", function () { + return { + setMachineToDeploy: jest.fn(), + setAppName: jest.fn(), + setBranchToPush: jest.fn(), + appName: "captain-node-app-new-name", + branchToPush: "master", + machineToDeploy: { + baseUrl: "https://int-test.captainduckduck.com", + name: "int-test", + authToken: "token1" + } + }; +}); +describe("Machine utils", function () { + it("should init machine from localStorage", function () { + initMachineFromLocalStorage(); + expect(DeployApi.setMachineToDeploy).toHaveBeenCalledTimes(1); + expect(DeployApi.setAppName).toHaveBeenCalledTimes(1); + expect(DeployApi.setBranchToPush).toHaveBeenCalledTimes(1); + }); + it("should update an app from localstorage", function () { + saveMachineToLocalStorage(); + var updatedApps = mockUpdatedApps; + expect(MachineHelper.setApps).toBeCalledWith(updatedApps); + }); +}); diff --git a/app-cli/built/utils/__tests__/validationsHandler.test.js b/app-cli/built/utils/__tests__/validationsHandler.test.js new file mode 100755 index 0000000..f52f184 --- /dev/null +++ b/app-cli/built/utils/__tests__/validationsHandler.test.js @@ -0,0 +1,109 @@ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var _this = this; +var _a = require("../validationsHandler"), validateIsGitRepository = _a.validateIsGitRepository, validateDefinitionFile = _a.validateDefinitionFile, optionIsNotGiven = _a.optionIsNotGiven, isIpAddress = _a.isIpAddress, validateAuthentication = _a.validateAuthentication; +var printError = require("../messageHandler").printError; +var requestLogin = require("../../commands/login").requestLogin; +var initMachineFromLocalStorage = require("../machineUtils").initMachineFromLocalStorage; +jest.mock("fs"); +jest.mock("../messageHandler", function () { + return { + printError: jest.fn() + }; +}); +jest.mock("../../api/DeployApi", function () { + return { + isAuthTokenValid: jest.fn(function () { return false; }) // Simulates it's not authenticated + }; +}); +jest.mock("../../commands/login", function () { + return { + requestLogin: jest.fn() + }; +}); +jest.mock("../machineUtils", function () { + return { + initMachineFromLocalStorage: jest.fn() + }; +}); +describe("Validations handler", function () { + it("should printError if not on a git repository", function () { + validateIsGitRepository(); + expect(printError).toHaveBeenCalledTimes(1); + }); + it("should printError if there is no captain definition file", function () { + validateDefinitionFile(); + // 2nd time because file was not found + // 3rd time because it tried to read from a file and was not valid json + expect(printError).toHaveBeenCalledTimes(3); + }); + it("should return false if the option is included", function () { + var options = { + branch: "master" + }; + var result = optionIsNotGiven(options, "branch"); + expect(result).toBe(false); + }); + it("should return true if the option is not given", function () { + var options = { + test: "something" + }; + var result = optionIsNotGiven(options, "branch"); + expect(result).toBe(true); + }); + it("should be a valid IP Address", function () { + var validIpAddress = "192.168.1.1"; + var result = isIpAddress(validIpAddress); + expect(result).toBe(true); + }); + it("should be an invalid IP Address", function () { + var validIpAddress = "192.168.1"; + var result = isIpAddress(validIpAddress); + expect(result).toBe(false); + }); + it("should promt the login option and initialize from the machine in localstorage", function () { return __awaiter(_this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, validateAuthentication()]; + case 1: + _a.sent(); + expect(requestLogin).toBeCalledTimes(1); + expect(initMachineFromLocalStorage).toBeCalledTimes(1); + return [2 /*return*/]; + } + }); + }); }); +}); diff --git a/app-cli/built/utils/constants.js b/app-cli/built/utils/constants.js new file mode 100755 index 0000000..1cf94b1 --- /dev/null +++ b/app-cli/built/utils/constants.js @@ -0,0 +1,14 @@ +var SAMPLE_DOMAIN = "captain.captainroot.yourdomain.com"; +var SAMPLE_IP = "123.123.123.123"; +var DEFAULT_PASSWORD = "captain42"; +var DEFAULT_BRANCH_TO_PUSH = "branchToPush"; +var DEFAULT_APP_NAME = "appName"; +var EMPTY_STRING = ""; +module.exports = { + SAMPLE_DOMAIN: SAMPLE_DOMAIN, + SAMPLE_IP: SAMPLE_IP, + DEFAULT_PASSWORD: DEFAULT_PASSWORD, + DEFAULT_BRANCH_TO_PUSH: DEFAULT_BRANCH_TO_PUSH, + DEFAULT_APP_NAME: DEFAULT_APP_NAME, + EMPTY_STRING: EMPTY_STRING +}; diff --git a/app-cli/built/utils/fileHelper.js b/app-cli/built/utils/fileHelper.js new file mode 100755 index 0000000..5039b55 --- /dev/null +++ b/app-cli/built/utils/fileHelper.js @@ -0,0 +1,190 @@ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var fs = require("fs-extra"); +var _a = require("./messageHandler"), printMessage = _a.printMessage, printError = _a.printError, printGreenMessage = _a.printGreenMessage, printMagentaMessage = _a.printMagentaMessage; +var SpinnerHelper = require("../helpers/SpinnerHelper"); +var exec = require("child_process").exec; +var ProgressBar = require("progress"); +var DeployApi = require("../api/DeployApi"); +var saveMachineToLocalStorage = require("../utils/machineUtils").saveMachineToLocalStorage; +var lastLineNumberPrinted = -10000; // we want to show all lines to begin with! +function gitArchiveFile(zipFileFullPath, branchToPush) { + exec("git archive --format tar --output \"" + zipFileFullPath + "\" " + branchToPush, function (err, stdout, stderr) { + if (err) { + printError("TAR file failed\n" + err + "\n"); + fs.removeSync(zipFileFullPath); + return; + } + exec("git rev-parse " + branchToPush, function (err, stdout, stderr) { + var gitHash = (stdout || "").trim(); + if (err || !/^[a-f0-9]{40}$/.test(gitHash)) { + printError("Cannot find hash of last commit on this branch: " + branchToPush + "\n" + gitHash + "\n" + err + "\n"); + return; + } + printMessage("Pushing last commit on " + branchToPush + ": " + gitHash); + uploadFile(zipFileFullPath, gitHash); + }); + }); +} +function onLogRetrieved(data) { + if (data) { + var lines = data.logs.lines; + var firstLineNumberOfLogs = data.logs.firstLineNumber; + var firstLinesToPrint = 0; + if (firstLineNumberOfLogs > lastLineNumberPrinted) { + if (firstLineNumberOfLogs < 0) { + // This is the very first fetch, probably firstLineNumberOfLogs is around -50 + firstLinesToPrint = -firstLineNumberOfLogs; + } + else { + printMessage("[[ TRUNCATED ]]"); + } + } + else { + firstLinesToPrint = lastLineNumberPrinted - firstLineNumberOfLogs; + } + lastLineNumberPrinted = firstLineNumberOfLogs + lines.length; + for (var i = firstLinesToPrint; i < lines.length; i++) { + printMessage((lines[i] || "").trim()); + } + } + var finishedBuilding = data && !data.isAppBuilding; + if (finishedBuilding) { + if (!data.isBuildFailed) { + printGreenMessage("Deployed successfully: " + DeployApi.appName); + printMagentaMessage("App is available at " + DeployApi.appUrl + "\n", true); + } + else { + printError("\nSomething bad happened. Cannot deploy \"" + DeployApi.appName + "\"\n", true); + } + } + setTimeout(function () { + startFetchingBuildLogs(); + }, 2000); +} +function startFetchingBuildLogs() { + return __awaiter(this, void 0, void 0, function () { + var data, response, error_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + return [4 /*yield*/, DeployApi.fetchBuildLogs()]; + case 1: + data = _a.sent(); + response = JSON.parse(data); + if (response.status !== 100) { + throw new Error(JSON.stringify(response, null, 2)); + } + onLogRetrieved(response.data); + return [3 /*break*/, 3]; + case 2: + error_1 = _a.sent(); + printError("\nSomething while retrieving app build logs.. " + error_1 + "\n"); + return [3 /*break*/, 3]; + case 3: return [2 /*return*/]; + } + }); + }); +} +function getFileStream(zipFileFullPath) { + var fileSize = fs.statSync(zipFileFullPath).size; + var fileStream = fs.createReadStream(zipFileFullPath); + var barOpts = { + width: 20, + total: fileSize, + clear: true + }; + var bar = new ProgressBar(" uploading [:bar] :percent (ETA :etas)", barOpts); + fileStream.on("data", function (chunk) { + bar.tick(chunk.length); + }); + fileStream.on("end", function () { + printMessage("This might take several minutes. PLEASE BE PATIENT..."); + SpinnerHelper.start("Building your source code..."); + SpinnerHelper.setColor("yellow"); + }); + return fileStream; +} +function uploadFile(filePath, gitHash) { + return __awaiter(this, void 0, void 0, function () { + var fileStream, response, data, somethingWentWrong, isDeployedAndBuilding, isDeployedSuccessfully, e_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + printMessage("Uploading file to " + DeployApi.machineToDeploy.baseUrl); + fileStream = getFileStream(filePath); + return [4 /*yield*/, DeployApi.sendFile(fileStream, gitHash)]; + case 1: + response = _a.sent(); + data = JSON.parse(response); + somethingWentWrong = data.status !== 100 && data.status !== 101; + isDeployedAndBuilding = data.status === 101; + isDeployedSuccessfully = data.status === 100; + if (somethingWentWrong) { + throw new Error(JSON.stringify(data, null, 2)); + } + deleteFileFromDisk(filePath); // Uncomment this + // Save app to local storage + saveMachineToLocalStorage(); + if (isDeployedAndBuilding) { + startFetchingBuildLogs(); + } + if (isDeployedSuccessfully) { + printGreenMessage("Deployed successfully: " + DeployApi.appName + "\n", true); + } + return [3 /*break*/, 3]; + case 2: + e_1 = _a.sent(); + printError(e_1.message, true); + return [3 /*break*/, 3]; + case 3: return [2 /*return*/]; + } + }); + }); +} +function deleteFileFromDisk(filePath) { + if (fs.pathExistsSync(filePath)) { + fs.removeSync(filePath); + } +} +module.exports = { + gitArchiveFile: gitArchiveFile, + getFileStream: getFileStream, + uploadFile: uploadFile, + startFetchingBuildLogs: startFetchingBuildLogs +}; diff --git a/app-cli/built/utils/loginHelpers.js b/app-cli/built/utils/loginHelpers.js new file mode 100755 index 0000000..3ac8742 --- /dev/null +++ b/app-cli/built/utils/loginHelpers.js @@ -0,0 +1,37 @@ +var MachineHelper = require("../helpers/MachineHelper"); +function cleanUpUrl(url) { + if (!url || !url.length) + return null; + var cleanedUrl = url; + var hasSlashAtTheEnd = url.substr(url.length - 1, 1) === "/"; + if (hasSlashAtTheEnd) { + // Remove the slash at the end + cleanedUrl = url.substr(0, url.length - 1); + } + return cleanedUrl + .replace("http://", "") + .replace("https://", "") + .trim(); +} +function findDefaultCaptainName() { + var currentSuffix = MachineHelper.machines.length + 1; + while (!isSuffixValid(currentSuffix)) { + currentSuffix++; + } + return getCaptainFullName(currentSuffix); +} +function getCaptainFullName(suffix) { + var formatSuffix = suffix < 10 ? "0" + suffix : suffix; + return "captain-" + formatSuffix; +} +var isSuffixValid = function (suffixNumber) { + return MachineHelper.machines.map(function (machine) { + machine.name !== getCaptainFullName(suffixNumber); + }); +}; +module.exports = { + cleanUpUrl: cleanUpUrl, + findDefaultCaptainName: findDefaultCaptainName, + isSuffixValid: isSuffixValid, + getCaptainFullName: getCaptainFullName +}; diff --git a/app-cli/built/utils/machineUtils.js b/app-cli/built/utils/machineUtils.js new file mode 100755 index 0000000..5dd4ef8 --- /dev/null +++ b/app-cli/built/utils/machineUtils.js @@ -0,0 +1,44 @@ +var DeployApi = require("../api/DeployApi"); +var MachineHelper = require("../helpers/MachineHelper"); +function initMachineFromLocalStorage() { + var possibleApp = MachineHelper.apps.find(function (app) { return app.cwd === process.cwd(); }); + if (possibleApp) { + DeployApi.setMachineToDeploy(possibleApp.machineToDeploy); + DeployApi.setAppName(possibleApp.appName); + DeployApi.setBranchToPush(possibleApp.branchToPush); + } +} +// Saves the app directory into local storage +function saveMachineToLocalStorage() { + var apps = MachineHelper.apps; + var currentDirectory = process.cwd(); + var appExists = false; + // Update app + var updatedApps = apps.map(function (app) { + if (app.cwd === currentDirectory) { + appExists = true; + return { + cwd: app.cwd, + appName: DeployApi.appName, + branchToPush: DeployApi.branchToPush, + machineToDeploy: DeployApi.machineToDeploy + }; + } + return app; + }); + MachineHelper.setApps(updatedApps); + if (!appExists) { + var newApp = { + cwd: process.cwd(), + appName: DeployApi.appName, + branchToPush: DeployApi.branchToPush, + machineToDeploy: DeployApi.machineToDeploy + }; + updatedApps.push(newApp); + MachineHelper.setApps(apps); + } +} +module.exports = { + initMachineFromLocalStorage: initMachineFromLocalStorage, + saveMachineToLocalStorage: saveMachineToLocalStorage +}; diff --git a/app-cli/built/utils/messageHandler.js b/app-cli/built/utils/messageHandler.js new file mode 100755 index 0000000..635ce27 --- /dev/null +++ b/app-cli/built/utils/messageHandler.js @@ -0,0 +1,39 @@ +var chalk = require("chalk"); +function printMessage(message) { + console.log(message); +} +function printMessageAndExit(message) { + console.log(message); + process.exit(0); +} +function printGreenMessage(message, exit) { + if (exit === void 0) { exit = false; } + console.log("" + chalk.green(message)); + exit && process.exit(0); +} +function printMagentaMessage(message, exit) { + if (exit === void 0) { exit = false; } + console.log("" + chalk.magenta(message)); + exit && process.exit(0); +} +function printError(error, exit) { + if (exit === void 0) { exit = false; } + console.log("" + chalk.bold.red(error)); + exit && process.exit(0); +} +function errorHandler(error) { + if (error.status) { + printError("\nError: " + error.status + "\nError: " + error.description, true); + } + else { + printError("\nError: " + error, true); + } +} +module.exports = { + printMessage: printMessage, + printMessageAndExit: printMessageAndExit, + printError: printError, + printGreenMessage: printGreenMessage, + printMagentaMessage: printMagentaMessage, + errorHandler: errorHandler +}; diff --git a/app-cli/built/utils/validationsHandler.js b/app-cli/built/utils/validationsHandler.js new file mode 100755 index 0000000..65a5300 --- /dev/null +++ b/app-cli/built/utils/validationsHandler.js @@ -0,0 +1,118 @@ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var fs = require("fs-extra"); +var DeployApi = require("../api/DeployApi"); +var printError = require("./messageHandler").printError; +var requestLogin = require("../commands/login").requestLogin; +var initMachineFromLocalStorage = require("../utils/machineUtils").initMachineFromLocalStorage; +function validateIsGitRepository() { + var gitFolderExists = fs.pathExistsSync("./.git"); + if (!gitFolderExists) { + printError("\n**** ERROR: You are not in a git root directory. This command will only deploys the current directory ****\n", true); + } +} +function validateDefinitionFile() { + var captainDefinitionExists = fs.pathExistsSync("./captain-definition"); + if (!captainDefinitionExists) { + printError("\n**** ERROR: captain-definition file cannot be found. Please see docs! ****\n", true); + } + var contents = fs.readFileSync("./captain-definition", "utf8"); + var contentsJson = null; + try { + contentsJson = JSON.parse(contents); + } + catch (e) { + printError("**** ERROR: captain-definition file is not a valid JSON! ****\n Error:" + e, true); + } + if (contentsJson) { + if (!contentsJson.schemaVersion) { + printError("**** ERROR: captain-definition needs schemaVersion. Please see docs! ****", true); + } + if (!contentsJson.templateId && !contentsJson.dockerfileLines) { + printError("**** ERROR: captain-definition needs templateId or dockerfileLines. Please see docs! ****", true); + } + if (contentsJson.templateId && contentsJson.dockerfileLines) { + printError("**** ERROR: captain-definition needs templateId or dockerfileLines, NOT BOTH! Please see docs! ****", true); + } + } +} +// Only show that question if there is no option given as argument +function optionIsNotGiven(allOptions, option) { + // console.log(allOptions) + if (allOptions[option]) { + return false; + } + return true; +} +function isIpAddress(ipaddress) { + if (/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(ipaddress)) { + return true; + } + return false; +} +function validateAuthentication() { + return __awaiter(this, void 0, void 0, function () { + var isAuthenticated, loggedInStatus; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, DeployApi.isAuthTokenValid() + // 2. Request login + // 3. Login + // 4. Update token + ]; + case 1: + isAuthenticated = _a.sent(); + if (!!isAuthenticated) return [3 /*break*/, 3]; + return [4 /*yield*/, requestLogin() + // Refresh token in DeployApi + ]; + case 2: + loggedInStatus = _a.sent(); + // Refresh token in DeployApi + initMachineFromLocalStorage(); + return [2 /*return*/, loggedInStatus]; + case 3: return [2 /*return*/, Boolean(isAuthenticated)]; + } + }); + }); +} +module.exports = { + validateAuthentication: validateAuthentication, + validateIsGitRepository: validateIsGitRepository, + validateDefinitionFile: validateDefinitionFile, + isIpAddress: isIpAddress, + optionIsNotGiven: optionIsNotGiven +}; diff --git a/app-cli/package-lock.json b/app-cli/package-lock.json index cc02170..19b795c 100644 --- a/app-cli/package-lock.json +++ b/app-cli/package-lock.json @@ -24,6 +24,12 @@ "js-tokens": "^4.0.0" } }, + "@types/node": { + "version": "10.12.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz", + "integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==", + "dev": true + }, "abab": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz", @@ -1979,14 +1985,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2001,20 +2005,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -2131,8 +2132,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -2144,7 +2144,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2159,7 +2158,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -2167,14 +2165,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -2193,7 +2189,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -2274,8 +2269,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -2287,7 +2281,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -2409,7 +2402,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -5909,6 +5901,11 @@ "prelude-ls": "~1.1.2" } }, + "typescript": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.2.tgz", + "integrity": "sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg==" + }, "uglify-js": { "version": "3.4.9", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", diff --git a/app-cli/package.json b/app-cli/package.json index d1e2650..2f57af3 100644 --- a/app-cli/package.json +++ b/app-cli/package.json @@ -4,15 +4,16 @@ "description": "CLI tool for CaptainDuckDuck. See CaptainDuckDuck.com for more details.", "main": "captainduckduck.js", "scripts": { - "test": "jest" + "test": "jest", + "build": "npx tsc" }, "bin": { - "captainduckduck": "./captainduckduck.js", - "captainduckduck-deploy": "./lib/deploy.js", - "captainduckduck-list": "./lib/list.js", - "captainduckduck-login": "./lib/login.js", - "captainduckduck-logout": "./lib/logout.js", - "captainduckduck-serversetup": "./lib/serversetup.js" + "captainduckduck": "./built/commands/captainduckduck.js", + "captainduckduck-deploy": "./built/commands/deploy.js", + "captainduckduck-list": "./built/commands/list.js", + "captainduckduck-login": "./built/commands/login.js", + "captainduckduck-logout": "./built/commands/logout.js", + "captainduckduck-serversetup": "./built/commands/serversetup.js" }, "repository": { "type": "git", @@ -50,12 +51,14 @@ "progress": "^2.0.3", "request": "^2.88.0", "request-promise": "^4.2.2", + "typescript": "^3.2.2", "update-notifier": "^2.5.0" }, "devDependencies": { + "@types/node": "^10.12.18", "eslint": "^5.11.1", "eslint-plugin-jest": "^21.27.2", "jest": "^23.6.0", "prettier": "^1.15.3" } -} +} \ No newline at end of file diff --git a/app-cli/api/DeployApi.js b/app-cli/src/api/DeployApi.js similarity index 100% rename from app-cli/api/DeployApi.js rename to app-cli/src/api/DeployApi.js diff --git a/app-cli/api/LoginApi.js b/app-cli/src/api/LoginApi.js similarity index 100% rename from app-cli/api/LoginApi.js rename to app-cli/src/api/LoginApi.js diff --git a/app-cli/api/MainApi.js b/app-cli/src/api/MainApi.js similarity index 100% rename from app-cli/api/MainApi.js rename to app-cli/src/api/MainApi.js diff --git a/app-cli/api/SystemApi.js b/app-cli/src/api/SystemApi.js similarity index 100% rename from app-cli/api/SystemApi.js rename to app-cli/src/api/SystemApi.js diff --git a/app-cli/captainduckduck.js b/app-cli/src/commands/captainduckduck.js similarity index 86% rename from app-cli/captainduckduck.js rename to app-cli/src/commands/captainduckduck.js index b660525..c72825f 100755 --- a/app-cli/captainduckduck.js +++ b/app-cli/src/commands/captainduckduck.js @@ -1,18 +1,18 @@ #!/usr/bin/env node -const { printError } = require("./utils/messageHandler") -const packagejson = require("./package.json") +const { printError } = require("../utils/messageHandler") +const packagejson = require("../../package.json") const updateNotifier = require("update-notifier") const program = require("commander") updateNotifier({ pkg: packagejson }).notify({ isGlobal: true }) // Command actions -const serversetup = require("./lib/serversetup") -const { login } = require("./lib/login") -const logout = require("./lib/logout") -const list = require("./lib/list") -const deploy = require("./lib/deploy") +const serversetup = require("./serversetup") +const { login } = require("./login") +const logout = require("./logout") +const list = require("./list") +const deploy = require("./deploy") // Setup program.version(packagejson.version).description(packagejson.description) diff --git a/app-cli/lib/deploy.js b/app-cli/src/commands/deploy.js similarity index 100% rename from app-cli/lib/deploy.js rename to app-cli/src/commands/deploy.js diff --git a/app-cli/lib/list.js b/app-cli/src/commands/list.js similarity index 100% rename from app-cli/lib/list.js rename to app-cli/src/commands/list.js diff --git a/app-cli/lib/login.js b/app-cli/src/commands/login.js similarity index 100% rename from app-cli/lib/login.js rename to app-cli/src/commands/login.js diff --git a/app-cli/lib/logout.js b/app-cli/src/commands/logout.js similarity index 100% rename from app-cli/lib/logout.js rename to app-cli/src/commands/logout.js diff --git a/app-cli/lib/serversetup.js b/app-cli/src/commands/serversetup.js similarity index 100% rename from app-cli/lib/serversetup.js rename to app-cli/src/commands/serversetup.js diff --git a/app-cli/helpers/MachineHelper.js b/app-cli/src/helpers/MachineHelper.js similarity index 97% rename from app-cli/helpers/MachineHelper.js rename to app-cli/src/helpers/MachineHelper.js index 8858727..4602bd5 100644 --- a/app-cli/helpers/MachineHelper.js +++ b/app-cli/src/helpers/MachineHelper.js @@ -1,6 +1,6 @@ const { printMessage } = require("../utils/messageHandler") const configstore = require("configstore") -const packagejson = require("../package.json") +const packagejson = require("../../package.json") const configs = new configstore(packagejson.name, { captainMachines: [] }) diff --git a/app-cli/helpers/SpinnerHelper.js b/app-cli/src/helpers/SpinnerHelper.js similarity index 100% rename from app-cli/helpers/SpinnerHelper.js rename to app-cli/src/helpers/SpinnerHelper.js diff --git a/app-cli/utils/__tests__/loginHelpers.test.js b/app-cli/src/utils/__tests__/loginHelpers.test.js similarity index 100% rename from app-cli/utils/__tests__/loginHelpers.test.js rename to app-cli/src/utils/__tests__/loginHelpers.test.js diff --git a/app-cli/utils/__tests__/machineUtils.test.js b/app-cli/src/utils/__tests__/machineUtils.test.js similarity index 100% rename from app-cli/utils/__tests__/machineUtils.test.js rename to app-cli/src/utils/__tests__/machineUtils.test.js diff --git a/app-cli/utils/__tests__/validationsHandler.test.js b/app-cli/src/utils/__tests__/validationsHandler.test.js similarity index 95% rename from app-cli/utils/__tests__/validationsHandler.test.js rename to app-cli/src/utils/__tests__/validationsHandler.test.js index 6416636..5b24050 100644 --- a/app-cli/utils/__tests__/validationsHandler.test.js +++ b/app-cli/src/utils/__tests__/validationsHandler.test.js @@ -6,7 +6,7 @@ const { validateAuthentication } = require("../validationsHandler") const { printError } = require("../messageHandler") -const { requestLogin } = require("../../lib/login") +const { requestLogin } = require("../../commands/login") const { initMachineFromLocalStorage } = require("../machineUtils") jest.mock("fs") @@ -23,7 +23,7 @@ jest.mock("../../api/DeployApi", () => { } }) -jest.mock("../../lib/login", () => { +jest.mock("../../commands/login", () => { return { requestLogin: jest.fn() } diff --git a/app-cli/utils/constants.js b/app-cli/src/utils/constants.js similarity index 100% rename from app-cli/utils/constants.js rename to app-cli/src/utils/constants.js diff --git a/app-cli/utils/fileHelper.js b/app-cli/src/utils/fileHelper.js similarity index 100% rename from app-cli/utils/fileHelper.js rename to app-cli/src/utils/fileHelper.js diff --git a/app-cli/utils/loginHelpers.js b/app-cli/src/utils/loginHelpers.js similarity index 100% rename from app-cli/utils/loginHelpers.js rename to app-cli/src/utils/loginHelpers.js diff --git a/app-cli/utils/machineUtils.js b/app-cli/src/utils/machineUtils.js similarity index 100% rename from app-cli/utils/machineUtils.js rename to app-cli/src/utils/machineUtils.js diff --git a/app-cli/utils/messageHandler.js b/app-cli/src/utils/messageHandler.js similarity index 100% rename from app-cli/utils/messageHandler.js rename to app-cli/src/utils/messageHandler.js diff --git a/app-cli/utils/validationsHandler.js b/app-cli/src/utils/validationsHandler.js similarity index 98% rename from app-cli/utils/validationsHandler.js rename to app-cli/src/utils/validationsHandler.js index ad8fa58..21f8d93 100644 --- a/app-cli/utils/validationsHandler.js +++ b/app-cli/src/utils/validationsHandler.js @@ -1,7 +1,7 @@ const fs = require("fs-extra") const DeployApi = require("../api/DeployApi") const { printError } = require("./messageHandler") -const { requestLogin } = require("../lib/login") +const { requestLogin } = require("../commands/login") const { initMachineFromLocalStorage } = require("../utils/machineUtils") function validateIsGitRepository() { diff --git a/app-cli/tsconfig.json b/app-cli/tsconfig.json new file mode 100644 index 0000000..b505bc0 --- /dev/null +++ b/app-cli/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "outDir": "./built", + "allowJs": true, + "target": "es5", + "noImplicitReturns": false + }, + "include": [ + "./src/**/*" + ] +} \ No newline at end of file From c57f481e4c9d54354243e5aec7a0c247caab1202 Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Wed, 2 Jan 2019 23:44:08 -0800 Subject: [PATCH 26/44] updated tsconfig --- app-cli/.eslintignore | 3 - app-cli/.eslintrc.js | 43 --- app-cli/.prettierrc | 7 + app-cli/.prettierrc.js | 5 - app-cli/.stylelintignore | 3 - app-cli/.stylelintrc.js | 25 -- app-cli/built/api/DeployApi.js | 211 ++++------- app-cli/built/api/DeployApi.js.map | 1 + app-cli/built/api/LoginApi.js | 133 +++---- app-cli/built/api/LoginApi.js.map | 1 + app-cli/built/api/MainApi.js | 73 ++-- app-cli/built/api/MainApi.js.map | 1 + app-cli/built/api/SystemApi.js | 174 +++------ app-cli/built/api/SystemApi.js.map | 1 + app-cli/built/commands/captainduckduck.js | 35 +- app-cli/built/commands/captainduckduck.js.map | 1 + app-cli/built/commands/deploy.js | 343 +++++++----------- app-cli/built/commands/deploy.js.map | 1 + app-cli/built/commands/list.js | 9 +- app-cli/built/commands/list.js.map | 1 + app-cli/built/commands/login.js | 284 ++++++--------- app-cli/built/commands/login.js.map | 1 + app-cli/built/commands/logout.js | 65 +--- app-cli/built/commands/logout.js.map | 1 + app-cli/built/commands/serversetup.js | 309 ++++++---------- app-cli/built/commands/serversetup.js.map | 1 + app-cli/built/helpers/MachineHelper.js | 87 ++--- app-cli/built/helpers/MachineHelper.js.map | 1 + app-cli/built/helpers/SpinnerHelper.js | 30 +- app-cli/built/helpers/SpinnerHelper.js.map | 1 + .../utils/__tests__/loginHelpers.test.js | 27 +- .../utils/__tests__/loginHelpers.test.js.map | 1 + .../utils/__tests__/machineUtils.test.js | 21 +- .../utils/__tests__/machineUtils.test.js.map | 1 + .../__tests__/validationsHandler.test.js | 94 ++--- .../__tests__/validationsHandler.test.js.map | 1 + app-cli/built/utils/constants.js | 25 +- app-cli/built/utils/constants.js.map | 1 + app-cli/built/utils/fileHelper.js | 185 ++++------ app-cli/built/utils/fileHelper.js.map | 1 + app-cli/built/utils/loginHelpers.js | 29 +- app-cli/built/utils/loginHelpers.js.map | 1 + app-cli/built/utils/machineUtils.js | 21 +- app-cli/built/utils/machineUtils.js.map | 1 + app-cli/built/utils/messageHandler.js | 34 +- app-cli/built/utils/messageHandler.js.map | 1 + app-cli/built/utils/validationsHandler.js | 96 ++--- app-cli/built/utils/validationsHandler.js.map | 1 + app-cli/package-lock.json | 28 +- app-cli/package.json | 2 +- app-cli/tsconfig.json | 10 +- app-cli/tslint.json | 60 +++ 52 files changed, 994 insertions(+), 1498 deletions(-) delete mode 100644 app-cli/.eslintignore delete mode 100644 app-cli/.eslintrc.js create mode 100644 app-cli/.prettierrc delete mode 100644 app-cli/.prettierrc.js delete mode 100644 app-cli/.stylelintignore delete mode 100644 app-cli/.stylelintrc.js create mode 100644 app-cli/built/api/DeployApi.js.map create mode 100644 app-cli/built/api/LoginApi.js.map create mode 100644 app-cli/built/api/MainApi.js.map create mode 100644 app-cli/built/api/SystemApi.js.map create mode 100644 app-cli/built/commands/captainduckduck.js.map create mode 100644 app-cli/built/commands/deploy.js.map create mode 100644 app-cli/built/commands/list.js.map create mode 100644 app-cli/built/commands/login.js.map create mode 100644 app-cli/built/commands/logout.js.map create mode 100644 app-cli/built/commands/serversetup.js.map create mode 100644 app-cli/built/helpers/MachineHelper.js.map create mode 100644 app-cli/built/helpers/SpinnerHelper.js.map create mode 100644 app-cli/built/utils/__tests__/loginHelpers.test.js.map create mode 100644 app-cli/built/utils/__tests__/machineUtils.test.js.map create mode 100644 app-cli/built/utils/__tests__/validationsHandler.test.js.map create mode 100644 app-cli/built/utils/constants.js.map create mode 100644 app-cli/built/utils/fileHelper.js.map create mode 100644 app-cli/built/utils/loginHelpers.js.map create mode 100644 app-cli/built/utils/machineUtils.js.map create mode 100644 app-cli/built/utils/messageHandler.js.map create mode 100644 app-cli/built/utils/validationsHandler.js.map create mode 100644 app-cli/tslint.json diff --git a/app-cli/.eslintignore b/app-cli/.eslintignore deleted file mode 100644 index 9ebfc2d..0000000 --- a/app-cli/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules/ -dist/ -coverage/ diff --git a/app-cli/.eslintrc.js b/app-cli/.eslintrc.js deleted file mode 100644 index c2b5192..0000000 --- a/app-cli/.eslintrc.js +++ /dev/null @@ -1,43 +0,0 @@ -module.exports = { - env: { - browser: true, - commonjs: true, - es6: true, - node: true, - "jest/globals": true - }, - globals: { - page: true, - browser: true, - jestPuppeteer: true - }, - extends: ["eslint:recommended"], - parserOptions: { - sourceType: "module", - codeFrame: false, - ecmaFeatures: { - experimentalObjectRestSpread: true, - jsx: true - } - }, - plugins: ["jest"], - rules: { - "padding-line-between-statements": [ - "error", - { blankLine: "always", prev: "*", next: "*" }, - { - blankLine: "never", - prev: ["const", "let"], - next: ["const", "let"] - } - ], - "no-console": 0, - "no-unused-vars": 1, - "prefer-const": "error", - "linebreak-style": ["error", "unix"], - quotes: ["error", "double"], - semi: ["error", "never"], - "require-await": 2, - "no-return-await": 2 - } -} diff --git a/app-cli/.prettierrc b/app-cli/.prettierrc new file mode 100644 index 0000000..9611286 --- /dev/null +++ b/app-cli/.prettierrc @@ -0,0 +1,7 @@ +{ + "trailingComma": "es5", + "tabWidth": 4, + "semi": false, + "singleQuote": true +} + diff --git a/app-cli/.prettierrc.js b/app-cli/.prettierrc.js deleted file mode 100644 index fa89c60..0000000 --- a/app-cli/.prettierrc.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - tabWidth: 2, - semi: false, - printWidth: 80 -}; diff --git a/app-cli/.stylelintignore b/app-cli/.stylelintignore deleted file mode 100644 index 1d17b90..0000000 --- a/app-cli/.stylelintignore +++ /dev/null @@ -1,3 +0,0 @@ - -node_modules -coverage diff --git a/app-cli/.stylelintrc.js b/app-cli/.stylelintrc.js deleted file mode 100644 index 947165b..0000000 --- a/app-cli/.stylelintrc.js +++ /dev/null @@ -1,25 +0,0 @@ -module.exports = { - extends: "stylelint-config-sass-guidelines", - rules: { - "no-descending-specificity": null, - "selector-pseudo-class-no-unknown": [ - true, - { - ignorePseudoClasses: ["global"] - } - ], - "selector-class-pattern": null, - "max-nesting-depth": null, - "color-named": null, - "declaration-property-value-blacklist": null, - "selector-no-qualifying-type": null, - "selector-max-compound-selectors": null, - "property-no-vendor-prefix": null, - "selector-max-id": null, - "scss/selector-no-redundant-nesting-selector": null, - "string-quotes": "double", - "scss/at-import-no-partial-leading-underscore": null, - "scss/at-extend-no-missing-placeholder": null, - "scss/at-mixin-pattern": null - } -}; diff --git a/app-cli/built/api/DeployApi.js b/app-cli/built/api/DeployApi.js index cd6d750..b7374d0 100755 --- a/app-cli/built/api/DeployApi.js +++ b/app-cli/built/api/DeployApi.js @@ -6,159 +6,108 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var MainApi = require("./MainApi"); -var MachineHelper = require("../helpers/MachineHelper"); -var _a = require("../utils/constants"), DEFAULT_BRANCH_TO_PUSH = _a.DEFAULT_BRANCH_TO_PUSH, DEFAULT_APP_NAME = _a.DEFAULT_APP_NAME; -var DeployApi = /** @class */ (function () { - function DeployApi() { +const MainApi = require("./MainApi"); +const MachineHelper = require("../helpers/MachineHelper"); +const { DEFAULT_BRANCH_TO_PUSH, DEFAULT_APP_NAME } = require("../utils/constants"); +class DeployApi { + constructor() { this.machineToDeploy = {}; this.branchToPush = DEFAULT_BRANCH_TO_PUSH; this.appName = DEFAULT_APP_NAME; this.appUrl = ""; } - DeployApi.prototype.setMachineToDeploy = function (machineToDeploy) { + setMachineToDeploy(machineToDeploy) { this.machineToDeploy = machineToDeploy; - }; - DeployApi.prototype.updateMachineToDeploy = function (machineToDeploy) { - var possibleMachine = {}; + } + updateMachineToDeploy(machineToDeploy) { + let possibleMachine = {}; // Look machine by host if (machineToDeploy.startsWith("http")) { - possibleMachine = MachineHelper.machines.find(function (machine) { return machine.baseUrl === machineToDeploy; }); + possibleMachine = MachineHelper.machines.find(machine => machine.baseUrl === machineToDeploy); } else { // Look machine by name - possibleMachine = MachineHelper.machines.find(function (machine) { return machine.name === machineToDeploy; }); + possibleMachine = MachineHelper.machines.find(machine => machine.name === machineToDeploy); } this.machineToDeploy = possibleMachine; - }; - DeployApi.prototype.setBranchToPush = function (branchToPush) { + } + setBranchToPush(branchToPush) { this.branchToPush = branchToPush; - }; - DeployApi.prototype.setAppName = function (appName) { + } + setAppName(appName) { this.appName = appName; this.setAppUrl(); - }; - DeployApi.prototype.setAppUrl = function () { + } + setAppUrl() { this.appUrl = this.machineToDeploy.baseUrl .replace("//captain.", "//" + this.appName + ".") .replace("https://", "http://"); - }; - DeployApi.prototype.fetchBuildLogs = function () { - return __awaiter(this, void 0, void 0, function () { - var _a, authToken, baseUrl, customOptions, data, e_1; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _b.trys.push([0, 2, , 3]); - _a = this.machineToDeploy, authToken = _a.authToken, baseUrl = _a.baseUrl; - customOptions = { - headers: { - "x-captain-auth": authToken - } - }; - return [4 /*yield*/, MainApi.get(baseUrl + "/api/v1/user/appData/" + this.appName, customOptions)]; - case 1: - data = _b.sent(); - return [2 /*return*/, data]; - case 2: - e_1 = _b.sent(); - throw e_1; - case 3: return [2 /*return*/]; - } - }); + } + fetchBuildLogs() { + return __awaiter(this, void 0, void 0, function* () { + try { + const { authToken, baseUrl } = this.machineToDeploy; + const customOptions = { + headers: { + "x-captain-auth": authToken + } + }; + const data = yield MainApi.get(`${baseUrl}/api/v1/user/appData/${this.appName}`, customOptions); + return data; + } + catch (e) { + throw e; + } }); - }; - DeployApi.prototype.sendFile = function (sourceFile, gitHash) { - return __awaiter(this, void 0, void 0, function () { - var _a, authToken, baseUrl, url, form, options, data, e_2; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _b.trys.push([0, 2, , 3]); - _a = this.machineToDeploy, authToken = _a.authToken, baseUrl = _a.baseUrl; - url = baseUrl + "/api/v1/user/appData/" + this.appName + "/?detached=1"; - form = { - sourceFile: sourceFile, - gitHash: gitHash - }; - options = { - headers: { - "x-captain-auth": authToken - } - }; - return [4 /*yield*/, MainApi.postWithFile(url, form, options)]; - case 1: - data = _b.sent(); - return [2 /*return*/, data]; - case 2: - e_2 = _b.sent(); - throw e_2; - case 3: return [2 /*return*/]; - } - }); + } + sendFile(sourceFile, gitHash) { + return __awaiter(this, void 0, void 0, function* () { + try { + const { authToken, baseUrl } = this.machineToDeploy; + const url = `${baseUrl}/api/v1/user/appData/${this.appName}/?detached=1`; + const form = { + sourceFile, + gitHash + }; + const options = { + headers: { + "x-captain-auth": authToken + } + }; + const data = yield MainApi.postWithFile(url, form, options); + return data; + } + catch (e) { + throw e; + } }); - }; + } // This is not moved to LoginAPI since it's related only for machineToDeploy - DeployApi.prototype.isAuthTokenValid = function () { - return __awaiter(this, void 0, void 0, function () { - var url, currentToken, options, response, data, e_3; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - if (!this.machineToDeploy) - return [2 /*return*/, false]; - url = this.machineToDeploy.baseUrl + "/api/v1/user/appDefinitions/"; - currentToken = this.machineToDeploy.authToken; - options = { - headers: { - "x-captain-auth": currentToken - } - }; - return [4 /*yield*/, MainApi.get(url, options)]; - case 1: - response = _a.sent(); - data = JSON.parse(response); - // Tolken is not valid - if (data.status === 1106 || data.status === 1105) { - return [2 /*return*/, false]; - } - return [2 /*return*/, true]; - case 2: - e_3 = _a.sent(); - throw e_3; - case 3: return [2 /*return*/]; + isAuthTokenValid() { + return __awaiter(this, void 0, void 0, function* () { + try { + if (!this.machineToDeploy) + return false; + const url = `${this.machineToDeploy.baseUrl}/api/v1/user/appDefinitions/`; + const currentToken = this.machineToDeploy.authToken; + const options = { + headers: { + "x-captain-auth": currentToken + } + }; + const response = yield MainApi.get(url, options); + const data = JSON.parse(response); + // Tolken is not valid + if (data.status === 1106 || data.status === 1105) { + return false; } - }); + return true; + } + catch (e) { + throw e; + } }); - }; - return DeployApi; -}()); + } +} module.exports = new DeployApi(); +//# sourceMappingURL=DeployApi.js.map \ No newline at end of file diff --git a/app-cli/built/api/DeployApi.js.map b/app-cli/built/api/DeployApi.js.map new file mode 100644 index 0000000..8ed5267 --- /dev/null +++ b/app-cli/built/api/DeployApi.js.map @@ -0,0 +1 @@ +{"version":3,"file":"DeployApi.js","sourceRoot":"","sources":["../../src/api/DeployApi.js"],"names":[],"mappings":";;;;;;;;AAAA,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;AACpC,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACzD,MAAM,EACJ,sBAAsB,EACtB,gBAAgB,EACjB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AAEjC,MAAM,SAAS;IACb;QAC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CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;gBAChD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;gBAEjC,sBAAsB;gBACtB,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,EAAE;oBAChD,OAAO,KAAK,CAAA;iBACb;gBAED,OAAO,IAAI,CAAA;aACZ;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,CAAC,CAAA;aACR;QACH,CAAC;KAAA;CACF;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,SAAS,EAAE,CAAA"} \ No newline at end of file diff --git a/app-cli/built/api/LoginApi.js b/app-cli/built/api/LoginApi.js index 9bb8651..c481337 100755 --- a/app-cli/built/api/LoginApi.js +++ b/app-cli/built/api/LoginApi.js @@ -6,100 +6,57 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var MainApi = require("./MainApi"); -var SystemApi = require("./SystemApi"); -var DEFAULT_PASSWORD = require("../utils/constants").DEFAULT_PASSWORD; -var LoginApi = /** @class */ (function () { - function LoginApi() { +const MainApi = require("./MainApi"); +const SystemApi = require("./SystemApi"); +const { DEFAULT_PASSWORD } = require("../utils/constants"); +class LoginApi { + constructor() { this.token = ""; this.oldPassword = DEFAULT_PASSWORD; } - LoginApi.prototype.setOldPassword = function (newPassword) { + setOldPassword(newPassword) { this.oldPassword = newPassword; - }; - LoginApi.prototype.setToken = function (newToken) { + } + setToken(newToken) { this.token = newToken; - }; - LoginApi.prototype.loginMachine = function (baseUrl, password) { - return __awaiter(this, void 0, void 0, function () { - var data, dataAsObject, e_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, MainApi.post(baseUrl + "/api/v1/login", { password: password })]; - case 1: - data = _a.sent(); - dataAsObject = JSON.parse(data); - if (dataAsObject) { - this.setToken(dataAsObject.token); - } - return [2 /*return*/, data]; - case 2: - e_1 = _a.sent(); - throw e_1; - case 3: return [2 /*return*/]; + } + loginMachine(baseUrl, password) { + return __awaiter(this, void 0, void 0, function* () { + try { + const data = yield MainApi.post(`${baseUrl}/api/v1/login`, { password }); + const dataAsObject = JSON.parse(data); + if (dataAsObject) { + this.setToken(dataAsObject.token); } - }); + return data; + } + catch (e) { + throw e; + } }); - }; - LoginApi.prototype.changePass = function (baseUrl, newPassword) { - return __awaiter(this, void 0, void 0, function () { - var customOptions, form, data, e_2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - customOptions = { - headers: { - "x-captain-auth": LoginApi.token - } - }; - form = { - oldPassword: this.oldPassword, - newPassword: newPassword - }; - return [4 /*yield*/, MainApi.post(baseUrl + "/api/v1/user/changepassword/", form, customOptions)]; - case 1: - data = _a.sent(); - this.setToken(data.token); - SystemApi.setIpAddressOfServer(baseUrl); - return [2 /*return*/, data]; - case 2: - e_2 = _a.sent(); - throw e_2; - case 3: return [2 /*return*/]; - } - }); + } + changePass(baseUrl, newPassword) { + return __awaiter(this, void 0, void 0, function* () { + try { + const customOptions = { + headers: { + "x-captain-auth": LoginApi.token + } + }; + const form = { + oldPassword: this.oldPassword, + newPassword + }; + const data = yield MainApi.post(`${baseUrl}/api/v1/user/changepassword/`, form, customOptions); + this.setToken(data.token); + SystemApi.setIpAddressOfServer(baseUrl); + return data; + } + catch (e) { + throw e; + } }); - }; - return LoginApi; -}()); + } +} module.exports = new LoginApi(); +//# sourceMappingURL=LoginApi.js.map \ No newline at end of file diff --git a/app-cli/built/api/LoginApi.js.map b/app-cli/built/api/LoginApi.js.map new file mode 100644 index 0000000..604fa41 --- /dev/null +++ b/app-cli/built/api/LoginApi.js.map @@ -0,0 +1 @@ +{"version":3,"file":"LoginApi.js","sourceRoot":"","sources":["../../src/api/LoginApi.js"],"names":[],"mappings":";;;;;;;;AAAA,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;AACpC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;AACxC,MAAM,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AAE1D,MAAM,QAAQ;IACZ;QACE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAA;QAEf,IAAI,CAAC,WAAW,GAAG,gBAAgB,CAAA;IACrC,CAAC;IAED,cAAc,CAAC,WAAW;QACxB,IAAI,CAAC,WAAW,GAAG,WAAW,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built/api/MainApi.js +++ b/app-cli/built/api/MainApi.js @@ -1,61 +1,50 @@ -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var Request = require("request-promise"); -var MainApi = /** @class */ (function () { - function MainApi() { +const Request = require("request-promise"); +class MainApi { + constructor() { this.sharedOptions = { headers: { "x-namespace": "captain" } }; } - MainApi.prototype._buildOptions = function (options) { + _buildOptions(options) { if (!options) return this.sharedOptions; if (options.headers) { options.headers = Object.assign({}, this.sharedOptions.headers, options.headers); } return Object.assign({}, this.sharedOptions, options); - }; - MainApi.prototype.get = function (url, options) { - var overrideOptions = this._buildOptions(options); - var optionsToSend = __assign({}, overrideOptions, { url: url, method: "GET" }); + } + get(url, options) { + const overrideOptions = this._buildOptions(options); + const optionsToSend = Object.assign({}, overrideOptions, { url, method: "GET" }); return Request(optionsToSend); - }; - MainApi.prototype.post = function (url, form, options) { - var overrideOptions = this._buildOptions(options); - var optionsToSend = __assign({}, overrideOptions, { url: url, method: "POST", form: form }); + } + post(url, form, options) { + const overrideOptions = this._buildOptions(options); + const optionsToSend = Object.assign({}, overrideOptions, { url, method: "POST", form }); return Request(optionsToSend); - }; - MainApi.prototype.postWithFile = function (url, formData, options) { - var overrideOptions = this._buildOptions(options); - var optionsToSend = __assign({}, overrideOptions, { url: url, method: "POST", formData: formData }); + } + postWithFile(url, formData, options) { + const overrideOptions = this._buildOptions(options); + const optionsToSend = Object.assign({}, overrideOptions, { url, method: "POST", formData }); return Request(optionsToSend); - }; - MainApi.prototype.put = function (url, form, options) { - var overrideOptions = this._buildOptions(options); - var optionsToSend = __assign({}, overrideOptions, { url: url, method: "PUT", form: form }); + } + put(url, form, options) { + const overrideOptions = this._buildOptions(options); + const optionsToSend = Object.assign({}, overrideOptions, { url, method: "PUT", form }); return Request(optionsToSend); - }; - MainApi.prototype.patch = function (url, form, options) { - var overrideOptions = this._buildOptions(options); - var optionsToSend = __assign({}, overrideOptions, { url: url, method: "PATCH", form: form }); + } + patch(url, form, options) { + const overrideOptions = this._buildOptions(options); + const optionsToSend = Object.assign({}, overrideOptions, { url, method: "PATCH", form }); return Request(optionsToSend); - }; - MainApi.prototype.delete = function (url, options) { - var overrideOptions = this._buildOptions(options); - var optionsToSend = __assign({}, overrideOptions, { url: url, method: "DELETE" }); + } + delete(url, options) { + const overrideOptions = this._buildOptions(options); + const optionsToSend = Object.assign({}, overrideOptions, { url, method: "DELETE" }); return Request(optionsToSend); - }; - return MainApi; -}()); + } +} module.exports = new MainApi(); +//# sourceMappingURL=MainApi.js.map \ No newline at end of file diff --git a/app-cli/built/api/MainApi.js.map b/app-cli/built/api/MainApi.js.map new file mode 100644 index 0000000..99bb77b --- /dev/null +++ b/app-cli/built/api/MainApi.js.map @@ -0,0 +1 @@ +{"version":3,"file":"MainApi.js","sourceRoot":"","sources":["../../src/api/MainApi.js"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;AAE1C,MAAM,OAAO;IACX;QACE,IAAI,CAAC,aAAa,GAAG;YACnB,OAAO,EAAE;gBACP,aAAa,EAAE,SAAS;aACzB;SACF,CAAA;IACH,CAAC;IAED,aAAa,CAAC,OAAO;QACnB,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC,aAAa,CAAA;QAEvC,IAAI,OAAO,CAAC,OAAO,EAAE;YACnB,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAC7B,EAAE,EACF,IAAI,CAAC,aAAa,CAAC,OAAO,EAC1B,OAAO,CAAC,OAAO,CAChB,CAAA;SACF;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAA;IACvD,CAAC;IAED,GAAG,CAAC,GAAG,EAAE,OAAO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AAG,EAAE,OAAO;QACjB,MAAM,eAAe,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;QACnD,MAAM,aAAa,qBACd,eAAe,IAClB,GAAG,EACH,MAAM,EAAE,QAAQ,GACjB,CAAA;QAED,OAAO,OAAO,CAAC,aAAa,CAAC,CAAA;IAC/B,CAAC;CACF;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,OAAO,EAAE,CAAA"} \ No newline at end of file diff --git a/app-cli/built/api/SystemApi.js b/app-cli/built/api/SystemApi.js index 113e8e2..479d815 100755 --- a/app-cli/built/api/SystemApi.js +++ b/app-cli/built/api/SystemApi.js @@ -6,129 +6,75 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var MainApi = require("./MainApi"); -var LoginApi = require("./LoginApi"); +const MainApi = require("./MainApi"); +const LoginApi = require("./LoginApi"); // const spinnerUtil = require("../../utils/spinner") -var SystemApi = /** @class */ (function () { - function SystemApi() { +class SystemApi { + constructor() { this.ipAddressOfServer = ""; this.customDomainFromUser = ""; this.newPasswordFirstTry = ""; } - SystemApi.prototype.setCustomDomainFromUser = function (newCustomDomainFromUser) { + setCustomDomainFromUser(newCustomDomainFromUser) { this.customDomainFromUser = newCustomDomainFromUser; - }; - SystemApi.prototype.setIpAddressOfServer = function (newIpAddress) { + } + setIpAddressOfServer(newIpAddress) { this.ipAddressOfServer = newIpAddress.trim(); - }; - SystemApi.prototype.setCustomDomain = function (baseUrl, rootDomain) { - return __awaiter(this, void 0, void 0, function () { - var customOptions, data, e_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - customOptions = { - headers: { - "x-captain-auth": LoginApi.token - } - }; - return [4 /*yield*/, MainApi.post(baseUrl + "/api/v1/user/system/changerootdomain/", { - rootDomain: rootDomain - }, customOptions)]; - case 1: - data = _a.sent(); - return [2 /*return*/, data]; - case 2: - e_1 = _a.sent(); - throw e_1; - case 3: return [2 /*return*/]; - } - }); + } + setCustomDomain(baseUrl, rootDomain) { + return __awaiter(this, void 0, void 0, function* () { + try { + const customOptions = { + headers: { + "x-captain-auth": LoginApi.token + } + }; + const data = yield MainApi.post(`${baseUrl}/api/v1/user/system/changerootdomain/`, { + rootDomain + }, customOptions); + return data; + } + catch (e) { + throw e; + } }); - }; - SystemApi.prototype.enableHttps = function (baseUrl, emailAddress) { - return __awaiter(this, void 0, void 0, function () { - var customOptions, data, e_2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - customOptions = { - headers: { - "x-captain-auth": LoginApi.token - } - }; - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, MainApi.post(baseUrl + "/api/v1/user/system/enablessl/", { - emailAddress: emailAddress - }, customOptions)]; - case 2: - data = _a.sent(); - return [2 /*return*/, data]; - case 3: - e_2 = _a.sent(); - throw e_2; - case 4: return [2 /*return*/]; + } + enableHttps(baseUrl, emailAddress) { + return __awaiter(this, void 0, void 0, function* () { + const customOptions = { + headers: { + "x-captain-auth": LoginApi.token } - }); + }; + try { + const data = yield MainApi.post(`${baseUrl}/api/v1/user/system/enablessl/`, { + emailAddress + }, customOptions); + return data; + } + catch (e) { + throw e; + } }); - }; - SystemApi.prototype.forceHttps = function (baseUrl, isEnabled) { - if (isEnabled === void 0) { isEnabled = true; } - return __awaiter(this, void 0, void 0, function () { - var customOptions, data, e_3; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - customOptions = { - headers: { - "x-captain-auth": LoginApi.token - } - }; - return [4 /*yield*/, MainApi.post(baseUrl + "/api/v1/user/system/forcessl/", { - isEnabled: isEnabled - }, customOptions)]; - case 1: - data = _a.sent(); - return [2 /*return*/, data]; - case 2: - e_3 = _a.sent(); - throw e_3; - case 3: return [2 /*return*/]; - } - }); + } + forceHttps(baseUrl, isEnabled = true) { + return __awaiter(this, void 0, void 0, function* () { + try { + const customOptions = { + headers: { + "x-captain-auth": LoginApi.token + } + }; + const data = yield MainApi.post(`${baseUrl}/api/v1/user/system/forcessl/`, { + isEnabled + }, customOptions); + return data; + } + catch (e) { + throw e; + } }); - }; - return SystemApi; -}()); + } +} module.exports = new SystemApi(); +//# sourceMappingURL=SystemApi.js.map \ No newline at end of file diff --git a/app-cli/built/api/SystemApi.js.map b/app-cli/built/api/SystemApi.js.map new file mode 100644 index 0000000..b61c08d --- /dev/null +++ b/app-cli/built/api/SystemApi.js.map @@ -0,0 +1 @@ +{"version":3,"file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,OAAO,CAAC,EAAE;gBACV,MAAM,CAAC,CAAA;aACR;QACH,CAAC;KAAA;IAEK,UAAU,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI;;YACxC,IAAI;gBACF,MAAM,aAAa,GAAG;oBACpB,OAAO,EAAE;wBACP,gBAAgB,EAAE,QAAQ,CAAC,KAAK;qBACjC;iBACF,CAAA;gBACD,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,CAC7B,GAAG,OAAO,+BAA+B,EACzC;oBACE,SAAS;iBACV,EACD,aAAa,CACd,CAAA;gBAED,OAAO,IAAI,CAAA;aACZ;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,CAAC,CAAA;aACR;QACH,CAAC;KAAA;CACF;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,SAAS,EAAE,CAAA"} \ No newline at end of file diff --git a/app-cli/built/commands/captainduckduck.js b/app-cli/built/commands/captainduckduck.js index cd65890..8191e16 100755 --- a/app-cli/built/commands/captainduckduck.js +++ b/app-cli/built/commands/captainduckduck.js @@ -1,41 +1,41 @@ #!/usr/bin/env node -var printError = require("../utils/messageHandler").printError; -var packagejson = require("../../package.json"); -var updateNotifier = require("update-notifier"); -var program = require("commander"); +const { printError } = require("../utils/messageHandler"); +const packagejson = require("../../package.json"); +const updateNotifier = require("update-notifier"); +const program = require("commander"); updateNotifier({ pkg: packagejson }).notify({ isGlobal: true }); // Command actions -var serversetup = require("./serversetup"); -var login = require("./login").login; -var logout = require("./logout"); -var list = require("./list"); -var deploy = require("./deploy"); +const serversetup = require("./serversetup"); +const { login } = require("./login"); +const logout = require("./logout"); +const list = require("./list"); +const deploy = require("./deploy"); // Setup program.version(packagejson.version).description(packagejson.description); // Commands program .command("serversetup") .description("Performs necessary actions and prepares your Captain server.") - .action(function () { + .action(() => { serversetup(); }); program .command("login") .description("Login to a CaptainDuckDuck machine. You can be logged in to multiple machines simultaneously.") - .action(function () { + .action(() => { login(); }); program .command("logout") .description("Logout from a specific Captain machine.") - .action(function () { + .action(() => { logout(); }); program .command("list") .alias("ls") .description("List all Captain machines currently logged in.") - .action(function () { + .action(() => { list(); }); program @@ -48,12 +48,13 @@ program .option("-a, --appName ", "Only for stateless mode: Name of the app") .option("-p, --pass ", "Only for stateless mode: Password for Captain") .option("-b, --branch ", "Only for stateless mode: Branch name (default master)") - .action(function (options) { + .action(options => { deploy(options); }); // Error on unknown commands -program.on("command:*", function () { - var wrongCommands = program.args.join(" "); - printError("\nInvalid command: " + wrongCommands + "\nSee --help for a list of available commands.", true); +program.on("command:*", () => { + const wrongCommands = program.args.join(" "); + printError(`\nInvalid command: ${wrongCommands}\nSee --help for a list of available commands.`, true); }); program.parse(process.argv); +//# sourceMappingURL=captainduckduck.js.map \ No newline at end of file diff --git a/app-cli/built/commands/captainduckduck.js.map b/app-cli/built/commands/captainduckduck.js.map new file mode 100644 index 0000000..4989592 --- /dev/null +++ b/app-cli/built/commands/captainduckduck.js.map @@ -0,0 +1 @@ +{"version":3,"file":"captainduckduck.js","sourceRoot":"","sources":["../../src/commands/captainduckduck.js"],"names":[],"mappings":";AAEA,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAA;AACzD,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AACjD,MAAM,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;AACjD,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;AAEpC,cAAc,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;AAE/D,kBAAkB;AAClB,MAAM,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;AAC5C,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AACpC,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAClC,MAAM,IAAI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EACtB,uDAAuD,CACxD;KACA,MAAM,CAAC,OAAO,CAAC,EAAE;IAChB,MAAM,CAAC,OAAO,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA;AAEJ,4BAA4B;AAC5B,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;IAC3B,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAE5C,UAAU,CACR,sBAAsB,aAAa,gDAAgD,EACnF,IAAI,CACL,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA"} \ No newline at end of file diff --git a/app-cli/built/commands/deploy.js b/app-cli/built/commands/deploy.js index acc87e0..5b57bb6 100755 --- a/app-cli/built/commands/deploy.js +++ b/app-cli/built/commands/deploy.js @@ -7,135 +7,78 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var MachineHelper = require("../helpers/MachineHelper"); -var DeployApi = require("../api/DeployApi"); -var LoginApi = require("../api/LoginApi"); -var _a = require("../utils/messageHandler"), printError = _a.printError, printMessage = _a.printMessage; -var _b = require("../utils/validationsHandler"), validateIsGitRepository = _b.validateIsGitRepository, validateDefinitionFile = _b.validateDefinitionFile, optionIsNotGiven = _b.optionIsNotGiven, validateAuthentication = _b.validateAuthentication; -var uploadFile = require("../utils/fileHelper").uploadFile; -var gitArchiveFile = require("../utils/fileHelper").gitArchiveFile; -var fs = require("fs-extra"); -var path = require("path"); -var inquirer = require("inquirer"); -var commandExistsSync = require("command-exists").sync; -var initMachineFromLocalStorage = require("../utils/machineUtils").initMachineFromLocalStorage; +const MachineHelper = require("../helpers/MachineHelper"); +const DeployApi = require("../api/DeployApi"); +const LoginApi = require("../api/LoginApi"); +const { printError, printMessage } = require("../utils/messageHandler"); +const { validateIsGitRepository, validateDefinitionFile, optionIsNotGiven, validateAuthentication } = require("../utils/validationsHandler"); +const { uploadFile } = require("../utils/fileHelper"); +const { gitArchiveFile } = require("../utils/fileHelper"); +const fs = require("fs-extra"); +const path = require("path"); +const inquirer = require("inquirer"); +const commandExistsSync = require("command-exists").sync; +const { initMachineFromLocalStorage } = require("../utils/machineUtils"); function deployAsDefaultValues() { - return __awaiter(this, void 0, void 0, function () { - var isValidAuthentication, appName, branchToPush, machineToDeploy, e_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, validateAuthentication()]; - case 1: - isValidAuthentication = _a.sent(); - if (isValidAuthentication) { - appName = DeployApi.appName, branchToPush = DeployApi.branchToPush, machineToDeploy = DeployApi.machineToDeploy; - if (!appName || !branchToPush || !machineToDeploy) { - printError("Default deploy failed. There are no default options selected.", true); - } - printMessage("Deploying to " + machineToDeploy.name); - deployFromGitProject(); - } - else { - printError("Incorrect login details", true); - } - return [3 /*break*/, 3]; - case 2: - e_1 = _a.sent(); - printError(e_1.message, true); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; + return __awaiter(this, void 0, void 0, function* () { + try { + const isValidAuthentication = yield validateAuthentication(); + if (isValidAuthentication) { + const { appName, branchToPush, machineToDeploy } = DeployApi; + if (!appName || !branchToPush || !machineToDeploy) { + printError("Default deploy failed. There are no default options selected.", true); + } + printMessage(`Deploying to ${machineToDeploy.name}`); + deployFromGitProject(); } - }); + else { + printError("Incorrect login details", true); + } + } + catch (e) { + printError(e.message, true); + } }); } function deployAsStateless(host, appName, branch, pass) { - return __awaiter(this, void 0, void 0, function () { - var isStateless, name_1, response, data, newToken; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - isStateless = host && appName && branch && pass; - if (!isStateless) return [3 /*break*/, 2]; - // login first - printMessage("Trying to login to " + host + "\n"); - name_1 = DeployApi.machineToDeploy.name; - return [4 /*yield*/, LoginApi.loginMachine(host, pass)]; - case 1: - response = _a.sent(); - data = JSON.parse(response); - newToken = data.token; - // Update the token to the machine that corresponds (if needed) - MachineHelper.updateMachineAuthToken(name_1, newToken); - if (data) { - printMessage("Starting stateless deploy to\n" + host + "\n" + branch + "\n" + appName); - deployFromGitProject(); - } - return [3 /*break*/, 3]; - case 2: - printError("You are missing parameters for deploying on stateless. "); - _a.label = 3; - case 3: return [2 /*return*/]; + return __awaiter(this, void 0, void 0, function* () { + const isStateless = host && appName && branch && pass; + if (isStateless) { + // login first + printMessage(`Trying to login to ${host}\n`); + const { name } = DeployApi.machineToDeploy; + const response = yield LoginApi.loginMachine(host, pass); + const data = JSON.parse(response); + const newToken = data.token; + // Update the token to the machine that corresponds (if needed) + MachineHelper.updateMachineAuthToken(name, newToken); + if (data) { + printMessage(`Starting stateless deploy to\n${host}\n${branch}\n${appName}`); + deployFromGitProject(); } - }); + } + else { + printError("You are missing parameters for deploying on stateless. "); + } }); } function deployFromTarFile(tarFile) { - return __awaiter(this, void 0, void 0, function () { - var isValidAuthentication, filePath, gitHash, e_2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 5, , 6]); - return [4 /*yield*/, validateAuthentication()]; - case 1: - isValidAuthentication = _a.sent(); - if (!isValidAuthentication) return [3 /*break*/, 3]; - filePath = tarFile; - gitHash = "sendviatarfile"; - return [4 /*yield*/, uploadFile(filePath, gitHash)]; - case 2: - _a.sent(); - return [3 /*break*/, 4]; - case 3: - printError("Incorrect login details", true); - _a.label = 4; - case 4: return [3 /*break*/, 6]; - case 5: - e_2 = _a.sent(); - printError(e_2.message, true); - return [3 /*break*/, 6]; - case 6: return [2 /*return*/]; + return __awaiter(this, void 0, void 0, function* () { + try { + const isValidAuthentication = yield validateAuthentication(); + if (isValidAuthentication) { + // Send from tar file + const filePath = tarFile; + const gitHash = "sendviatarfile"; + yield uploadFile(filePath, gitHash); } - }); + else { + printError("Incorrect login details", true); + } + } + catch (e) { + printError(e.message, true); + } }); } function deployFromGitProject() { @@ -143,12 +86,12 @@ function deployFromGitProject() { printError("'git' command not found..."); printError("Captain needs 'git' to create tar file of your source files...", true); } - var zipFileNameToDeploy = "temporary-captain-to-deploy.tar"; - var zipFileFullPath = path.join(process.cwd(), zipFileNameToDeploy); - printMessage("Saving tar file to:\n" + zipFileFullPath + "\n"); + const zipFileNameToDeploy = "temporary-captain-to-deploy.tar"; + const zipFileFullPath = path.join(process.cwd(), zipFileNameToDeploy); + printMessage(`Saving tar file to:\n${zipFileFullPath}\n`); // Removes the temporarly file created try { - var tempFileExists = fs.pathExistsSync(zipFileFullPath); + const tempFileExists = fs.pathExistsSync(zipFileFullPath); if (tempFileExists) { fs.removeSync(zipFileFullPath); } @@ -159,96 +102,84 @@ function deployFromGitProject() { gitArchiveFile(zipFileFullPath, DeployApi.branchToPush); } function deploy(options) { - return __awaiter(this, void 0, void 0, function () { - var questions, answers, captainNameToDeploy, branchToPush, appName, isValidAuthentication, e_3; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - // Reads local storage and sets the machine if found - initMachineFromLocalStorage(); - if (!options.tarFile || !options.stateless) { - validateIsGitRepository(); - validateDefinitionFile(); - } - printMessage("Preparing deployment to Captain...\n"); - if (!options.default) return [3 /*break*/, 1]; - deployAsDefaultValues(); - return [3 /*break*/, 8]; - case 1: - if (!options.stateless) return [3 /*break*/, 2]; - deployAsStateless(options.host, options.appName, options.branch, options.pass); - return [3 /*break*/, 8]; - case 2: - if (!options.tarFile) return [3 /*break*/, 3]; - deployFromTarFile(options.tarFile); - return [3 /*break*/, 8]; - case 3: - questions = [ - { - type: "list", - name: "captainNameToDeploy", - default: DeployApi.machineToDeploy.name || "", - message: "Select the Captain Machine you want to deploy to:", - choices: MachineHelper.getMachinesAsOptions(), - when: function () { return optionIsNotGiven(options, "host"); } - }, - { - type: "input", - default: DeployApi.branchToPush || "master", - name: "branchToPush", - message: "Enter the 'git' branch you would like to deploy:", - when: function () { return optionIsNotGiven(options, "branch"); } - }, - { - type: "input", - default: DeployApi.appName, - name: "appName", - message: "Enter the Captain app name this directory will be deployed to:", - when: function () { return optionIsNotGiven(options, "appName"); } - }, - { - type: "confirm", - name: "confirmedToDeploy", - message: "Note that uncommitted files and files in gitignore (if any) will not be pushed to server. Please confirm so that deployment process can start.", - default: true, - when: function () { return optionIsNotGiven(options, "stateless"); } - } - ]; - return [4 /*yield*/, inquirer.prompt(questions)]; - case 4: - answers = _a.sent(); - if (!answers.confirmedToDeploy && !options.stateless) { - printMessage("\nOperation cancelled by the user...\n"); - process.exit(0); - } - captainNameToDeploy = answers.captainNameToDeploy; - branchToPush = answers.branchToPush || options.branch; - appName = answers.appName || options.appName; - DeployApi.updateMachineToDeploy(captainNameToDeploy || options.host); - DeployApi.setBranchToPush(branchToPush); - DeployApi.setAppName(appName); - printMessage("Deploying to " + DeployApi.machineToDeploy.name); - if (!answers.confirmedToDeploy) return [3 /*break*/, 8]; - _a.label = 5; - case 5: - _a.trys.push([5, 7, , 8]); - return [4 /*yield*/, validateAuthentication()]; - case 6: - isValidAuthentication = _a.sent(); + return __awaiter(this, void 0, void 0, function* () { + // Reads local storage and sets the machine if found + initMachineFromLocalStorage(); + if (!options.tarFile || !options.stateless) { + validateIsGitRepository(); + validateDefinitionFile(); + } + printMessage("Preparing deployment to Captain...\n"); + if (options.default) { + deployAsDefaultValues(); + } + else if (options.stateless) { + deployAsStateless(options.host, options.appName, options.branch, options.pass); + } + else if (options.tarFile) { + deployFromTarFile(options.tarFile); + } + else { + const questions = [ + { + type: "list", + name: "captainNameToDeploy", + default: DeployApi.machineToDeploy.name || "", + message: "Select the Captain Machine you want to deploy to:", + choices: MachineHelper.getMachinesAsOptions(), + when: () => optionIsNotGiven(options, "host") + }, + { + type: "input", + default: DeployApi.branchToPush || "master", + name: "branchToPush", + message: "Enter the 'git' branch you would like to deploy:", + when: () => optionIsNotGiven(options, "branch") + }, + { + type: "input", + default: DeployApi.appName, + name: "appName", + message: "Enter the Captain app name this directory will be deployed to:", + when: () => optionIsNotGiven(options, "appName") + }, + { + type: "confirm", + name: "confirmedToDeploy", + message: "Note that uncommitted files and files in gitignore (if any) will not be pushed to server. Please confirm so that deployment process can start.", + default: true, + when: () => optionIsNotGiven(options, "stateless") + } + ]; + const answers = yield inquirer.prompt(questions); + if (!answers.confirmedToDeploy && !options.stateless) { + printMessage("\nOperation cancelled by the user...\n"); + process.exit(0); + } + const captainNameToDeploy = answers.captainNameToDeploy; + const branchToPush = answers.branchToPush || options.branch; + const appName = answers.appName || options.appName; + DeployApi.updateMachineToDeploy(captainNameToDeploy || options.host); + DeployApi.setBranchToPush(branchToPush); + DeployApi.setAppName(appName); + printMessage(`Deploying to ${DeployApi.machineToDeploy.name}`); + // Normal deploy + if (answers.confirmedToDeploy) { + try { + const isValidAuthentication = yield validateAuthentication(); if (isValidAuthentication) { deployFromGitProject(); } else { printError("Incorrect login details", true); } - return [3 /*break*/, 8]; - case 7: - e_3 = _a.sent(); - printError(e_3.message, true); - return [3 /*break*/, 8]; - case 8: return [2 /*return*/]; + } + catch (e) { + printError(e.message, true); + } } - }); + } }); } module.exports = deploy; +//# sourceMappingURL=deploy.js.map \ No newline at end of file diff --git a/app-cli/built/commands/deploy.js.map b/app-cli/built/commands/deploy.js.map new file mode 100644 index 0000000..ca1b4f7 --- /dev/null +++ b/app-cli/built/commands/deploy.js.map @@ -0,0 +1 @@ +{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/commands/deploy.js"],"names":[],"mappings":";;;;;;;;;AAEA,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACzD,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAC7C,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;AAC3C,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAA;AACvE,MAAM,EACJ,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACvB,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAA;AAC1C,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AACrD,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AACzD,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAC9B,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AACpC,MAAM,iBAAiB,GAAG,O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,oBAAoB,EAAE,CAAA;qBACvB;yBAAM;wBACL,UAAU,CAAC,yBAAyB,EAAE,IAAI,CAAC,CAAA;qBAC5C;iBACF;gBAAC,OAAO,CAAC,EAAE;oBACV,UAAU,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;iBAC5B;aACF;SACF;IACH,CAAC;CAAA;AAED,MAAM,CAAC,OAAO,GAAG,MAAM,CAAA"} \ No newline at end of file diff --git a/app-cli/built/commands/list.js b/app-cli/built/commands/list.js index 359c0e7..c78e2ae 100755 --- a/app-cli/built/commands/list.js +++ b/app-cli/built/commands/list.js @@ -1,7 +1,7 @@ #!/usr/bin/env node -var chalk = require("chalk"); -var MachineHelper = require("../helpers/MachineHelper"); -var printMessage = require("../utils/messageHandler").printMessage; +const chalk = require("chalk"); +const MachineHelper = require("../helpers/MachineHelper"); +const { printMessage } = require("../utils/messageHandler"); function _displayMachine(machine) { console.log(">> " + chalk.greenBright(machine.name) + @@ -10,9 +10,10 @@ function _displayMachine(machine) { } function list() { printMessage("\nLogged in Captain Machines:\n"); - MachineHelper.machines.map(function (machine) { + MachineHelper.machines.map(machine => { _displayMachine(machine); }); printMessage(""); } module.exports = list; +//# sourceMappingURL=list.js.map \ No newline at end of file diff --git a/app-cli/built/commands/list.js.map b/app-cli/built/commands/list.js.map new file mode 100644 index 0000000..9b2415a --- /dev/null +++ b/app-cli/built/commands/list.js.map @@ -0,0 +1 @@ +{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.js"],"names":[],"mappings":";AAEA,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;AAC9B,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACzD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAA;AAE3D,SAAS,eAAe,CAAC,OAAO;IAC9B,OAAO,CAAC,GAAG,CACT,KAAK;QACH,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC;QAC/B,MAAM;QACN,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAC9B,CAAA;AACH,CAAC;AAED,SAAS,IAAI;IACX,YAAY,CAAC,iCAAiC,CAAC,CAAA;IAE/C,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;QACnC,eAAe,CAAC,OAAO,CAAC,CAAA;IAC1B,CAAC,CAAC,CAAA;IAEF,YAAY,CAAC,EAAE,CAAC,CAAA;AAClB,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,CAAA"} \ No newline at end of file diff --git a/app-cli/built/commands/login.js b/app-cli/built/commands/login.js index ecd264b..6b01fe0 100755 --- a/app-cli/built/commands/login.js +++ b/app-cli/built/commands/login.js @@ -7,181 +7,129 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var MachineHelper = require("../helpers/MachineHelper"); -var _a = require("../utils/messageHandler"), printMessage = _a.printMessage, printGreenMessage = _a.printGreenMessage, printError = _a.printError; -var inquirer = require("inquirer"); -var DeployApi = require("../api/DeployApi"); -var _b = require("../utils/loginHelpers"), cleanUpUrl = _b.cleanUpUrl, findDefaultCaptainName = _b.findDefaultCaptainName; -var SAMPLE_DOMAIN = require("../utils/constants").SAMPLE_DOMAIN; -var LoginApi = require("../api/LoginApi"); +const MachineHelper = require("../helpers/MachineHelper"); +const { printMessage, printGreenMessage, printError } = require("../utils/messageHandler"); +const inquirer = require("inquirer"); +const DeployApi = require("../api/DeployApi"); +const { cleanUpUrl, findDefaultCaptainName } = require("../utils/loginHelpers"); +const { SAMPLE_DOMAIN } = require("../utils/constants"); +const LoginApi = require("../api/LoginApi"); // In case the token is expired function requestLogin() { - return __awaiter(this, void 0, void 0, function () { - var _a, baseUrl, name, questions, loginPassword, password, response, data, newToken; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _a = DeployApi.machineToDeploy, baseUrl = _a.baseUrl, name = _a.name; - printMessage("Your auth token is not valid anymore. Try to login again."); - questions = [ - { - type: "password", - name: "captainPassword", - message: "Please enter your password for " + baseUrl, - validate: function (value) { - if (value && value.trim()) { - return true; - } - return "Please enter your password for " + baseUrl; - } - } - ]; - return [4 /*yield*/, inquirer.prompt(questions)]; - case 1: - loginPassword = _b.sent(); - password = loginPassword.captainPassword; - return [4 /*yield*/, LoginApi.loginMachine(baseUrl, password)]; - case 2: - response = _b.sent(); - data = JSON.parse(response); - newToken = data.token; - if (!newToken) - return [2 /*return*/, false - // Update the token to the machine that corresponds - ]; - // Update the token to the machine that corresponds - MachineHelper.updateMachineAuthToken(name, newToken); - return [2 /*return*/, true]; + return __awaiter(this, void 0, void 0, function* () { + const { baseUrl, name } = DeployApi.machineToDeploy; + printMessage("Your auth token is not valid anymore. Try to login again."); + const questions = [ + { + type: "password", + name: "captainPassword", + message: "Please enter your password for " + baseUrl, + validate: function (value) { + if (value && value.trim()) { + return true; + } + return "Please enter your password for " + baseUrl; + } } - }); + ]; + const loginPassword = yield inquirer.prompt(questions); + const password = loginPassword.captainPassword; + const response = yield LoginApi.loginMachine(baseUrl, password); + const data = JSON.parse(response); + const newToken = data.token; + if (!newToken) + return false; + // Update the token to the machine that corresponds + MachineHelper.updateMachineAuthToken(name, newToken); + return true; }); } function login() { - return __awaiter(this, void 0, void 0, function () { - var questions, answers, captainHasRootSsl, captainPassword, captainAddress, captainName, handleHttp, baseUrl, data, response, newMachine, error_1, errorMessage; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - printMessage("Login to a Captain Machine"); - questions = [ - { - type: "input", - default: SAMPLE_DOMAIN, - name: "captainAddress", - message: "\nEnter address of the Captain machine. \nIt is captain.[your-captain-root-domain] :", - validate: function (value) { - if (value === SAMPLE_DOMAIN) { - return "Enter a valid URL"; - } - if (!cleanUpUrl(value)) - return "This is an invalid URL: " + value; - MachineHelper.machines.map(function (machine) { - if (cleanUpUrl(machine.baseUrl) === cleanUpUrl(value)) { - return value + " already exist as " + machine.name + ". If you want to replace the existing entry, you have to first use command, and then re-login."; - } - }); - if (value && value.trim()) { - return true; - } - return "Please enter a valid address."; - } - }, - { - type: "confirm", - name: "captainHasRootSsl", - message: "Is HTTPS activated for this Captain machine?", - default: true - }, - { - type: "password", - name: "captainPassword", - message: "Enter your password:", - validate: function (value) { - if (value && value.trim()) { - return true; - } - return "Please enter your password."; - } - }, - { - type: "input", - name: "captainName", - message: "Enter a name for this Captain machine:", - default: findDefaultCaptainName(), - validate: function (value) { - MachineHelper.machines.map(function (machine) { - if (machine.name === value) { - return value + " already exist. If you want to replace the existing entry, you have to first use command, and then re-login."; - } - }); - if (value.match(/^[-\d\w]+$/i)) { - return true; - } - return "Please enter a Captain Name."; - } - } - ]; - return [4 /*yield*/, inquirer.prompt(questions)]; - case 1: - answers = _a.sent(); - captainHasRootSsl = answers.captainHasRootSsl, captainPassword = answers.captainPassword, captainAddress = answers.captainAddress, captainName = answers.captainName; - handleHttp = captainHasRootSsl ? "https://" : "http://"; - baseUrl = "" + handleHttp + cleanUpUrl(captainAddress); - _a.label = 2; - case 2: - _a.trys.push([2, 4, , 5]); - return [4 /*yield*/, LoginApi.loginMachine(baseUrl, captainPassword)]; - case 3: - data = _a.sent(); - response = JSON.parse(data); - // TODO - This status should be 200 maybe? - if (response.status !== 100) { - throw new Error(JSON.stringify(response, null, 2)); + return __awaiter(this, void 0, void 0, function* () { + printMessage("Login to a Captain Machine"); + const questions = [ + { + type: "input", + default: SAMPLE_DOMAIN, + name: "captainAddress", + message: "\nEnter address of the Captain machine. \nIt is captain.[your-captain-root-domain] :", + validate: value => { + if (value === SAMPLE_DOMAIN) { + return "Enter a valid URL"; } - newMachine = { - authToken: response.token, - baseUrl: baseUrl, - name: captainName - }; - MachineHelper.addMachine(newMachine); - printGreenMessage("Logged in successfully to " + baseUrl); - printGreenMessage("Authorization token is now saved as " + captainName + " \n"); - return [3 /*break*/, 5]; - case 4: - error_1 = _a.sent(); - errorMessage = error_1.message ? error_1.message : error_1; - printError("Something bad happened. Cannot save \"" + captainName + "\" \n" + errorMessage); - return [3 /*break*/, 5]; - case 5: return [2 /*return*/]; + if (!cleanUpUrl(value)) + return "This is an invalid URL: " + value; + MachineHelper.machines.map(machine => { + if (cleanUpUrl(machine.baseUrl) === cleanUpUrl(value)) { + return `${value} already exist as ${machine.name}. If you want to replace the existing entry, you have to first use command, and then re-login.`; + } + }); + if (value && value.trim()) { + return true; + } + return "Please enter a valid address."; + } + }, + { + type: "confirm", + name: "captainHasRootSsl", + message: "Is HTTPS activated for this Captain machine?", + default: true + }, + { + type: "password", + name: "captainPassword", + message: "Enter your password:", + validate: value => { + if (value && value.trim()) { + return true; + } + return "Please enter your password."; + } + }, + { + type: "input", + name: "captainName", + message: "Enter a name for this Captain machine:", + default: findDefaultCaptainName(), + validate: value => { + MachineHelper.machines.map(machine => { + if (machine.name === value) { + return `${value} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.`; + } + }); + if (value.match(/^[-\d\w]+$/i)) { + return true; + } + return "Please enter a Captain Name."; + } } - }); + ]; + const answers = yield inquirer.prompt(questions); + const { captainHasRootSsl, captainPassword, captainAddress, captainName } = answers; + const handleHttp = captainHasRootSsl ? "https://" : "http://"; + const baseUrl = `${handleHttp}${cleanUpUrl(captainAddress)}`; + try { + const data = yield LoginApi.loginMachine(baseUrl, captainPassword); + const response = JSON.parse(data); + // TODO - This status should be 200 maybe? + if (response.status !== 100) { + throw new Error(JSON.stringify(response, null, 2)); + } + const newMachine = { + authToken: response.token, + baseUrl, + name: captainName + }; + MachineHelper.addMachine(newMachine); + printGreenMessage(`Logged in successfully to ${baseUrl}`); + printGreenMessage(`Authorization token is now saved as ${captainName} \n`); + } + catch (error) { + const errorMessage = error.message ? error.message : error; + printError(`Something bad happened. Cannot save "${captainName}" \n${errorMessage}`); + } }); } -module.exports = { login: login, requestLogin: requestLogin }; +module.exports = { login, requestLogin }; +//# sourceMappingURL=login.js.map \ No newline at end of file diff --git a/app-cli/built/commands/login.js.map b/app-cli/built/commands/login.js.map new file mode 100644 index 0000000..f1a7868 --- /dev/null +++ b/app-cli/built/commands/login.js.map @@ -0,0 +1 @@ +{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.js"],"names":[],"mappings":";;;;;;;;;AAEA,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACzD,MAAM,EACJ,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACX,GAAG,OAAO,CAAC,yBAAyB,CAA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AAU,CAAC,UAAU,CAAC,CAAA;YAEpC,iBAAiB,CAAC,6BAA6B,OAAO,EAAE,CAAC,CAAA;YAEzD,iBAAiB,CAAC,uCAAuC,WAAW,KAAK,CAAC,CAAA;SAC3E;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAA;YAE1D,UAAU,CACR,wCAAwC,WAAW,OAAO,YAAY,EAAE,CACzE,CAAA;SACF;IACH,CAAC;CAAA;AAED,MAAM,CAAC,OAAO,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE,CAAA"} \ No newline at end of file diff --git a/app-cli/built/commands/logout.js b/app-cli/built/commands/logout.js index cf0a8a3..7d8b72d 100755 --- a/app-cli/built/commands/logout.js +++ b/app-cli/built/commands/logout.js @@ -7,38 +7,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var MachineHelper = require("../helpers/MachineHelper"); -var printMessage = require("../utils/messageHandler").printMessage; -var inquirer = require("inquirer"); +const MachineHelper = require("../helpers/MachineHelper"); +const { printMessage } = require("../utils/messageHandler"); +const inquirer = require("inquirer"); function generateQuestions() { - var listOfMachines = MachineHelper.getMachinesAsOptions(); + const listOfMachines = MachineHelper.getMachinesAsOptions(); return [ { type: "list", @@ -51,29 +24,21 @@ function generateQuestions() { name: "confirmedToLogout", message: "Are you sure you want to logout from this Captain machine?", default: false, - when: function (answers) { return answers.captainNameToLogout; } + when: answers => answers.captainNameToLogout } ]; } function logout() { - return __awaiter(this, void 0, void 0, function () { - var questions, answers, captainNameToLogout; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - questions = generateQuestions(); - printMessage("Logout from a Captain Machine and clear auth info"); - return [4 /*yield*/, inquirer.prompt(questions)]; - case 1: - answers = _a.sent(); - captainNameToLogout = answers.captainNameToLogout; - if (!captainNameToLogout) { - printMessage("\nOperation cancelled by the user...\n", true); - } - MachineHelper.logoutMachine(captainNameToLogout); - return [2 /*return*/]; - } - }); + return __awaiter(this, void 0, void 0, function* () { + const questions = generateQuestions(); + printMessage("Logout from a Captain Machine and clear auth info"); + const answers = yield inquirer.prompt(questions); + const { captainNameToLogout } = answers; + if (!captainNameToLogout) { + printMessage("\nOperation cancelled by the user...\n", true); + } + MachineHelper.logoutMachine(captainNameToLogout); }); } module.exports = logout; +//# sourceMappingURL=logout.js.map \ No newline at end of file diff --git a/app-cli/built/commands/logout.js.map b/app-cli/built/commands/logout.js.map new file mode 100644 index 0000000..976e792 --- /dev/null +++ b/app-cli/built/commands/logout.js.map @@ -0,0 +1 @@ +{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../src/commands/logout.js"],"names":[],"mappings":";;;;;;;;;AAEA,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACzD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAA;AAC3D,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAEpC,SAAS,iBAAiB;IACxB,MAAM,cAAc,GAAG,aAAa,CAAC,oBAAoB,EAAE,CAAA;IAE3D,OAAO;QACL;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,qBAAqB;YAC3B,OAAO,EAAE,qDAAqD;YAC9D,OAAO,EAAE,cAAc;SACxB;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,4DAA4D;YACrE,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,mBAAmB;SAC7C;KACF,CAAA;AACH,CAAC;AAED,SAAe,MAAM;;QACnB,MAAM,SAAS,GAAG,iBAAiB,EAAE,CAAA;QAErC,YAAY,CAAC,mDAAmD,CAAC,CAAA;QAEjE,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;QAChD,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAA;QAEvC,IAAI,CAAC,mBAAmB,EAAE;YACxB,YAAY,CAAC,wCAAwC,EAAE,IAAI,CAAC,CAAA;SAC7D;QAED,aAAa,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAA;IAClD,CAAC;CAAA;AAED,MAAM,CAAC,OAAO,GAAG,MAAM,CAAA"} \ No newline at end of file diff --git a/app-cli/built/commands/serversetup.js b/app-cli/built/commands/serversetup.js index afb156e..8cc26a0 100755 --- a/app-cli/built/commands/serversetup.js +++ b/app-cli/built/commands/serversetup.js @@ -7,44 +7,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var _this = this; -var MachineHelper = require("../helpers/MachineHelper"); -var SystemApi = require("../api/SystemApi"); -var LoginApi = require("../api/LoginApi"); -var inquirer = require("inquirer"); -var findDefaultCaptainName = require("../utils/loginHelpers").findDefaultCaptainName; -var isIpAddress = require("../utils/validationsHandler").isIpAddress; -var _a = require("../utils/constants"), SAMPLE_IP = _a.SAMPLE_IP, DEFAULT_PASSWORD = _a.DEFAULT_PASSWORD; -var _b = require("../utils/messageHandler"), printMessage = _b.printMessage, printError = _b.printError, printMessageAndExit = _b.printMessageAndExit, errorHandler = _b.errorHandler; -var newPasswordFirstTry = undefined; -var questions = [ +const MachineHelper = require("../helpers/MachineHelper"); +const SystemApi = require("../api/SystemApi"); +const LoginApi = require("../api/LoginApi"); +const inquirer = require("inquirer"); +const { findDefaultCaptainName } = require("../utils/loginHelpers"); +const { isIpAddress } = require("../utils/validationsHandler"); +const { SAMPLE_IP, DEFAULT_PASSWORD } = require("../utils/constants"); +const { printMessage, printError, printMessageAndExit, errorHandler } = require("../utils/messageHandler"); +let newPasswordFirstTry = undefined; +const questions = [ { type: "list", name: "hasInstalledCaptain", @@ -52,8 +24,8 @@ var questions = [ "\nmkdir /captain && docker run -p 80:80 -p 443:443 -p 3000:3000 -v /var/run/docker.sock:/var/run/docker.sock dockersaturn/captainduckduck ?", default: "Yes", choices: ["Yes", "No"], - filter: function (value) { - var answerFromUser = value.trim(); + filter: value => { + const answerFromUser = value.trim(); if (answerFromUser === "Yes") return answerFromUser; printMessage("\n\nCannot start the setup process if Captain is not installed."); @@ -65,63 +37,42 @@ var questions = [ default: SAMPLE_IP, name: "captainAddress", message: "Enter IP address of your captain server:", - filter: function (value) { return __awaiter(_this, void 0, void 0, function () { - var ipFromUser, data, e_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - ipFromUser = value.trim(); - if (ipFromUser === SAMPLE_IP || !isIpAddress(ipFromUser)) { - printError("\nThis is an invalid IP Address: " + ipFromUser, true); - } - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, LoginApi.loginMachine("http://" + ipFromUser + ":3000", DEFAULT_PASSWORD)]; - case 2: - data = _a.sent(); - SystemApi.setIpAddressOfServer(ipFromUser); - // All went well - if (data) - return [2 /*return*/, ipFromUser]; - return [3 /*break*/, 4]; - case 3: - e_1 = _a.sent(); - errorHandler(e_1); - return [3 /*break*/, 4]; - case 4: return [2 /*return*/]; - } - }); - }); } + filter: (value) => __awaiter(this, void 0, void 0, function* () { + const ipFromUser = value.trim(); + if (ipFromUser === SAMPLE_IP || !isIpAddress(ipFromUser)) { + printError(`\nThis is an invalid IP Address: ${ipFromUser}`, true); + } + try { + // login using captain42. and set the ipAddressToServer + const data = yield LoginApi.loginMachine(`http://${ipFromUser}:3000`, DEFAULT_PASSWORD); + SystemApi.setIpAddressOfServer(ipFromUser); + // All went well + if (data) + return ipFromUser; + } + catch (e) { + errorHandler(e); + } + }) }, { type: "password", name: "captainOriginalPassword", message: "Enter your current password:", - when: function () { return !LoginApi.token; }, - filter: function (value) { return __awaiter(_this, void 0, void 0, function () { - var captainPasswordFromUser, data, e_2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - captainPasswordFromUser = value.trim(); - return [4 /*yield*/, LoginApi.loginMachine("http://" + SystemApi.ipAddressOfServer + ":3000", captainPasswordFromUser)]; - case 1: - data = _a.sent(); - if (data) { - SystemApi.setIpAddressOfServer(captainPasswordFromUser); - LoginApi.setOldPassword(captainPasswordFromUser); - } - return [3 /*break*/, 3]; - case 2: - e_2 = _a.sent(); - errorHandler(e_2); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; + when: () => !LoginApi.token, + filter: (value) => __awaiter(this, void 0, void 0, function* () { + try { + const captainPasswordFromUser = value.trim(); + const data = yield LoginApi.loginMachine(`http://${SystemApi.ipAddressOfServer}:3000`, captainPasswordFromUser); + if (data) { + SystemApi.setIpAddressOfServer(captainPasswordFromUser); + LoginApi.setOldPassword(captainPasswordFromUser); } - }); - }); } + } + catch (e) { + errorHandler(e); + } + }) }, { type: "input", @@ -129,66 +80,44 @@ var questions = [ message: "Enter a root domain for this Captain server. For example, enter test.yourdomain.com if you" + " setup your DNS to point *.test.yourdomain.com to ip address of your server" + ": ", - filter: function (value) { return __awaiter(_this, void 0, void 0, function () { - var captainRootDomainFromUser, data, newCustomDomainFromUser, e_3; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - captainRootDomainFromUser = value.trim(); - return [4 /*yield*/, SystemApi.setCustomDomain("http://" + SystemApi.ipAddressOfServer + ":3000", captainRootDomainFromUser)]; - case 1: - data = _a.sent(); - if (data) { - newCustomDomainFromUser = "captain." + captainRootDomainFromUser; - SystemApi.setCustomDomainFromUser(newCustomDomainFromUser); - return [2 /*return*/, captainRootDomainFromUser]; - } - return [3 /*break*/, 3]; - case 2: - e_3 = _a.sent(); - errorHandler(e_3); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; + filter: (value) => __awaiter(this, void 0, void 0, function* () { + try { + const captainRootDomainFromUser = value.trim(); + const data = yield SystemApi.setCustomDomain(`http://${SystemApi.ipAddressOfServer}:3000`, captainRootDomainFromUser); + if (data) { + const newCustomDomainFromUser = `captain.${captainRootDomainFromUser}`; + SystemApi.setCustomDomainFromUser(newCustomDomainFromUser); + return captainRootDomainFromUser; } - }); - }); } + } + catch (e) { + errorHandler(e); + } + }) }, { type: "input", name: "emailAddress", message: "Enter your 'valid' email address to enable HTTPS: ", - filter: function (value) { return __awaiter(_this, void 0, void 0, function () { - var emailAddressFromUser, customDomainFromUser, data, e_4; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 3, , 4]); - emailAddressFromUser = value.trim(); - customDomainFromUser = SystemApi.customDomainFromUser; - return [4 /*yield*/, SystemApi.enableHttps("http://" + customDomainFromUser, emailAddressFromUser)]; - case 1: - _a.sent(); - return [4 /*yield*/, SystemApi.forceHttps("https://" + customDomainFromUser)]; - case 2: - data = _a.sent(); - if (data) - return [2 /*return*/, emailAddressFromUser]; - return [3 /*break*/, 4]; - case 3: - e_4 = _a.sent(); - errorHandler(e_4); - return [3 /*break*/, 4]; - case 4: return [2 /*return*/]; - } - }); - }); } + filter: (value) => __awaiter(this, void 0, void 0, function* () { + try { + const emailAddressFromUser = value.trim(); + const { customDomainFromUser } = SystemApi; + yield SystemApi.enableHttps(`http://${customDomainFromUser}`, emailAddressFromUser); + const data = yield SystemApi.forceHttps(`https://${customDomainFromUser}`); + if (data) + return emailAddressFromUser; + } + catch (e) { + errorHandler(e); + } + }) }, { type: "password", name: "newPasswordFirstTry", message: "Enter a new password:", - filter: function (value) { + filter: value => { newPasswordFirstTry = value; return value; } @@ -197,54 +126,38 @@ var questions = [ type: "password", name: "newPassword", message: "Enter a new password:", - filter: function (value) { return __awaiter(_this, void 0, void 0, function () { - var customDomainFromUser, confirmPasswordValueFromUser, machineUrl, changePassData, loginData, e_5; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - customDomainFromUser = SystemApi.customDomainFromUser; - _a.label = 1; - case 1: - _a.trys.push([1, 5, , 6]); - confirmPasswordValueFromUser = value; - machineUrl = "https://" + customDomainFromUser; - if (newPasswordFirstTry !== confirmPasswordValueFromUser) { - printError("Passwords do not match", true); - } - return [4 /*yield*/, LoginApi.changePass(machineUrl, confirmPasswordValueFromUser)]; - case 2: - changePassData = _a.sent(); - if (!changePassData) return [3 /*break*/, 4]; - return [4 /*yield*/, LoginApi.login(machineUrl, confirmPasswordValueFromUser)]; - case 3: - loginData = _a.sent(); - if (loginData) - return [2 /*return*/]; - _a.label = 4; - case 4: return [3 /*break*/, 6]; - case 5: - e_5 = _a.sent(); - printError("\nIMPORTANT!! Server setup is completed by password is not changed."); - printError("\nYou CANNOT use serversetup anymore. To continue:"); - printError("\n- Go to https://" + customDomainFromUser + " login with default password and change the password in settings."); - printError("\n- In terminal (here), type captainduckduck login and enter this as your root domain: " + customDomainFromUser, true); - return [3 /*break*/, 6]; - case 6: return [2 /*return*/]; + filter: (value) => __awaiter(this, void 0, void 0, function* () { + const { customDomainFromUser } = SystemApi; + try { + const confirmPasswordValueFromUser = value; + const machineUrl = `https://${customDomainFromUser}`; + if (newPasswordFirstTry !== confirmPasswordValueFromUser) { + printError("Passwords do not match", true); } - }); - }); } + const changePassData = yield LoginApi.changePass(machineUrl, confirmPasswordValueFromUser); + if (changePassData) { + const loginData = yield LoginApi.login(machineUrl, confirmPasswordValueFromUser); + if (loginData) + return; + } + } + catch (e) { + printError("\nIMPORTANT!! Server setup is completed by password is not changed."); + printError("\nYou CANNOT use serversetup anymore. To continue:"); + printError(`\n- Go to https://${customDomainFromUser} login with default password and change the password in settings.`); + printError(`\n- In terminal (here), type captainduckduck login and enter this as your root domain: ${customDomainFromUser}`, true); + } + }) }, { type: "input", name: "captainName", message: "Enter a name for this Captain machine:", default: findDefaultCaptainName(), - validate: function (value) { - var newMachineName = value.trim(); - MachineHelper.machines.map(function (machine) { - return machine.name === newMachineName && - newMachineName + " already exist. If you want to replace the existing entry, you have to first use command, and then re-login."; - }); + validate: value => { + const newMachineName = value.trim(); + MachineHelper.machines.map(machine => machine.name === newMachineName && + `${newMachineName} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.`); if (value.match(/^[-\d\w]+$/i)) { return true; } @@ -253,27 +166,19 @@ var questions = [ } ]; function serversetup() { - return __awaiter(this, void 0, void 0, function () { - var answers, captainAddress, newMachine; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - printMessage("\nSetup your Captain server\n"); - return [4 /*yield*/, inquirer.prompt(questions)]; - case 1: - answers = _a.sent(); - captainAddress = "https://" + SystemApi.customDomainFromUser; - newMachine = { - authToken: LoginApi.token, - baseUrl: captainAddress, - name: answers.captainName - }; - MachineHelper.addMachine(newMachine); - printMessage("\n\nCaptain is available at " + captainAddress); - printMessage("\nFor more details and docs see http://www.captainduckduck.com\n\n"); - return [2 /*return*/]; - } - }); + return __awaiter(this, void 0, void 0, function* () { + printMessage("\nSetup your Captain server\n"); + const answers = yield inquirer.prompt(questions); + const captainAddress = `https://${SystemApi.customDomainFromUser}`; + const newMachine = { + authToken: LoginApi.token, + baseUrl: captainAddress, + name: answers.captainName + }; + MachineHelper.addMachine(newMachine); + printMessage(`\n\nCaptain is available at ${captainAddress}`); + printMessage("\nFor more details and docs see http://www.captainduckduck.com\n\n"); }); } module.exports = serversetup; +//# sourceMappingURL=serversetup.js.map \ No newline at end of file diff --git a/app-cli/built/commands/serversetup.js.map b/app-cli/built/commands/serversetup.js.map new file mode 100644 index 0000000..91d6e11 --- /dev/null +++ b/app-cli/built/commands/serversetup.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serversetup.js","sourceRoot":"","sources":["../../src/commands/serversetup.js"],"names":[],"mappings":";;;;;;;;;AAEA,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACzD,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAC7C,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;AAC3C,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AACpC,MAAM,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AACnE,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAA;AAC9D,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AACrE,MAAM,EACJ,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,YAAY,EACb,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAA;AACtC,IAAI,mBAAmB,GAAG,SAAS,CAAA;AACnC,MAAM,SAAS,GAAG;IAChB;QACE,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EACL,kFAAkF;YAClF,6IAA6I;QAC/I,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC;QACtB,MAAM,EAAE,KAAK,CAAC,EAAE;YACd,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;YAEnC,IA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AAE,wCAAwC;QACjD,OAAO,EAAE,sBAAsB,EAAE;QACjC,QAAQ,EAAE,KAAK,CAAC,EAAE;YAChB,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;YAEnC,aAAa,CAAC,QAAQ,CAAC,GAAG,CACxB,OAAO,CAAC,EAAE,CACR,OAAO,CAAC,IAAI,KAAK,cAAc;gBAC/B,GAAG,cAAc,uHAAuH,CAC3I,CAAA;YAED,IAAI,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE;gBAC9B,OAAO,IAAI,CAAA;aACZ;YAED,OAAO,8BAA8B,CAAA;QACvC,CAAC;KACF;CACF,CAAA;AAED,SAAe,WAAW;;QACxB,YAAY,CAAC,+BAA+B,CAAC,CAAA;QAE7C,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;QAChD,MAAM,cAAc,GAAG,WAAW,SAAS,CAAC,oBAAoB,EAAE,CAAA;QAClE,MAAM,UAAU,GAAG;YACjB,SAAS,EAAE,QAAQ,CAAC,KAAK;YACzB,OAAO,EAAE,cAAc;YACvB,IAAI,EAAE,OAAO,CAAC,WAAW;SAC1B,CAAA;QAED,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC,CAAA;QAEpC,YAAY,CAAC,+BAA+B,cAAc,EAAE,CAAC,CAAA;QAE7D,YAAY,CACV,oEAAoE,CACrE,CAAA;IACH,CAAC;CAAA;AAED,MAAM,CAAC,OAAO,GAAG,WAAW,CAAA"} \ No newline at end of file diff --git a/app-cli/built/helpers/MachineHelper.js b/app-cli/built/helpers/MachineHelper.js index b404c0a..9d7b99e 100755 --- a/app-cli/built/helpers/MachineHelper.js +++ b/app-cli/built/helpers/MachineHelper.js @@ -1,86 +1,75 @@ -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var printMessage = require("../utils/messageHandler").printMessage; -var configstore = require("configstore"); -var packagejson = require("../../package.json"); -var configs = new configstore(packagejson.name, { +const { printMessage } = require("../utils/messageHandler"); +const configstore = require("configstore"); +const packagejson = require("../../package.json"); +const configs = new configstore(packagejson.name, { captainMachines: [] }); -var MachineHelper = /** @class */ (function () { - function MachineHelper() { +class MachineHelper { + constructor() { this.machines = configs.get("captainMachines"); this.apps = configs.get("apps"); } - MachineHelper.prototype.getMachinesAsOptions = function () { - var firstItemInOption = [ + getMachinesAsOptions() { + const firstItemInOption = [ { name: "-- CANCEL --", value: "", short: "" } ]; - var listOfMachines = this.machines.map(function (machine) { + const listOfMachines = this.machines.map(machine => { return { - name: machine.name + " at " + machine.baseUrl, - value: "" + machine.name, - short: machine.name + " at " + machine.baseUrl + name: `${machine.name} at ${machine.baseUrl}`, + value: `${machine.name}`, + short: `${machine.name} at ${machine.baseUrl}` }; }); - return firstItemInOption.concat(listOfMachines); - }; - MachineHelper.prototype.setMachines = function (newMachines) { + return [...firstItemInOption, ...listOfMachines]; + } + setMachines(newMachines) { this.machines = newMachines; configs.set("captainMachines", newMachines); - }; - MachineHelper.prototype.updateMachineAuthToken = function (machineName, authToken) { - var updatedMachine = {}; - var newMachines = this.machines.map(function (machine) { + } + updateMachineAuthToken(machineName, authToken) { + let updatedMachine = {}; + const newMachines = this.machines.map(machine => { if (machine.name === machineName) { - updatedMachine = __assign({}, machine, { authToken: authToken }); + updatedMachine = Object.assign({}, machine, { authToken }); return updatedMachine; } return machine; }); this.setMachines(newMachines); this.updateAppsAuthToken(updatedMachine); - }; - MachineHelper.prototype.updateAppsAuthToken = function (updatedMachine) { + } + updateAppsAuthToken(updatedMachine) { if (!updatedMachine) return; - var newApps = this.apps.map(function (app) { + const newApps = this.apps.map(app => { if (app.machineToDeploy.name === updatedMachine.name) { - return __assign({}, app, { machineToDeploy: updatedMachine }); + return Object.assign({}, app, { machineToDeploy: updatedMachine }); } return app; }); this.setApps(newApps); - }; - MachineHelper.prototype.setApps = function (newApps) { + } + setApps(newApps) { this.apps = newApps; configs.set("apps", newApps); - }; - MachineHelper.prototype.addMachine = function (newMachine) { - var tempMachines = this.machines; - var newMachines = tempMachines.concat([newMachine]); + } + addMachine(newMachine) { + const tempMachines = this.machines; + const newMachines = [...tempMachines, newMachine]; // Add to local storage configs.set("captainMachines", newMachines); this.setMachines(configs.get("captainMachines")); - }; - MachineHelper.prototype.logoutMachine = function (machineName) { - var removedMachine = this.machines.filter(function (machine) { return machine.name === machineName; })[0]; - var newMachines = this.machines.filter(function (machine) { return machine.name !== machineName; }); + } + logoutMachine(machineName) { + const removedMachine = this.machines.filter(machine => machine.name === machineName)[0]; + const newMachines = this.machines.filter(machine => machine.name !== machineName); this.setMachines(newMachines); - printMessage("You are now logged out from " + removedMachine.name + " at " + removedMachine.baseUrl + "...\n"); - }; - return MachineHelper; -}()); + printMessage(`You are now logged out from ${removedMachine.name} at ${removedMachine.baseUrl}...\n`); + } +} module.exports = new MachineHelper(); +//# sourceMappingURL=MachineHelper.js.map \ No newline at end of file diff --git a/app-cli/built/helpers/MachineHelper.js.map b/app-cli/built/helpers/MachineHelper.js.map new file mode 100644 index 0000000..138dc57 --- /dev/null +++ b/app-cli/built/helpers/MachineHelper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"MachineHelper.js","sourceRoot":"","sources":["../../src/helpers/MachineHelper.js"],"names":[],"mappings":"AAAA,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAA;AAC3D,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;AAC1C,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AACjD,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE;IAChD,eAAe,EAAE,EAAE;CACpB,CAAC,CAAA;AAEF,MAAM,aAAa;IACjB;QACE,I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c,CAAC,IAAI,OAChD,cAAc,CAAC,OACjB,OAAO,CACR,CAAA;IACH,CAAC;CACF;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,aAAa,EAAE,CAAA"} \ No newline at end of file diff --git a/app-cli/built/helpers/SpinnerHelper.js b/app-cli/built/helpers/SpinnerHelper.js index 9b35f6c..8869159 100755 --- a/app-cli/built/helpers/SpinnerHelper.js +++ b/app-cli/built/helpers/SpinnerHelper.js @@ -1,23 +1,23 @@ -var ora = require("ora"); -var SpinnerHelper = /** @class */ (function () { - function SpinnerHelper() { +const ora = require("ora"); +class SpinnerHelper { + constructor() { this.spinner; } - SpinnerHelper.prototype.setColor = function (color) { + setColor(color) { this.spinner.color = color; - }; - SpinnerHelper.prototype.start = function (message) { + } + start(message) { this.spinner = ora(message).start(); - }; - SpinnerHelper.prototype.stop = function () { + } + stop() { this.spinner.stop(); - }; - SpinnerHelper.prototype.succeed = function () { + } + succeed() { this.spinner.succeed(); - }; - SpinnerHelper.prototype.fail = function () { + } + fail() { this.spinner.fail(); - }; - return SpinnerHelper; -}()); + } +} module.exports = new SpinnerHelper(); +//# sourceMappingURL=SpinnerHelper.js.map \ No newline at end of file diff --git a/app-cli/built/helpers/SpinnerHelper.js.map b/app-cli/built/helpers/SpinnerHelper.js.map new file mode 100644 index 0000000..fbbe894 --- /dev/null +++ b/app-cli/built/helpers/SpinnerHelper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"SpinnerHelper.js","sourceRoot":"","sources":["../../src/helpers/SpinnerHelper.js"],"names":[],"mappings":"AAAA,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAA;AAE1B,MAAM,aAAa;IACjB;QACE,IAAI,CAAC,OAAO,CAAA;IACd,CAAC;IAED,QAAQ,CAAC,KAAK;QACZ,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAA;IAC5B,CAAC;IAED,KAAK,CAAC,OAAO;QACX,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAA;IACrC,CAAC;IAED,IAAI;QACF,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAA;IACrB,CAAC;IAED,OAAO;QACL,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAA;IACxB,CAAC;IAED,IAAI;QACF,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAA;IACrB,CAAC;CACF;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,aAAa,EAAE,CAAA"} \ No newline at end of file diff --git a/app-cli/built/utils/__tests__/loginHelpers.test.js b/app-cli/built/utils/__tests__/loginHelpers.test.js index 1e2ed56..ca3a4cf 100755 --- a/app-cli/built/utils/__tests__/loginHelpers.test.js +++ b/app-cli/built/utils/__tests__/loginHelpers.test.js @@ -1,5 +1,5 @@ -var _a = require("../loginHelpers"), cleanUpUrl = _a.cleanUpUrl, findDefaultCaptainName = _a.findDefaultCaptainName, getCaptainFullName = _a.getCaptainFullName; -jest.mock("../../helpers/MachineHelper", function () { +const { cleanUpUrl, findDefaultCaptainName, getCaptainFullName } = require("../loginHelpers"); +jest.mock("../../helpers/MachineHelper", () => { return { machines: [ { @@ -15,22 +15,23 @@ jest.mock("../../helpers/MachineHelper", function () { ] }; }); -describe("Login helpers", function () { - it("should clean a url", function () { - var mockUrl = "https://www.google.com"; - var expectedResult = "www.google.com"; - var result = cleanUpUrl(mockUrl); +describe("Login helpers", () => { + it("should clean a url", () => { + const mockUrl = "https://www.google.com"; + const expectedResult = "www.google.com"; + const result = cleanUpUrl(mockUrl); expect(result).toBe(expectedResult); }); - it("should get a captain machine name", function () { - var result = getCaptainFullName(1); - var expectedResult = "captain-01"; + it("should get a captain machine name", () => { + const result = getCaptainFullName(1); + const expectedResult = "captain-01"; expect(result).toBe(expectedResult); }); - it("should find an unused name for a possible new captain machine", function () { + it("should find an unused name for a possible new captain machine", () => { // If machines are 2, then it should be with suffix 03 - var result = findDefaultCaptainName(); - var expectedResult = "captain-03"; + const result = findDefaultCaptainName(); + const expectedResult = "captain-03"; expect(result).toBe(expectedResult); }); }); +//# sourceMappingURL=loginHelpers.test.js.map \ No newline at end of file diff --git a/app-cli/built/utils/__tests__/loginHelpers.test.js.map b/app-cli/built/utils/__tests__/loginHelpers.test.js.map new file mode 100644 index 0000000..670d8a1 --- /dev/null +++ b/app-cli/built/utils/__tests__/loginHelpers.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"loginHelpers.test.js","sourceRoot":"","sources":["../../../src/utils/__tests__/loginHelpers.test.js"],"names":[],"mappings":"AAAA,MAAM,EACJ,UAAU,EACV,sBAAsB,EACtB,kBAAkB,EACnB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;AAE9B,IAAI,CAAC,IAAI,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC5C,OAAO;QACL,QAAQ,EAAE;YACR;gBACE,OAAO,EAAE,oCAAoC;gBAC7C,IAAI,EAAE,YAAY;gBAClB,SAAS,EAAE,QAAQ;aACpB;YACD;gBACE,OAAO,EAAE,qCAAqC;gBAC9C,IAAI,EAAE,YAAY;gBAClB,SAAS,EAAE,QAAQ;aACpB;SACF;KACF,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAC5B,MAAM,OAAO,GAAG,wBAAwB,CAAA;QACxC,MAAM,cAAc,GAAG,gBAAgB,CAAA;QACvC,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;QAElC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC3C,MAAM,MAAM,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAA;QACpC,MAAM,cAAc,GAAG,YAAY,CAAA;QAEnC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;QACvE,sDAAsD;QACtD,MAAM,MAAM,GAAG,sBAAsB,EAAE,CAAA;QACvC,MAAM,cAAc,GAAG,YAAY,CAAA;QAEnC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/app-cli/built/utils/__tests__/machineUtils.test.js b/app-cli/built/utils/__tests__/machineUtils.test.js index c031f33..4d605b4 100755 --- a/app-cli/built/utils/__tests__/machineUtils.test.js +++ b/app-cli/built/utils/__tests__/machineUtils.test.js @@ -1,7 +1,7 @@ -var _a = require("../machineUtils"), initMachineFromLocalStorage = _a.initMachineFromLocalStorage, saveMachineToLocalStorage = _a.saveMachineToLocalStorage; -var DeployApi = require("../../api/DeployApi"); -var MachineHelper = require("../../helpers/MachineHelper"); -var mockUpdatedApps = [ +const { initMachineFromLocalStorage, saveMachineToLocalStorage } = require("../machineUtils"); +const DeployApi = require("../../api/DeployApi"); +const MachineHelper = require("../../helpers/MachineHelper"); +const mockUpdatedApps = [ { cwd: process.cwd(), appName: "captain-node-app-new-name", @@ -13,7 +13,7 @@ var mockUpdatedApps = [ } } ]; -jest.mock("../../helpers/MachineHelper", function () { +jest.mock("../../helpers/MachineHelper", () => { return { apps: [ { @@ -30,7 +30,7 @@ jest.mock("../../helpers/MachineHelper", function () { setApps: jest.fn() }; }); -jest.mock("../../api/DeployApi", function () { +jest.mock("../../api/DeployApi", () => { return { setMachineToDeploy: jest.fn(), setAppName: jest.fn(), @@ -44,16 +44,17 @@ jest.mock("../../api/DeployApi", function () { } }; }); -describe("Machine utils", function () { - it("should init machine from localStorage", function () { +describe("Machine utils", () => { + it("should init machine from localStorage", () => { initMachineFromLocalStorage(); expect(DeployApi.setMachineToDeploy).toHaveBeenCalledTimes(1); expect(DeployApi.setAppName).toHaveBeenCalledTimes(1); expect(DeployApi.setBranchToPush).toHaveBeenCalledTimes(1); }); - it("should update an app from localstorage", function () { + it("should update an app from localstorage", () => { saveMachineToLocalStorage(); - var updatedApps = mockUpdatedApps; + const updatedApps = mockUpdatedApps; expect(MachineHelper.setApps).toBeCalledWith(updatedApps); }); }); +//# sourceMappingURL=machineUtils.test.js.map \ No newline at end of file diff --git a/app-cli/built/utils/__tests__/machineUtils.test.js.map b/app-cli/built/utils/__tests__/machineUtils.test.js.map new file mode 100644 index 0000000..00bccb8 --- /dev/null +++ b/app-cli/built/utils/__tests__/machineUtils.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"machineUtils.test.js","sourceRoot":"","sources":["../../../src/utils/__tests__/machineUtils.test.js"],"names":[],"mappings":"AAAA,MAAM,EACJ,2BAA2B,EAC3B,yBAAyB,EAC1B,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;AAC9B,MAAM,SAAS,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAChD,MAAM,aAAa,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAA;AAC5D,MAAM,eAAe,GAAG;IACtB;QACE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,OAAO,EAAE,2BAA2B;QACpC,YAAY,EAAE,QAAQ;QACtB,eAAe,EAAE;YACf,OAAO,EAAE,sCAAsC;YAC/C,IAAI,EAAE,UAAU;YAChB,SAAS,EAAE,QAAQ;SACpB;KACF;CACF,CAAA;AAED,IAAI,CAAC,IAAI,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC5C,OAAO;QACL,IAAI,EAAE;YACJ;gBACE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;gBAClB,OAAO,EAAE,kBAAkB;gBAC3B,YAAY,EAAE,QAAQ;gBACtB,eAAe,EAAE;oBACf,OAAO,EAAE,sCAAsC;oBAC/C,IAAI,EAAE,UAAU;oBAChB,SAAS,EAAE,QAAQ;iBACpB;aACF;SACF;QACD,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE;KACnB,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACpC,OAAO;QACL,kBAAkB,EAAE,IAAI,CAAC,EAAE,EAAE;QAC7B,UAAU,EAAE,IAAI,CAAC,EAAE,EAAE;QACrB,eAAe,EAAE,IAAI,CAAC,EAAE,EAAE;QAC1B,OAAO,EAAE,2BAA2B;QACpC,YAAY,EAAE,QAAQ;QACtB,eAAe,EAAE;YACf,OAAO,EAAE,sCAAsC;YAC/C,IAAI,EAAE,UAAU;YAChB,SAAS,EAAE,QAAQ;SACpB;KACF,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC/C,2BAA2B,EAAE,CAAA;QAE7B,MAAM,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;QAE7D,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;QAErD,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;IAC5D,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,yBAAyB,EAAE,CAAA;QAE3B,MAAM,WAAW,GAAG,eAAe,CAAA;QAEnC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;IAC3D,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/app-cli/built/utils/__tests__/validationsHandler.test.js b/app-cli/built/utils/__tests__/validationsHandler.test.js index f52f184..7e01ae6 100755 --- a/app-cli/built/utils/__tests__/validationsHandler.test.js +++ b/app-cli/built/utils/__tests__/validationsHandler.test.js @@ -6,104 +6,70 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var _this = this; -var _a = require("../validationsHandler"), validateIsGitRepository = _a.validateIsGitRepository, validateDefinitionFile = _a.validateDefinitionFile, optionIsNotGiven = _a.optionIsNotGiven, isIpAddress = _a.isIpAddress, validateAuthentication = _a.validateAuthentication; -var printError = require("../messageHandler").printError; -var requestLogin = require("../../commands/login").requestLogin; -var initMachineFromLocalStorage = require("../machineUtils").initMachineFromLocalStorage; +const { validateIsGitRepository, validateDefinitionFile, optionIsNotGiven, isIpAddress, validateAuthentication } = require("../validationsHandler"); +const { printError } = require("../messageHandler"); +const { requestLogin } = require("../../commands/login"); +const { initMachineFromLocalStorage } = require("../machineUtils"); jest.mock("fs"); -jest.mock("../messageHandler", function () { +jest.mock("../messageHandler", () => { return { printError: jest.fn() }; }); -jest.mock("../../api/DeployApi", function () { +jest.mock("../../api/DeployApi", () => { return { - isAuthTokenValid: jest.fn(function () { return false; }) // Simulates it's not authenticated + isAuthTokenValid: jest.fn(() => false) // Simulates it's not authenticated }; }); -jest.mock("../../commands/login", function () { +jest.mock("../../commands/login", () => { return { requestLogin: jest.fn() }; }); -jest.mock("../machineUtils", function () { +jest.mock("../machineUtils", () => { return { initMachineFromLocalStorage: jest.fn() }; }); -describe("Validations handler", function () { - it("should printError if not on a git repository", function () { +describe("Validations handler", () => { + it("should printError if not on a git repository", () => { validateIsGitRepository(); expect(printError).toHaveBeenCalledTimes(1); }); - it("should printError if there is no captain definition file", function () { + it("should printError if there is no captain definition file", () => { validateDefinitionFile(); // 2nd time because file was not found // 3rd time because it tried to read from a file and was not valid json expect(printError).toHaveBeenCalledTimes(3); }); - it("should return false if the option is included", function () { - var options = { + it("should return false if the option is included", () => { + const options = { branch: "master" }; - var result = optionIsNotGiven(options, "branch"); + const result = optionIsNotGiven(options, "branch"); expect(result).toBe(false); }); - it("should return true if the option is not given", function () { - var options = { + it("should return true if the option is not given", () => { + const options = { test: "something" }; - var result = optionIsNotGiven(options, "branch"); + const result = optionIsNotGiven(options, "branch"); expect(result).toBe(true); }); - it("should be a valid IP Address", function () { - var validIpAddress = "192.168.1.1"; - var result = isIpAddress(validIpAddress); + it("should be a valid IP Address", () => { + const validIpAddress = "192.168.1.1"; + const result = isIpAddress(validIpAddress); expect(result).toBe(true); }); - it("should be an invalid IP Address", function () { - var validIpAddress = "192.168.1"; - var result = isIpAddress(validIpAddress); + it("should be an invalid IP Address", () => { + const validIpAddress = "192.168.1"; + const result = isIpAddress(validIpAddress); expect(result).toBe(false); }); - it("should promt the login option and initialize from the machine in localstorage", function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, validateAuthentication()]; - case 1: - _a.sent(); - expect(requestLogin).toBeCalledTimes(1); - expect(initMachineFromLocalStorage).toBeCalledTimes(1); - return [2 /*return*/]; - } - }); - }); }); + it("should promt the login option and initialize from the machine in localstorage", () => __awaiter(this, void 0, void 0, function* () { + yield validateAuthentication(); + expect(requestLogin).toBeCalledTimes(1); + expect(initMachineFromLocalStorage).toBeCalledTimes(1); + })); }); +//# sourceMappingURL=validationsHandler.test.js.map \ No newline at end of file diff --git a/app-cli/built/utils/__tests__/validationsHandler.test.js.map b/app-cli/built/utils/__tests__/validationsHandler.test.js.map new file mode 100644 index 0000000..af4dbec --- /dev/null +++ b/app-cli/built/utils/__tests__/validationsHandler.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validationsHandler.test.js","sourceRoot":"","sources":["../../../src/utils/__tests__/validationsHandler.test.js"],"names":[],"mappings":";;;;;;;;AAAA,MAAM,EACJ,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,EAChB,WAAW,EACX,sBAAsB,EACvB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AACpC,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;AACnD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAA;AACxD,MAAM,EAAE,2BAA2B,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;AAElE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAEf,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAClC,OAAO;QACL,UAAU,EAAE,IAAI,CAAC,EAAE,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,EAAE;QACvD,MAAM,OAAO,GAAG;YACd,IAAI,EAAE,WAAW;SAClB,CAAA;QACD,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;QAElD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,MAAM,cAAc,GAAG,aAAa,CAAA;QACpC,MAAM,MAAM,GAAG,WAAW,CAAC,cAAc,CAAC,CAAA;QAE1C,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;QACzC,MAAM,cAAc,GAAG,WAAW,CAAA;QAClC,MAAM,MAAM,GAAG,WAAW,CAAC,cAAc,CAAC,CAAA;QAE1C,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC5B,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,+EAA+E,EAAE,GAAS,EAAE;QAC7F,MAAM,sBAAsB,EAAE,CAAA;QAE9B,MAAM,CAAC,YAAY,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;QAEvC,MAAM,CAAC,2BAA2B,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;IACxD,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/app-cli/built/utils/constants.js b/app-cli/built/utils/constants.js index 1cf94b1..9d28cea 100755 --- a/app-cli/built/utils/constants.js +++ b/app-cli/built/utils/constants.js @@ -1,14 +1,15 @@ -var SAMPLE_DOMAIN = "captain.captainroot.yourdomain.com"; -var SAMPLE_IP = "123.123.123.123"; -var DEFAULT_PASSWORD = "captain42"; -var DEFAULT_BRANCH_TO_PUSH = "branchToPush"; -var DEFAULT_APP_NAME = "appName"; -var EMPTY_STRING = ""; +const SAMPLE_DOMAIN = "captain.captainroot.yourdomain.com"; +const SAMPLE_IP = "123.123.123.123"; +const DEFAULT_PASSWORD = "captain42"; +const DEFAULT_BRANCH_TO_PUSH = "branchToPush"; +const DEFAULT_APP_NAME = "appName"; +const EMPTY_STRING = ""; module.exports = { - SAMPLE_DOMAIN: SAMPLE_DOMAIN, - SAMPLE_IP: SAMPLE_IP, - DEFAULT_PASSWORD: DEFAULT_PASSWORD, - DEFAULT_BRANCH_TO_PUSH: DEFAULT_BRANCH_TO_PUSH, - DEFAULT_APP_NAME: DEFAULT_APP_NAME, - EMPTY_STRING: EMPTY_STRING + SAMPLE_DOMAIN, + SAMPLE_IP, + DEFAULT_PASSWORD, + DEFAULT_BRANCH_TO_PUSH, + DEFAULT_APP_NAME, + EMPTY_STRING }; +//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/app-cli/built/utils/constants.js.map b/app-cli/built/utils/constants.js.map new file mode 100644 index 0000000..238f108 --- /dev/null +++ b/app-cli/built/utils/constants.js.map @@ -0,0 +1 @@ +{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.js"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAAG,oCAAoC,CAAA;AAC1D,MAAM,SAAS,GAAG,iBAAiB,CAAA;AACnC,MAAM,gBAAgB,GAAG,WAAW,CAAA;AACpC,MAAM,sBAAsB,GAAG,cAAc,CAAA;AAC7C,MAAM,gBAAgB,GAAG,SAAS,CAAA;AAClC,MAAM,YAAY,GAAG,EAAE,CAAA;AAEvB,MAAM,CAAC,OAAO,GAAG;IACf,aAAa;IACb,SAAS;IACT,gBAAgB;IAChB,sBAAsB;IACtB,gBAAgB;IAChB,YAAY;CACb,CAAA"} \ No newline at end of file diff --git a/app-cli/built/utils/fileHelper.js b/app-cli/built/utils/fileHelper.js index 5039b55..39d77d0 100755 --- a/app-cli/built/utils/fileHelper.js +++ b/app-cli/built/utils/fileHelper.js @@ -6,64 +6,37 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var fs = require("fs-extra"); -var _a = require("./messageHandler"), printMessage = _a.printMessage, printError = _a.printError, printGreenMessage = _a.printGreenMessage, printMagentaMessage = _a.printMagentaMessage; -var SpinnerHelper = require("../helpers/SpinnerHelper"); -var exec = require("child_process").exec; -var ProgressBar = require("progress"); -var DeployApi = require("../api/DeployApi"); -var saveMachineToLocalStorage = require("../utils/machineUtils").saveMachineToLocalStorage; -var lastLineNumberPrinted = -10000; // we want to show all lines to begin with! +const fs = require("fs-extra"); +const { printMessage, printError, printGreenMessage, printMagentaMessage } = require("./messageHandler"); +const SpinnerHelper = require("../helpers/SpinnerHelper"); +const { exec } = require("child_process"); +const ProgressBar = require("progress"); +const DeployApi = require("../api/DeployApi"); +const { saveMachineToLocalStorage } = require("../utils/machineUtils"); +let lastLineNumberPrinted = -10000; // we want to show all lines to begin with! function gitArchiveFile(zipFileFullPath, branchToPush) { - exec("git archive --format tar --output \"" + zipFileFullPath + "\" " + branchToPush, function (err, stdout, stderr) { + exec(`git archive --format tar --output "${zipFileFullPath}" ${branchToPush}`, (err, stdout, stderr) => { if (err) { - printError("TAR file failed\n" + err + "\n"); + printError(`TAR file failed\n${err}\n`); fs.removeSync(zipFileFullPath); return; } - exec("git rev-parse " + branchToPush, function (err, stdout, stderr) { - var gitHash = (stdout || "").trim(); + exec(`git rev-parse ${branchToPush}`, (err, stdout, stderr) => { + const gitHash = (stdout || "").trim(); if (err || !/^[a-f0-9]{40}$/.test(gitHash)) { - printError("Cannot find hash of last commit on this branch: " + branchToPush + "\n" + gitHash + "\n" + err + "\n"); + printError(`Cannot find hash of last commit on this branch: ${branchToPush}\n${gitHash}\n${err}\n`); return; } - printMessage("Pushing last commit on " + branchToPush + ": " + gitHash); + printMessage(`Pushing last commit on ${branchToPush}: ${gitHash}`); uploadFile(zipFileFullPath, gitHash); }); }); } function onLogRetrieved(data) { if (data) { - var lines = data.logs.lines; - var firstLineNumberOfLogs = data.logs.firstLineNumber; - var firstLinesToPrint = 0; + const lines = data.logs.lines; + const firstLineNumberOfLogs = data.logs.firstLineNumber; + let firstLinesToPrint = 0; if (firstLineNumberOfLogs > lastLineNumberPrinted) { if (firstLineNumberOfLogs < 0) { // This is the very first fetch, probably firstLineNumberOfLogs is around -50 @@ -77,62 +50,53 @@ function onLogRetrieved(data) { firstLinesToPrint = lastLineNumberPrinted - firstLineNumberOfLogs; } lastLineNumberPrinted = firstLineNumberOfLogs + lines.length; - for (var i = firstLinesToPrint; i < lines.length; i++) { + for (let i = firstLinesToPrint; i < lines.length; i++) { printMessage((lines[i] || "").trim()); } } - var finishedBuilding = data && !data.isAppBuilding; + const finishedBuilding = data && !data.isAppBuilding; if (finishedBuilding) { if (!data.isBuildFailed) { - printGreenMessage("Deployed successfully: " + DeployApi.appName); - printMagentaMessage("App is available at " + DeployApi.appUrl + "\n", true); + printGreenMessage(`Deployed successfully: ${DeployApi.appName}`); + printMagentaMessage(`App is available at ${DeployApi.appUrl}\n`, true); } else { - printError("\nSomething bad happened. Cannot deploy \"" + DeployApi.appName + "\"\n", true); + printError(`\nSomething bad happened. Cannot deploy "${DeployApi.appName}"\n`, true); } } - setTimeout(function () { + setTimeout(() => { startFetchingBuildLogs(); }, 2000); } function startFetchingBuildLogs() { - return __awaiter(this, void 0, void 0, function () { - var data, response, error_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, DeployApi.fetchBuildLogs()]; - case 1: - data = _a.sent(); - response = JSON.parse(data); - if (response.status !== 100) { - throw new Error(JSON.stringify(response, null, 2)); - } - onLogRetrieved(response.data); - return [3 /*break*/, 3]; - case 2: - error_1 = _a.sent(); - printError("\nSomething while retrieving app build logs.. " + error_1 + "\n"); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; + return __awaiter(this, void 0, void 0, function* () { + try { + const data = yield DeployApi.fetchBuildLogs(); + const response = JSON.parse(data); + if (response.status !== 100) { + throw new Error(JSON.stringify(response, null, 2)); } - }); + onLogRetrieved(response.data); + } + catch (error) { + printError(`\nSomething while retrieving app build logs.. ${error}\n`); + // onLogRetrieved() // TODO - should this be here? + } }); } function getFileStream(zipFileFullPath) { - var fileSize = fs.statSync(zipFileFullPath).size; - var fileStream = fs.createReadStream(zipFileFullPath); - var barOpts = { + const fileSize = fs.statSync(zipFileFullPath).size; + const fileStream = fs.createReadStream(zipFileFullPath); + const barOpts = { width: 20, total: fileSize, clear: true }; - var bar = new ProgressBar(" uploading [:bar] :percent (ETA :etas)", barOpts); - fileStream.on("data", function (chunk) { + const bar = new ProgressBar(" uploading [:bar] :percent (ETA :etas)", barOpts); + fileStream.on("data", chunk => { bar.tick(chunk.length); }); - fileStream.on("end", function () { + fileStream.on("end", () => { printMessage("This might take several minutes. PLEASE BE PATIENT..."); SpinnerHelper.start("Building your source code..."); SpinnerHelper.setColor("yellow"); @@ -140,41 +104,31 @@ function getFileStream(zipFileFullPath) { return fileStream; } function uploadFile(filePath, gitHash) { - return __awaiter(this, void 0, void 0, function () { - var fileStream, response, data, somethingWentWrong, isDeployedAndBuilding, isDeployedSuccessfully, e_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - printMessage("Uploading file to " + DeployApi.machineToDeploy.baseUrl); - fileStream = getFileStream(filePath); - return [4 /*yield*/, DeployApi.sendFile(fileStream, gitHash)]; - case 1: - response = _a.sent(); - data = JSON.parse(response); - somethingWentWrong = data.status !== 100 && data.status !== 101; - isDeployedAndBuilding = data.status === 101; - isDeployedSuccessfully = data.status === 100; - if (somethingWentWrong) { - throw new Error(JSON.stringify(data, null, 2)); - } - deleteFileFromDisk(filePath); // Uncomment this - // Save app to local storage - saveMachineToLocalStorage(); - if (isDeployedAndBuilding) { - startFetchingBuildLogs(); - } - if (isDeployedSuccessfully) { - printGreenMessage("Deployed successfully: " + DeployApi.appName + "\n", true); - } - return [3 /*break*/, 3]; - case 2: - e_1 = _a.sent(); - printError(e_1.message, true); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; + return __awaiter(this, void 0, void 0, function* () { + try { + printMessage(`Uploading file to ${DeployApi.machineToDeploy.baseUrl}`); + const fileStream = getFileStream(filePath); + const response = yield DeployApi.sendFile(fileStream, gitHash); + const data = JSON.parse(response); + const somethingWentWrong = data.status !== 100 && data.status !== 101; + const isDeployedAndBuilding = data.status === 101; + const isDeployedSuccessfully = data.status === 100; + if (somethingWentWrong) { + throw new Error(JSON.stringify(data, null, 2)); } - }); + deleteFileFromDisk(filePath); // Uncomment this + // Save app to local storage + saveMachineToLocalStorage(); + if (isDeployedAndBuilding) { + startFetchingBuildLogs(); + } + if (isDeployedSuccessfully) { + printGreenMessage(`Deployed successfully: ${DeployApi.appName}\n`, true); + } + } + catch (e) { + printError(e.message, true); + } }); } function deleteFileFromDisk(filePath) { @@ -183,8 +137,9 @@ function deleteFileFromDisk(filePath) { } } module.exports = { - gitArchiveFile: gitArchiveFile, - getFileStream: getFileStream, - uploadFile: uploadFile, - startFetchingBuildLogs: startFetchingBuildLogs + gitArchiveFile, + getFileStream, + uploadFile, + startFetchingBuildLogs }; +//# sourceMappingURL=fileHelper.js.map \ No newline at end of file diff --git a/app-cli/built/utils/fileHelper.js.map b/app-cli/built/utils/fileHelper.js.map new file mode 100644 index 0000000..1f77d4c --- /dev/null +++ b/app-cli/built/utils/fileHelper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"fileHelper.js","sourceRoot":"","sources":["../../src/utils/fileHelper.js"],"names":[],"mappings":";;;;;;;;AAAA,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAC9B,MAAM,EACJ,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACpB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAC/B,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACzD,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;AACzC,MAAM,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AACvC,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAC7C,MAAM,EAAE,yBAAyB,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AACtE,IAAI,qBAAqB,GAAG,CAAC,KAAK,CAAA,CAAC,2CAA2C;AAE9E,SAAS,cAAc,CAA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GAAG,IAAI,CAAC,MAAM,KAAK,GAAG,CAAA;YACjD,MAAM,sBAAsB,GAAG,IAAI,CAAC,MAAM,KAAK,GAAG,CAAA;YAElD,IAAI,kBAAkB,EAAE;gBACtB,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;aAC/C;YAED,kBAAkB,CAAC,QAAQ,CAAC,CAAA,CAAC,iBAAiB;YAE9C,4BAA4B;YAC5B,yBAAyB,EAAE,CAAA;YAE3B,IAAI,qBAAqB,EAAE;gBACzB,sBAAsB,EAAE,CAAA;aACzB;YAED,IAAI,sBAAsB,EAAE;gBAC1B,iBAAiB,CAAC,0BAA0B,SAAS,CAAC,OAAO,IAAI,EAAE,IAAI,CAAC,CAAA;aACzE;SACF;QAAC,OAAO,CAAC,EAAE;YACV,UAAU,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;SAC5B;IACH,CAAC;CAAA;AAED,SAAS,kBAAkB,CAAC,QAAQ;IAClC,IAAI,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;QAC/B,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;KACxB;AACH,CAAC;AAED,MAAM,CAAC,OAAO,GAAG;IACf,cAAc;IACd,aAAa;IACb,UAAU;IACV,sBAAsB;CACvB,CAAA"} \ No newline at end of file diff --git a/app-cli/built/utils/loginHelpers.js b/app-cli/built/utils/loginHelpers.js index 3ac8742..ada451e 100755 --- a/app-cli/built/utils/loginHelpers.js +++ b/app-cli/built/utils/loginHelpers.js @@ -1,9 +1,9 @@ -var MachineHelper = require("../helpers/MachineHelper"); +const MachineHelper = require("../helpers/MachineHelper"); function cleanUpUrl(url) { if (!url || !url.length) return null; - var cleanedUrl = url; - var hasSlashAtTheEnd = url.substr(url.length - 1, 1) === "/"; + let cleanedUrl = url; + const hasSlashAtTheEnd = url.substr(url.length - 1, 1) === "/"; if (hasSlashAtTheEnd) { // Remove the slash at the end cleanedUrl = url.substr(0, url.length - 1); @@ -14,24 +14,23 @@ function cleanUpUrl(url) { .trim(); } function findDefaultCaptainName() { - var currentSuffix = MachineHelper.machines.length + 1; + let currentSuffix = MachineHelper.machines.length + 1; while (!isSuffixValid(currentSuffix)) { currentSuffix++; } return getCaptainFullName(currentSuffix); } function getCaptainFullName(suffix) { - var formatSuffix = suffix < 10 ? "0" + suffix : suffix; - return "captain-" + formatSuffix; + const formatSuffix = suffix < 10 ? `0${suffix}` : suffix; + return `captain-${formatSuffix}`; } -var isSuffixValid = function (suffixNumber) { - return MachineHelper.machines.map(function (machine) { - machine.name !== getCaptainFullName(suffixNumber); - }); -}; +const isSuffixValid = suffixNumber => MachineHelper.machines.map(machine => { + machine.name !== getCaptainFullName(suffixNumber); +}); module.exports = { - cleanUpUrl: cleanUpUrl, - findDefaultCaptainName: findDefaultCaptainName, - isSuffixValid: isSuffixValid, - getCaptainFullName: getCaptainFullName + cleanUpUrl, + findDefaultCaptainName, + isSuffixValid, + getCaptainFullName }; +//# sourceMappingURL=loginHelpers.js.map \ No newline at end of file diff --git a/app-cli/built/utils/loginHelpers.js.map b/app-cli/built/utils/loginHelpers.js.map new file mode 100644 index 0000000..be815f4 --- /dev/null +++ b/app-cli/built/utils/loginHelpers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"loginHelpers.js","sourceRoot":"","sources":["../../src/utils/loginHelpers.js"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AAEzD,SAAS,UAAU,CAAC,GAAG;IACrB,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM;QAAE,OAAO,IAAI,CAAA;IAEpC,IAAI,UAAU,GAAG,GAAG,CAAA;IACpB,MAAM,gBAAgB,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,CAAA;IAE9D,IAAI,gBAAgB,EAAE;QACpB,8BAA8B;QAC9B,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;KAC3C;IAED,OAAO,UAAU;SACd,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;SACtB,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;SACvB,IAAI,EAAE,CAAA;AACX,CAAC;AAED,SAAS,sBAAsB;IAC7B,IAAI,aAAa,GAAG,aAAa,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAA;IAErD,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE;QACpC,aAAa,EAAE,CAAA;KAChB;IAED,OAAO,kBAAkB,CAAC,aAAa,CAAC,CAAA;AAC1C,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAM;IAChC,MAAM,YAAY,GAAG,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAA;IAExD,OAAO,WAAW,YAAY,EAAE,CAAA;AAClC,CAAC;AAED,MAAM,aAAa,GAAG,YAAY,CAAC,EAAE,CACnC,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;IACnC,OAAO,CAAC,IAAI,KAAK,kBAAkB,CAAC,YAAY,CAAC,CAAA;AACnD,CAAC,CAAC,CAAA;AAEJ,MAAM,CAAC,OAAO,GAAG;IACf,UAAU;IACV,sBAAsB;IACtB,aAAa;IACb,kBAAkB;CACnB,CAAA"} \ No newline at end of file diff --git a/app-cli/built/utils/machineUtils.js b/app-cli/built/utils/machineUtils.js index 5dd4ef8..35f7b28 100755 --- a/app-cli/built/utils/machineUtils.js +++ b/app-cli/built/utils/machineUtils.js @@ -1,7 +1,7 @@ -var DeployApi = require("../api/DeployApi"); -var MachineHelper = require("../helpers/MachineHelper"); +const DeployApi = require("../api/DeployApi"); +const MachineHelper = require("../helpers/MachineHelper"); function initMachineFromLocalStorage() { - var possibleApp = MachineHelper.apps.find(function (app) { return app.cwd === process.cwd(); }); + const possibleApp = MachineHelper.apps.find(app => app.cwd === process.cwd()); if (possibleApp) { DeployApi.setMachineToDeploy(possibleApp.machineToDeploy); DeployApi.setAppName(possibleApp.appName); @@ -10,11 +10,11 @@ function initMachineFromLocalStorage() { } // Saves the app directory into local storage function saveMachineToLocalStorage() { - var apps = MachineHelper.apps; - var currentDirectory = process.cwd(); - var appExists = false; + const apps = MachineHelper.apps; + const currentDirectory = process.cwd(); + let appExists = false; // Update app - var updatedApps = apps.map(function (app) { + const updatedApps = apps.map(app => { if (app.cwd === currentDirectory) { appExists = true; return { @@ -28,7 +28,7 @@ function saveMachineToLocalStorage() { }); MachineHelper.setApps(updatedApps); if (!appExists) { - var newApp = { + const newApp = { cwd: process.cwd(), appName: DeployApi.appName, branchToPush: DeployApi.branchToPush, @@ -39,6 +39,7 @@ function saveMachineToLocalStorage() { } } module.exports = { - initMachineFromLocalStorage: initMachineFromLocalStorage, - saveMachineToLocalStorage: saveMachineToLocalStorage + initMachineFromLocalStorage, + saveMachineToLocalStorage }; +//# sourceMappingURL=machineUtils.js.map \ No newline at end of file diff --git a/app-cli/built/utils/machineUtils.js.map b/app-cli/built/utils/machineUtils.js.map new file mode 100644 index 0000000..57194db --- /dev/null +++ b/app-cli/built/utils/machineUtils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"machineUtils.js","sourceRoot":"","sources":["../../src/utils/machineUtils.js"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AAEzD,SAAS,2BAA2B;IAClC,MAAM,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;IAE7E,IAAI,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end of file diff --git a/app-cli/built/utils/messageHandler.js b/app-cli/built/utils/messageHandler.js index 635ce27..fb5bcac 100755 --- a/app-cli/built/utils/messageHandler.js +++ b/app-cli/built/utils/messageHandler.js @@ -1,4 +1,4 @@ -var chalk = require("chalk"); +const chalk = require("chalk"); function printMessage(message) { console.log(message); } @@ -6,34 +6,32 @@ function printMessageAndExit(message) { console.log(message); process.exit(0); } -function printGreenMessage(message, exit) { - if (exit === void 0) { exit = false; } - console.log("" + chalk.green(message)); +function printGreenMessage(message, exit = false) { + console.log(`${chalk.green(message)}`); exit && process.exit(0); } -function printMagentaMessage(message, exit) { - if (exit === void 0) { exit = false; } - console.log("" + chalk.magenta(message)); +function printMagentaMessage(message, exit = false) { + console.log(`${chalk.magenta(message)}`); exit && process.exit(0); } -function printError(error, exit) { - if (exit === void 0) { exit = false; } - console.log("" + chalk.bold.red(error)); +function printError(error, exit = false) { + console.log(`${chalk.bold.red(error)}`); exit && process.exit(0); } function errorHandler(error) { if (error.status) { - printError("\nError: " + error.status + "\nError: " + error.description, true); + printError(`\nError: ${error.status}\nError: ${error.description}`, true); } else { - printError("\nError: " + error, true); + printError(`\nError: ${error}`, true); } } module.exports = { - printMessage: printMessage, - printMessageAndExit: printMessageAndExit, - printError: printError, - printGreenMessage: printGreenMessage, - printMagentaMessage: printMagentaMessage, - errorHandler: errorHandler + printMessage, + printMessageAndExit, + printError, + printGreenMessage, + printMagentaMessage, + errorHandler }; +//# sourceMappingURL=messageHandler.js.map \ No newline at end of file diff --git a/app-cli/built/utils/messageHandler.js.map b/app-cli/built/utils/messageHandler.js.map new file mode 100644 index 0000000..c9ea4b4 --- /dev/null +++ b/app-cli/built/utils/messageHandler.js.map @@ -0,0 +1 @@ +{"version":3,"file":"messageHandler.js","sourceRoot":"","sources":["../../src/utils/messageHandler.js"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;AAE9B,SAAS,YAAY,CAAC,OAAO;IAC3B,OA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line at end of file diff --git a/app-cli/built/utils/validationsHandler.js b/app-cli/built/utils/validationsHandler.js index 65a5300..4f9ff97 100755 --- a/app-cli/built/utils/validationsHandler.js +++ b/app-cli/built/utils/validationsHandler.js @@ -6,56 +6,29 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var fs = require("fs-extra"); -var DeployApi = require("../api/DeployApi"); -var printError = require("./messageHandler").printError; -var requestLogin = require("../commands/login").requestLogin; -var initMachineFromLocalStorage = require("../utils/machineUtils").initMachineFromLocalStorage; +const fs = require("fs-extra"); +const DeployApi = require("../api/DeployApi"); +const { printError } = require("./messageHandler"); +const { requestLogin } = require("../commands/login"); +const { initMachineFromLocalStorage } = require("../utils/machineUtils"); function validateIsGitRepository() { - var gitFolderExists = fs.pathExistsSync("./.git"); + const gitFolderExists = fs.pathExistsSync("./.git"); if (!gitFolderExists) { printError("\n**** ERROR: You are not in a git root directory. This command will only deploys the current directory ****\n", true); } } function validateDefinitionFile() { - var captainDefinitionExists = fs.pathExistsSync("./captain-definition"); + const captainDefinitionExists = fs.pathExistsSync("./captain-definition"); if (!captainDefinitionExists) { printError("\n**** ERROR: captain-definition file cannot be found. Please see docs! ****\n", true); } - var contents = fs.readFileSync("./captain-definition", "utf8"); - var contentsJson = null; + const contents = fs.readFileSync("./captain-definition", "utf8"); + let contentsJson = null; try { contentsJson = JSON.parse(contents); } catch (e) { - printError("**** ERROR: captain-definition file is not a valid JSON! ****\n Error:" + e, true); + printError(`**** ERROR: captain-definition file is not a valid JSON! ****\n Error:${e}`, true); } if (contentsJson) { if (!contentsJson.schemaVersion) { @@ -84,35 +57,28 @@ function isIpAddress(ipaddress) { return false; } function validateAuthentication() { - return __awaiter(this, void 0, void 0, function () { - var isAuthenticated, loggedInStatus; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, DeployApi.isAuthTokenValid() - // 2. Request login - // 3. Login - // 4. Update token - ]; - case 1: - isAuthenticated = _a.sent(); - if (!!isAuthenticated) return [3 /*break*/, 3]; - return [4 /*yield*/, requestLogin() - // Refresh token in DeployApi - ]; - case 2: - loggedInStatus = _a.sent(); - // Refresh token in DeployApi - initMachineFromLocalStorage(); - return [2 /*return*/, loggedInStatus]; - case 3: return [2 /*return*/, Boolean(isAuthenticated)]; - } - }); + return __awaiter(this, void 0, void 0, function* () { + // 1. Check if valid auth + const isAuthenticated = yield DeployApi.isAuthTokenValid(); + // 2. Request login + // 3. Login + // 4. Update token + if (!isAuthenticated) { + const loggedInStatus = yield requestLogin(); + // Refresh token in DeployApi + initMachineFromLocalStorage(); + return loggedInStatus; + } + else { + return Boolean(isAuthenticated); + } }); } module.exports = { - validateAuthentication: validateAuthentication, - validateIsGitRepository: validateIsGitRepository, - validateDefinitionFile: validateDefinitionFile, - isIpAddress: isIpAddress, - optionIsNotGiven: optionIsNotGiven + validateAuthentication, + validateIsGitRepository, + validateDefinitionFile, + isIpAddress, + optionIsNotGiven }; +//# sourceMappingURL=validationsHandler.js.map \ No newline at end of file diff --git a/app-cli/built/utils/validationsHandler.js.map b/app-cli/built/utils/validationsHandler.js.map new file mode 100644 index 0000000..3921845 --- /dev/null +++ b/app-cli/built/utils/validationsHandler.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validationsHandler.js","sourceRoot":"","sources":["../../src/utils/validationsHandler.js"],"names":[],"mappings":";;;;;;;;AAAA,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAC9B,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAC7C,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAClD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;AACrD,MAAM,EAAE,2BAA2B,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AAExE,SAAS,uBAAuB;IAC9B,MAAM,eAAe,GAAG,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAA;IAEnD,IAAI,CAAC,eAAe,EAAE;QACpB,UAAU,CACR,gHAAgH,EAChH,IAAI,CACL,CAAA;KACF;AACH,CAAC;AAED,SAAS,sBAAsB;IAC7B,MAAM,uBAAuB,GAAG,EAAE,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAA;IAEzE,IAAI,CAAC,uBAAuB,EAAE;QAC5B,UAAU,CACR,gFAAgF,EAChF,IAAI,CACL,CAAA;KACF;IA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AAE,CAAA;YAE7B,OAAO,cAAc,CAAA;SACtB;aAAM;YACL,OAAO,OAAO,CAAC,eAAe,CAAC,CAAA;SAChC;IACH,CAAC;CAAA;AAED,MAAM,CAAC,OAAO,GAAG;IACf,sBAAsB;IACtB,uBAAuB;IACvB,sBAAsB;IACtB,WAAW;IACX,gBAAgB;CACjB,CAAA"} \ No newline at end of file diff --git a/app-cli/package-lock.json b/app-cli/package-lock.json index 19b795c..79f5329 100644 --- a/app-cli/package-lock.json +++ b/app-cli/package-lock.json @@ -1985,12 +1985,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2005,17 +2007,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -2132,7 +2137,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -2144,6 +2150,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2158,6 +2165,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -2165,12 +2173,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -2189,6 +2199,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -2269,7 +2280,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -2281,6 +2293,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -2402,6 +2415,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", diff --git a/app-cli/package.json b/app-cli/package.json index 2f57af3..8b9d394 100644 --- a/app-cli/package.json +++ b/app-cli/package.json @@ -61,4 +61,4 @@ "jest": "^23.6.0", "prettier": "^1.15.3" } -} \ No newline at end of file +} diff --git a/app-cli/tsconfig.json b/app-cli/tsconfig.json index b505bc0..d6a2727 100644 --- a/app-cli/tsconfig.json +++ b/app-cli/tsconfig.json @@ -1,11 +1,15 @@ { "compilerOptions": { + "module": "commonjs", + "moduleResolution": "node", + "strictNullChecks": true, "outDir": "./built", + "noImplicitAny": true, + "sourceMap": true, "allowJs": true, - "target": "es5", - "noImplicitReturns": false + "target": "es6" }, "include": [ "./src/**/*" ] -} \ No newline at end of file +} diff --git a/app-cli/tslint.json b/app-cli/tslint.json new file mode 100644 index 0000000..8ca15bd --- /dev/null +++ b/app-cli/tslint.json @@ -0,0 +1,60 @@ +{ + "rules": { + "class-name": true, + "comment-format": [ + true, + "check-space" + ], + "indent": [ + true, + "spaces" + ], + "one-line": [ + true, + "check-open-brace", + "check-whitespace" + ], + "no-var-keyword": true, + "quotemark": [ + true, + "single", + "avoid-escape" + ], + "semicolon": [ + true, + "never", + "ignore-bound-class-methods" + ], + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-module", + "check-separator", + "check-type" + ], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + }, + { + "call-signature": "onespace", + "index-signature": "onespace", + "parameter": "onespace", + "property-declaration": "onespace", + "variable-declaration": "onespace" + } + ], + "no-internal-module": true, + "no-trailing-whitespace": true, + "no-null-keyword": true, + //"prefer-const": true, + "jsdoc-format": true + } +} \ No newline at end of file From 2fc636c83bae50197c05c23e576bc143a82e84d0 Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Wed, 2 Jan 2019 23:55:24 -0800 Subject: [PATCH 27/44] two files converted --- app-cli/built/utils/constants.js | 1 + app-cli/built/utils/constants.js.map | 2 +- app-cli/built/utils/fileHelper.js | 36 ++-- app-cli/built/utils/fileHelper.js.map | 2 +- app-cli/package-lock.json | 39 ++-- app-cli/package.json | 1 + .../src/utils/{constants.js => constants.ts} | 2 +- app-cli/src/utils/fileHelper.js | 177 ------------------ app-cli/src/utils/fileHelper.ts | 170 +++++++++++++++++ 9 files changed, 210 insertions(+), 220 deletions(-) rename app-cli/src/utils/{constants.js => constants.ts} (94%) delete mode 100644 app-cli/src/utils/fileHelper.js create mode 100644 app-cli/src/utils/fileHelper.ts diff --git a/app-cli/built/utils/constants.js b/app-cli/built/utils/constants.js index 9d28cea..d18cc08 100755 --- a/app-cli/built/utils/constants.js +++ b/app-cli/built/utils/constants.js @@ -1,3 +1,4 @@ +"use strict"; const SAMPLE_DOMAIN = "captain.captainroot.yourdomain.com"; const SAMPLE_IP = "123.123.123.123"; const DEFAULT_PASSWORD = "captain42"; diff --git a/app-cli/built/utils/constants.js.map b/app-cli/built/utils/constants.js.map index 238f108..ea59067 100644 --- a/app-cli/built/utils/constants.js.map +++ b/app-cli/built/utils/constants.js.map @@ -1 +1 @@ -{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.js"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAAG,oCAAoC,CAAA;AAC1D,MAAM,SAAS,GAAG,iBAAiB,CAAA;AACnC,MAAM,gBAAgB,GAAG,WAAW,CAAA;AACpC,MAAM,sBAAsB,GAAG,cAAc,CAAA;AAC7C,MAAM,gBAAgB,GAAG,SAAS,CAAA;AAClC,MAAM,YAAY,GAAG,EAAE,CAAA;AAEvB,MAAM,CAAC,OAAO,GAAG;IACf,aAAa;IACb,SAAS;IACT,gBAAgB;IAChB,sBAAsB;IACtB,gBAAgB;IAChB,YAAY;CACb,CAAA"} \ No newline at end of file +{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":";AAAA,MAAM,aAAa,GAAG,oCAAoC,CAAA;AAC1D,MAAM,SAAS,GAAG,iBAAiB,CAAA;AACnC,MAAM,gBAAgB,GAAG,WAAW,CAAA;AACpC,MAAM,sBAAsB,GAAG,cAAc,CAAA;AAC7C,MAAM,gBAAgB,GAAG,SAAS,CAAA;AAClC,MAAM,YAAY,GAAG,EAAE,CAAA;AAEvB,iBAAS;IACP,aAAa;IACb,SAAS;IACT,gBAAgB;IAChB,sBAAsB;IACtB,gBAAgB;IAChB,YAAY;CACb,CAAA"} \ No newline at end of file diff --git a/app-cli/built/utils/fileHelper.js b/app-cli/built/utils/fileHelper.js index 39d77d0..dce7778 100755 --- a/app-cli/built/utils/fileHelper.js +++ b/app-cli/built/utils/fileHelper.js @@ -1,3 +1,4 @@ +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } @@ -6,23 +7,24 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; +Object.defineProperty(exports, "__esModule", { value: true }); +const { printMessage, printError, printGreenMessage, printMagentaMessage } = require('./messageHandler'); +const SpinnerHelper = require('../helpers/SpinnerHelper'); +const child_process_1 = require("child_process"); const fs = require("fs-extra"); -const { printMessage, printError, printGreenMessage, printMagentaMessage } = require("./messageHandler"); -const SpinnerHelper = require("../helpers/SpinnerHelper"); -const { exec } = require("child_process"); -const ProgressBar = require("progress"); -const DeployApi = require("../api/DeployApi"); -const { saveMachineToLocalStorage } = require("../utils/machineUtils"); +const ProgressBar = require('progress'); +const DeployApi = require('../api/DeployApi'); +const { saveMachineToLocalStorage } = require('../utils/machineUtils'); let lastLineNumberPrinted = -10000; // we want to show all lines to begin with! function gitArchiveFile(zipFileFullPath, branchToPush) { - exec(`git archive --format tar --output "${zipFileFullPath}" ${branchToPush}`, (err, stdout, stderr) => { + child_process_1.exec(`git archive --format tar --output "${zipFileFullPath}" ${branchToPush}`, (err, stdout, stderr) => { if (err) { printError(`TAR file failed\n${err}\n`); fs.removeSync(zipFileFullPath); return; } - exec(`git rev-parse ${branchToPush}`, (err, stdout, stderr) => { - const gitHash = (stdout || "").trim(); + child_process_1.exec(`git rev-parse ${branchToPush}`, (err, stdout, stderr) => { + const gitHash = (stdout || '').trim(); if (err || !/^[a-f0-9]{40}$/.test(gitHash)) { printError(`Cannot find hash of last commit on this branch: ${branchToPush}\n${gitHash}\n${err}\n`); return; @@ -43,7 +45,7 @@ function onLogRetrieved(data) { firstLinesToPrint = -firstLineNumberOfLogs; } else { - printMessage("[[ TRUNCATED ]]"); + printMessage('[[ TRUNCATED ]]'); } } else { @@ -51,7 +53,7 @@ function onLogRetrieved(data) { } lastLineNumberPrinted = firstLineNumberOfLogs + lines.length; for (let i = firstLinesToPrint; i < lines.length; i++) { - printMessage((lines[i] || "").trim()); + printMessage((lines[i] || '').trim()); } } const finishedBuilding = data && !data.isAppBuilding; @@ -92,14 +94,14 @@ function getFileStream(zipFileFullPath) { total: fileSize, clear: true }; - const bar = new ProgressBar(" uploading [:bar] :percent (ETA :etas)", barOpts); - fileStream.on("data", chunk => { + const bar = new ProgressBar(' uploading [:bar] :percent (ETA :etas)', barOpts); + fileStream.on('data', (chunk) => { bar.tick(chunk.length); }); - fileStream.on("end", () => { - printMessage("This might take several minutes. PLEASE BE PATIENT..."); - SpinnerHelper.start("Building your source code..."); - SpinnerHelper.setColor("yellow"); + fileStream.on('end', () => { + printMessage('This might take several minutes. PLEASE BE PATIENT...'); + SpinnerHelper.start('Building your source code...'); + SpinnerHelper.setColor('yellow'); }); return fileStream; } diff --git a/app-cli/built/utils/fileHelper.js.map b/app-cli/built/utils/fileHelper.js.map index 1f77d4c..44dc849 100644 --- a/app-cli/built/utils/fileHelper.js.map +++ b/app-cli/built/utils/fileHelper.js.map @@ -1 +1 @@ -{"version":3,"file":"fileHelper.js","sourceRoot":"","sources":["../../src/utils/fileHelper.js"],"names":[],"mappings":";;;;;;;;AAAA,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAC9B,MAAM,EACJ,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACpB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAC/B,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACzD,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;AACzC,MAAM,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AACvC,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAC7C,MAAM,EAAE,yBAAyB,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AACtE,IAAI,qBAAqB,GAAG,CAAC,KAAK,CAAA,CAAC,2CAA2C;AAE9E,SAAS,cAAc,CAAC,eAAe,EAAE,YAAY;IACnD,IAAI,CACF,sCAAsC,eAAe,KAAK,YAAY,EAAE,EACxE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;QACtB,IAAI,GAAG,EAAE;YACP,UAAU,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAA;YAEvC,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,CAAA;YAE9B,OAAM;SACP;QAED,IAAI,CAAC,iBAAiB,YAAY,EAAE,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;YAC5D,MAAM,OAAO,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;YAErC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AAC,CAAC;aAC/C;YAED,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB;YAE/C,4BAA4B;YAC5B,yBAAyB,EAAE,CAAC;YAE5B,IAAI,qBAAqB,EAAE;gBAC1B,sBAAsB,EAAE,CAAC;aACzB;YAED,IAAI,sBAAsB,EAAE;gBAC3B,iBAAiB,CAAC,0BAA0B,SAAS,CAAC,OAAO,IAAI,EAAE,IAAI,CAAC,CAAC;aACzE;SACD;QAAC,OAAO,CAAC,EAAE;YACX,UAAU,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;SAC5B;IACF,CAAC;CAAA;AAED,SAAS,kBAAkB,CAAC,QAAgB;IAC3C,IAAI,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;QAChC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;KACxB;AACF,CAAC;AAED,MAAM,CAAC,OAAO,GAAG;IAChB,cAAc;IACd,aAAa;IACb,UAAU;IACV,sBAAsB;CACtB,CAAC"} \ No newline at end of file diff --git a/app-cli/package-lock.json b/app-cli/package-lock.json index 79f5329..7c8b032 100644 --- a/app-cli/package-lock.json +++ b/app-cli/package-lock.json @@ -24,11 +24,18 @@ "js-tokens": "^4.0.0" } }, + "@types/fs-extra": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-5.0.4.tgz", + "integrity": "sha512-DsknoBvD8s+RFfSGjmERJ7ZOP1HI0UZRA3FSI+Zakhrc/Gy26YQsLI+m5V5DHxroHRJqCDLKJp7Hixn8zyaF7g==", + "requires": { + "@types/node": "*" + } + }, "@types/node": { "version": "10.12.18", "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz", - "integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==", - "dev": true + "integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==" }, "abab": { "version": "2.0.0", @@ -1985,14 +1992,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2007,20 +2012,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -2137,8 +2139,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -2150,7 +2151,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2165,7 +2165,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -2173,14 +2172,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -2199,7 +2196,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -2280,8 +2276,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -2293,7 +2288,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -2415,7 +2409,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", diff --git a/app-cli/package.json b/app-cli/package.json index 8b9d394..5d9208e 100644 --- a/app-cli/package.json +++ b/app-cli/package.json @@ -41,6 +41,7 @@ ] }, "dependencies": { + "@types/fs-extra": "^5.0.4", "chalk": "^2.4.1", "command-exists": "^1.2.8", "commander": "^2.19.0", diff --git a/app-cli/src/utils/constants.js b/app-cli/src/utils/constants.ts similarity index 94% rename from app-cli/src/utils/constants.js rename to app-cli/src/utils/constants.ts index c0b944b..aa8b7e2 100644 --- a/app-cli/src/utils/constants.js +++ b/app-cli/src/utils/constants.ts @@ -5,7 +5,7 @@ const DEFAULT_BRANCH_TO_PUSH = "branchToPush" const DEFAULT_APP_NAME = "appName" const EMPTY_STRING = "" -module.exports = { +export = { SAMPLE_DOMAIN, SAMPLE_IP, DEFAULT_PASSWORD, diff --git a/app-cli/src/utils/fileHelper.js b/app-cli/src/utils/fileHelper.js deleted file mode 100644 index 497888c..0000000 --- a/app-cli/src/utils/fileHelper.js +++ /dev/null @@ -1,177 +0,0 @@ -const fs = require("fs-extra") -const { - printMessage, - printError, - printGreenMessage, - printMagentaMessage -} = require("./messageHandler") -const SpinnerHelper = require("../helpers/SpinnerHelper") -const { exec } = require("child_process") -const ProgressBar = require("progress") -const DeployApi = require("../api/DeployApi") -const { saveMachineToLocalStorage } = require("../utils/machineUtils") -let lastLineNumberPrinted = -10000 // we want to show all lines to begin with! - -function gitArchiveFile(zipFileFullPath, branchToPush) { - exec( - `git archive --format tar --output "${zipFileFullPath}" ${branchToPush}`, - (err, stdout, stderr) => { - if (err) { - printError(`TAR file failed\n${err}\n`) - - fs.removeSync(zipFileFullPath) - - return - } - - exec(`git rev-parse ${branchToPush}`, (err, stdout, stderr) => { - const gitHash = (stdout || "").trim() - - if (err || !/^[a-f0-9]{40}$/.test(gitHash)) { - printError( - `Cannot find hash of last commit on this branch: ${branchToPush}\n${gitHash}\n${err}\n` - ) - - return - } - - printMessage(`Pushing last commit on ${branchToPush}: ${gitHash}`) - - uploadFile(zipFileFullPath, gitHash) - }) - } - ) -} - -function onLogRetrieved(data) { - if (data) { - const lines = data.logs.lines - const firstLineNumberOfLogs = data.logs.firstLineNumber - let firstLinesToPrint = 0 - - if (firstLineNumberOfLogs > lastLineNumberPrinted) { - if (firstLineNumberOfLogs < 0) { - // This is the very first fetch, probably firstLineNumberOfLogs is around -50 - firstLinesToPrint = -firstLineNumberOfLogs - } else { - printMessage("[[ TRUNCATED ]]") - } - } else { - firstLinesToPrint = lastLineNumberPrinted - firstLineNumberOfLogs - } - - lastLineNumberPrinted = firstLineNumberOfLogs + lines.length - - for (let i = firstLinesToPrint; i < lines.length; i++) { - printMessage((lines[i] || "").trim()) - } - } - - const finishedBuilding = data && !data.isAppBuilding - - if (finishedBuilding) { - if (!data.isBuildFailed) { - printGreenMessage(`Deployed successfully: ${DeployApi.appName}`) - - printMagentaMessage(`App is available at ${DeployApi.appUrl}\n`, true) - } else { - printError( - `\nSomething bad happened. Cannot deploy "${DeployApi.appName}"\n`, - true - ) - } - } - - setTimeout(() => { - startFetchingBuildLogs() - }, 2000) -} - -async function startFetchingBuildLogs() { - try { - const data = await DeployApi.fetchBuildLogs() - const response = JSON.parse(data) - - if (response.status !== 100) { - throw new Error(JSON.stringify(response, null, 2)) - } - onLogRetrieved(response.data) - } catch (error) { - printError(`\nSomething while retrieving app build logs.. ${error}\n`) - - // onLogRetrieved() // TODO - should this be here? - } -} - -function getFileStream(zipFileFullPath) { - const fileSize = fs.statSync(zipFileFullPath).size - const fileStream = fs.createReadStream(zipFileFullPath) - const barOpts = { - width: 20, - total: fileSize, - clear: true - } - const bar = new ProgressBar( - " uploading [:bar] :percent (ETA :etas)", - barOpts - ) - - fileStream.on("data", chunk => { - bar.tick(chunk.length) - }) - - fileStream.on("end", () => { - printMessage("This might take several minutes. PLEASE BE PATIENT...") - - SpinnerHelper.start("Building your source code...") - - SpinnerHelper.setColor("yellow") - }) - - return fileStream -} - -async function uploadFile(filePath, gitHash) { - try { - printMessage(`Uploading file to ${DeployApi.machineToDeploy.baseUrl}`) - - const fileStream = getFileStream(filePath) - const response = await DeployApi.sendFile(fileStream, gitHash) - const data = JSON.parse(response) - const somethingWentWrong = data.status !== 100 && data.status !== 101 - const isDeployedAndBuilding = data.status === 101 - const isDeployedSuccessfully = data.status === 100 - - if (somethingWentWrong) { - throw new Error(JSON.stringify(data, null, 2)) - } - - deleteFileFromDisk(filePath) // Uncomment this - - // Save app to local storage - saveMachineToLocalStorage() - - if (isDeployedAndBuilding) { - startFetchingBuildLogs() - } - - if (isDeployedSuccessfully) { - printGreenMessage(`Deployed successfully: ${DeployApi.appName}\n`, true) - } - } catch (e) { - printError(e.message, true) - } -} - -function deleteFileFromDisk(filePath) { - if (fs.pathExistsSync(filePath)) { - fs.removeSync(filePath) - } -} - -module.exports = { - gitArchiveFile, - getFileStream, - uploadFile, - startFetchingBuildLogs -} diff --git a/app-cli/src/utils/fileHelper.ts b/app-cli/src/utils/fileHelper.ts new file mode 100644 index 0000000..344e4cf --- /dev/null +++ b/app-cli/src/utils/fileHelper.ts @@ -0,0 +1,170 @@ +const { printMessage, printError, printGreenMessage, printMagentaMessage } = require('./messageHandler'); +const SpinnerHelper = require('../helpers/SpinnerHelper'); +import { exec } from 'child_process'; +import * as fs from 'fs-extra'; +const ProgressBar = require('progress'); +const DeployApi = require('../api/DeployApi'); +const { saveMachineToLocalStorage } = require('../utils/machineUtils'); +let lastLineNumberPrinted = -10000; // we want to show all lines to begin with! + +interface ILogInfo { + isAppBuilding: boolean; + isBuildFailed: boolean; + logs: { + firstLineNumber: number; + lines: string[]; + }; +} + +function gitArchiveFile(zipFileFullPath: string, branchToPush: string) { + exec(`git archive --format tar --output "${zipFileFullPath}" ${branchToPush}`, (err, stdout, stderr) => { + if (err) { + printError(`TAR file failed\n${err}\n`); + + fs.removeSync(zipFileFullPath); + + return; + } + + exec(`git rev-parse ${branchToPush}`, (err, stdout, stderr) => { + const gitHash = (stdout || '').trim(); + + if (err || !/^[a-f0-9]{40}$/.test(gitHash)) { + printError(`Cannot find hash of last commit on this branch: ${branchToPush}\n${gitHash}\n${err}\n`); + + return; + } + + printMessage(`Pushing last commit on ${branchToPush}: ${gitHash}`); + + uploadFile(zipFileFullPath, gitHash); + }); + }); +} + +function onLogRetrieved(data: ILogInfo) { + if (data) { + const lines = data.logs.lines; + const firstLineNumberOfLogs = data.logs.firstLineNumber; + let firstLinesToPrint = 0; + + if (firstLineNumberOfLogs > lastLineNumberPrinted) { + if (firstLineNumberOfLogs < 0) { + // This is the very first fetch, probably firstLineNumberOfLogs is around -50 + firstLinesToPrint = -firstLineNumberOfLogs; + } else { + printMessage('[[ TRUNCATED ]]'); + } + } else { + firstLinesToPrint = lastLineNumberPrinted - firstLineNumberOfLogs; + } + + lastLineNumberPrinted = firstLineNumberOfLogs + lines.length; + + for (let i = firstLinesToPrint; i < lines.length; i++) { + printMessage((lines[i] || '').trim()); + } + } + + const finishedBuilding = data && !data.isAppBuilding; + + if (finishedBuilding) { + if (!data.isBuildFailed) { + printGreenMessage(`Deployed successfully: ${DeployApi.appName}`); + + printMagentaMessage(`App is available at ${DeployApi.appUrl}\n`, true); + } else { + printError(`\nSomething bad happened. Cannot deploy "${DeployApi.appName}"\n`, true); + } + } + + setTimeout(() => { + startFetchingBuildLogs(); + }, 2000); +} + +async function startFetchingBuildLogs() { + try { + const data = await DeployApi.fetchBuildLogs(); + const response = JSON.parse(data); + + if (response.status !== 100) { + throw new Error(JSON.stringify(response, null, 2)); + } + onLogRetrieved(response.data); + } catch (error) { + printError(`\nSomething while retrieving app build logs.. ${error}\n`); + + // onLogRetrieved() // TODO - should this be here? + } +} + +function getFileStream(zipFileFullPath: string) { + const fileSize = fs.statSync(zipFileFullPath).size; + const fileStream = fs.createReadStream(zipFileFullPath); + const barOpts = { + width: 20, + total: fileSize, + clear: true + }; + const bar = new ProgressBar(' uploading [:bar] :percent (ETA :etas)', barOpts); + + fileStream.on('data', (chunk) => { + bar.tick(chunk.length); + }); + + fileStream.on('end', () => { + printMessage('This might take several minutes. PLEASE BE PATIENT...'); + + SpinnerHelper.start('Building your source code...'); + + SpinnerHelper.setColor('yellow'); + }); + + return fileStream; +} + +async function uploadFile(filePath: string, gitHash: string) { + try { + printMessage(`Uploading file to ${DeployApi.machineToDeploy.baseUrl}`); + + const fileStream = getFileStream(filePath); + const response = await DeployApi.sendFile(fileStream, gitHash); + const data = JSON.parse(response); + const somethingWentWrong = data.status !== 100 && data.status !== 101; + const isDeployedAndBuilding = data.status === 101; + const isDeployedSuccessfully = data.status === 100; + + if (somethingWentWrong) { + throw new Error(JSON.stringify(data, null, 2)); + } + + deleteFileFromDisk(filePath); // Uncomment this + + // Save app to local storage + saveMachineToLocalStorage(); + + if (isDeployedAndBuilding) { + startFetchingBuildLogs(); + } + + if (isDeployedSuccessfully) { + printGreenMessage(`Deployed successfully: ${DeployApi.appName}\n`, true); + } + } catch (e) { + printError(e.message, true); + } +} + +function deleteFileFromDisk(filePath: string) { + if (fs.pathExistsSync(filePath)) { + fs.removeSync(filePath); + } +} + +module.exports = { + gitArchiveFile, + getFileStream, + uploadFile, + startFetchingBuildLogs +}; From 5ee897c3e7c042c3d27312d2e34d959cd96e82e3 Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Thu, 3 Jan 2019 00:08:03 -0800 Subject: [PATCH 28/44] converted utils to tsc --- app-cli/built/models/IModels.js | 3 + app-cli/built/models/IModels.js.map | 1 + app-cli/built/utils/loginHelpers.js | 13 +- app-cli/built/utils/loginHelpers.js.map | 2 +- app-cli/built/utils/machineUtils.js | 10 +- app-cli/built/utils/machineUtils.js.map | 2 +- app-cli/built/utils/messageHandler.js | 3 +- app-cli/built/utils/messageHandler.js.map | 2 +- app-cli/built/utils/validationsHandler.js | 26 ++-- app-cli/built/utils/validationsHandler.js.map | 2 +- app-cli/src/models/IModels.ts | 10 ++ app-cli/src/utils/loginHelpers.js | 46 -------- app-cli/src/utils/loginHelpers.ts | 45 +++++++ app-cli/src/utils/machineUtils.js | 56 --------- app-cli/src/utils/machineUtils.ts | 58 +++++++++ app-cli/src/utils/messageHandler.js | 46 -------- app-cli/src/utils/messageHandler.ts | 46 ++++++++ app-cli/src/utils/validationsHandler.js | 111 ------------------ app-cli/src/utils/validationsHandler.ts | 102 ++++++++++++++++ 19 files changed, 296 insertions(+), 288 deletions(-) create mode 100644 app-cli/built/models/IModels.js create mode 100644 app-cli/built/models/IModels.js.map create mode 100644 app-cli/src/models/IModels.ts delete mode 100644 app-cli/src/utils/loginHelpers.js create mode 100644 app-cli/src/utils/loginHelpers.ts delete mode 100644 app-cli/src/utils/machineUtils.js create mode 100644 app-cli/src/utils/machineUtils.ts delete mode 100644 app-cli/src/utils/messageHandler.js create mode 100644 app-cli/src/utils/messageHandler.ts delete mode 100644 app-cli/src/utils/validationsHandler.js create mode 100644 app-cli/src/utils/validationsHandler.ts diff --git a/app-cli/built/models/IModels.js b/app-cli/built/models/IModels.js new file mode 100644 index 0000000..8f4cd75 --- /dev/null +++ b/app-cli/built/models/IModels.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=IModels.js.map \ No newline at end of file diff --git a/app-cli/built/models/IModels.js.map b/app-cli/built/models/IModels.js.map new file mode 100644 index 0000000..1821df8 --- /dev/null +++ b/app-cli/built/models/IModels.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IModels.js","sourceRoot":"","sources":["../../src/models/IModels.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/app-cli/built/utils/loginHelpers.js b/app-cli/built/utils/loginHelpers.js index ada451e..543693a 100755 --- a/app-cli/built/utils/loginHelpers.js +++ b/app-cli/built/utils/loginHelpers.js @@ -1,17 +1,16 @@ -const MachineHelper = require("../helpers/MachineHelper"); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const MachineHelper = require('../helpers/MachineHelper'); function cleanUpUrl(url) { if (!url || !url.length) return null; let cleanedUrl = url; - const hasSlashAtTheEnd = url.substr(url.length - 1, 1) === "/"; + const hasSlashAtTheEnd = url.substr(url.length - 1, 1) === '/'; if (hasSlashAtTheEnd) { // Remove the slash at the end cleanedUrl = url.substr(0, url.length - 1); } - return cleanedUrl - .replace("http://", "") - .replace("https://", "") - .trim(); + return cleanedUrl.replace('http://', '').replace('https://', '').trim(); } function findDefaultCaptainName() { let currentSuffix = MachineHelper.machines.length + 1; @@ -24,7 +23,7 @@ function getCaptainFullName(suffix) { const formatSuffix = suffix < 10 ? `0${suffix}` : suffix; return `captain-${formatSuffix}`; } -const isSuffixValid = suffixNumber => MachineHelper.machines.map(machine => { +const isSuffixValid = (suffixNumber) => MachineHelper.machines.map((machine) => { machine.name !== getCaptainFullName(suffixNumber); }); module.exports = { diff --git a/app-cli/built/utils/loginHelpers.js.map b/app-cli/built/utils/loginHelpers.js.map index be815f4..11494f8 100644 --- a/app-cli/built/utils/loginHelpers.js.map +++ b/app-cli/built/utils/loginHelpers.js.map @@ -1 +1 @@ -{"version":3,"file":"loginHelpers.js","sourceRoot":"","sources":["../../src/utils/loginHelpers.js"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AAEzD,SAAS,UAAU,CAAC,GAAG;IACrB,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM;QAAE,OAAO,IAAI,CAAA;IAEpC,IAAI,UAAU,GAAG,GAAG,CAAA;IACpB,MAAM,gBAAgB,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,CAAA;IAE9D,IAAI,gBAAgB,EAAE;QACpB,8BAA8B;QAC9B,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;KAC3C;IAED,OAAO,UAAU;SACd,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;SACtB,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;SACvB,IAAI,EAAE,CAAA;AACX,CAAC;AAED,SAAS,sBAAsB;IAC7B,IAAI,aAAa,GAAG,aAAa,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAA;IAErD,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE;QACpC,aAAa,EAAE,CAAA;KAChB;IAED,OAAO,kBAAkB,CAAC,aAAa,CAAC,CAAA;AAC1C,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAM;IAChC,MAAM,YAAY,GAAG,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAA;IAExD,OAAO,WAAW,YAAY,EAAE,CAAA;AAClC,CAAC;AAED,MAAM,aAAa,GAAG,YAAY,CAAC,EAAE,CACnC,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;IACnC,OAAO,CAAC,IAAI,KAAK,kBAAkB,CAAC,YAAY,CAAC,CAAA;AACnD,CAAC,CAAC,CAAA;AAEJ,MAAM,CAAC,OAAO,GAAG;IACf,UAAU;IACV,sBAAsB;IACtB,aAAa;IACb,kBAAkB;CACnB,CAAA"} \ No newline at end of file +{"version":3,"file":"loginHelpers.js","sourceRoot":"","sources":["../../src/utils/loginHelpers.ts"],"names":[],"mappings":";;AAEA,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAE1D,SAAS,UAAU,CAAC,GAAW;IAC9B,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAErC,IAAI,UAAU,GAAG,GAAG,CAAC;IACrB,MAAM,gBAAgB,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC;IAE/D,IAAI,gBAAgB,EAAE;QACrB,8BAA8B;QAC9B,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;KAC3C;IAED,OAAO,UAAU,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AACzE,CAAC;AAED,SAAS,sBAAsB;IAC9B,IAAI,aAAa,GAAG,aAAa,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IAEtD,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE;QACrC,aAAa,EAAE,CAAC;KAChB;IAED,OAAO,kBAAkB,CAAC,aAAa,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAc;IACzC,MAAM,YAAY,GAAG,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;IAEzD,OAAO,WAAW,YAAY,EAAE,CAAC;AAClC,CAAC;AAED,MAAM,aAAa,GAAG,CAAC,YAAoB,EAAE,EAAE,CAC9C,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAiB,EAAE,EAAE;IAChD,OAAO,CAAC,IAAI,KAAK,kBAAkB,CAAC,YAAY,CAAC,CAAC;AACnD,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,OAAO,GAAG;IAChB,UAAU;IACV,sBAAsB;IACtB,aAAa;IACb,kBAAkB;CAClB,CAAC"} \ No newline at end of file diff --git a/app-cli/built/utils/machineUtils.js b/app-cli/built/utils/machineUtils.js index 35f7b28..505bfcf 100755 --- a/app-cli/built/utils/machineUtils.js +++ b/app-cli/built/utils/machineUtils.js @@ -1,7 +1,9 @@ -const DeployApi = require("../api/DeployApi"); -const MachineHelper = require("../helpers/MachineHelper"); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const DeployApi = require('../api/DeployApi'); +const MachineHelper = require('../helpers/MachineHelper'); function initMachineFromLocalStorage() { - const possibleApp = MachineHelper.apps.find(app => app.cwd === process.cwd()); + const possibleApp = MachineHelper.apps.find((app) => app.cwd === process.cwd()); if (possibleApp) { DeployApi.setMachineToDeploy(possibleApp.machineToDeploy); DeployApi.setAppName(possibleApp.appName); @@ -14,7 +16,7 @@ function saveMachineToLocalStorage() { const currentDirectory = process.cwd(); let appExists = false; // Update app - const updatedApps = apps.map(app => { + const updatedApps = apps.map((app) => { if (app.cwd === currentDirectory) { appExists = true; return { diff --git a/app-cli/built/utils/machineUtils.js.map b/app-cli/built/utils/machineUtils.js.map index 57194db..03de31e 100644 --- a/app-cli/built/utils/machineUtils.js.map +++ b/app-cli/built/utils/machineUtils.js.map @@ -1 +1 @@ -{"version":3,"file":"machineUtils.js","sourceRoot":"","sources":["../../src/utils/machineUtils.js"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AAEzD,SAAS,2BAA2B;IAClC,MAAM,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;IAE7E,IAAI,WAAW,EAAE;QACf,SAAS,CAAC,kBAAkB,CAAC,WAAW,CAAC,eAAe,CAAC,CAAA;QAEzD,SAAS,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;QAEzC,SAAS,CAAC,eAAe,CAAC,WAAW,CAAC,YAAY,CAAC,CAAA;KACpD;AACH,CAAC;AAED,6CAA6C;AAC7C,SAAS,yBAAyB;IAChC,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAA;IAC/B,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;IACtC,IAAI,SAAS,GAAG,KAAK,CAAA;IACrB,aAAa;IACb,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QACjC,IAAI,GAAG,CAAC,GAAG,KAAK,gBAAgB,EAAE;YAChC,SAAS,GAAG,IAAI,CAAA;YAEhB,OAAO;gBACL,GAAG,EAAE,GAAG,CAAC,GAAG;gBACZ,OAAO,EAAE,SAAS,CAAC,OAAO;gBAC1B,YAAY,EAAE,SAAS,CAAC,YAAY;gBACpC,eAAe,EAAE,SAAS,CAAC,eAAe;aAC3C,CAAA;SACF;QAED,OAAO,GAAG,CAAA;IACZ,CAAC,CAAC,CAAA;IAEF,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;IAElC,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,MAAM,GAAG;YACb,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;YAClB,OAAO,EAAE,SAAS,CAAC,OAAO;YAC1B,YAAY,EAAE,SAAS,CAAC,YAAY;YACpC,eAAe,EAAE,SAAS,CAAC,eAAe;SAC3C,CAAA;QAED,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAExB,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;KAC5B;AACH,CAAC;AAED,MAAM,CAAC,OAAO,GAAG;IACf,2BAA2B;IAC3B,yBAAyB;CAC1B,CAAA"} \ No newline at end of file +{"version":3,"file":"machineUtils.js","sourceRoot":"","sources":["../../src/utils/machineUtils.ts"],"names":[],"mappings":";;AAEA,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC9C,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAE1D,SAAS,2BAA2B;IACnC,MAAM,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAS,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAEtF,IAAI,WAAW,EAAE;QAChB,SAAS,CAAC,kBAAkB,CAAC,W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-cli/built/utils/messageHandler.js index fb5bcac..22c9094 100755 --- a/app-cli/built/utils/messageHandler.js +++ b/app-cli/built/utils/messageHandler.js @@ -1,4 +1,5 @@ -const chalk = require("chalk"); +"use strict"; +const chalk = require('chalk'); function printMessage(message) { console.log(message); } diff --git a/app-cli/built/utils/messageHandler.js.map b/app-cli/built/utils/messageHandler.js.map index c9ea4b4..ce6d4d9 100644 --- a/app-cli/built/utils/messageHandler.js.map +++ b/app-cli/built/utils/messageHandler.js.map @@ -1 +1 @@ -{"version":3,"file":"messageHandler.js","sourceRoot":"","sources":["../../src/utils/messageHandler.js"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;AAE9B,SAAS,YAAY,CAAC,OAAO;IAC3B,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;AACtB,CAAC;AAED,SAAS,mBAAmB,CAAC,OAAO;IAClC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IAEpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAO,EAAE,IAAI,GAAG,KAAK;IAC9C,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IAEtC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACzB,CAAC;AAED,SAAS,mBAAmB,CAAC,OAAO,EAAE,IAAI,GAAG,KAAK;IAChD,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IAExC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACzB,CAAC;AAED,SAAS,UAAU,CAAC,KAAK,EAAE,IAAI,GAAG,KAAK;IACrC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IAEvC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACzB,CAAC;AAED,SAAS,YAAY,CAAC,KAAK;IACzB,IAAI,KAAK,CAAC,MAAM,EAAE;QAChB,UAAU,CAAC,YAAY,KAAK,CAAC,MAAM,YAAY,KAAK,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,CAAA;KAC1E;SAAM;QACL,UAAU,CAAC,YAAY,KAAK,EAAE,EAAE,IAAI,CAAC,CAAA;KACtC;AACH,CAAC;AAED,MAAM,CAAC,OAAO,GAAG;IACf,YAAY;IACZ,mBAAmB;IACnB,UAAU;IACV,iBAAiB;IACjB,mBAAmB;IACnB,YAAY;CACb,CAAA"} \ No newline at end of file +{"version":3,"file":"messageHandler.js","sourceRoot":"","sources":["../../src/utils/messageHandler.ts"],"names":[],"mappings":";AAAA,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAE/B,SAAS,YAAY,CAAC,OAAe;IACpC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACtB,CAAC;AAED,SAAS,mBAAmB,CAAC,OAAe;IAC3C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAErB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAe,EAAE,IAAI,GAAG,KAAK;IACvD,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAEvC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACzB,CAAC;AAED,SAAS,mBAAmB,CAAC,OAAe,EAAE,IAAI,GAAG,KAAK;IACzD,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAEzC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACzB,CAAC;AAED,SAAS,UAAU,CAAC,KAAa,EAAE,IAAI,GAAG,KAAK;IAC9C,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAExC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACzB,CAAC;AAED,SAAS,YAAY,CAAC,KAAU;IAC/B,IAAI,KAAK,CAAC,MAAM,EAAE;QACjB,UAAU,CAAC,YAAY,KAAK,CAAC,MAAM,YAAY,KAAK,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,CAAC;KAC1E;SAAM;QACN,UAAU,CAAC,YAAY,KAAK,EAAE,EAAE,IAAI,CAAC,CAAC;KACtC;AACF,CAAC;AAED,iBAAS;IACR,YAAY;IACZ,mBAAmB;IACnB,UAAU;IACV,iBAAiB;IACjB,mBAAmB;IACnB,YAAY;CACZ,CAAC"} \ No newline at end of file diff --git a/app-cli/built/utils/validationsHandler.js b/app-cli/built/utils/validationsHandler.js index 4f9ff97..5080b7f 100755 --- a/app-cli/built/utils/validationsHandler.js +++ b/app-cli/built/utils/validationsHandler.js @@ -6,23 +6,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -const fs = require("fs-extra"); -const DeployApi = require("../api/DeployApi"); -const { printError } = require("./messageHandler"); -const { requestLogin } = require("../commands/login"); -const { initMachineFromLocalStorage } = require("../utils/machineUtils"); +const fs = require('fs-extra'); +const DeployApi = require('../api/DeployApi'); +const { printError } = require('./messageHandler'); +const { requestLogin } = require('../commands/login'); +const { initMachineFromLocalStorage } = require('../utils/machineUtils'); function validateIsGitRepository() { - const gitFolderExists = fs.pathExistsSync("./.git"); + const gitFolderExists = fs.pathExistsSync('./.git'); if (!gitFolderExists) { - printError("\n**** ERROR: You are not in a git root directory. This command will only deploys the current directory ****\n", true); + printError('\n**** ERROR: You are not in a git root directory. This command will only deploys the current directory ****\n', true); } } function validateDefinitionFile() { - const captainDefinitionExists = fs.pathExistsSync("./captain-definition"); + const captainDefinitionExists = fs.pathExistsSync('./captain-definition'); if (!captainDefinitionExists) { - printError("\n**** ERROR: captain-definition file cannot be found. Please see docs! ****\n", true); + printError('\n**** ERROR: captain-definition file cannot be found. Please see docs! ****\n', true); } - const contents = fs.readFileSync("./captain-definition", "utf8"); + const contents = fs.readFileSync('./captain-definition', 'utf8'); let contentsJson = null; try { contentsJson = JSON.parse(contents); @@ -32,13 +32,13 @@ function validateDefinitionFile() { } if (contentsJson) { if (!contentsJson.schemaVersion) { - printError("**** ERROR: captain-definition needs schemaVersion. Please see docs! ****", true); + printError('**** ERROR: captain-definition needs schemaVersion. Please see docs! ****', true); } if (!contentsJson.templateId && !contentsJson.dockerfileLines) { - printError("**** ERROR: captain-definition needs templateId or dockerfileLines. Please see docs! ****", true); + printError('**** ERROR: captain-definition needs templateId or dockerfileLines. Please see docs! ****', true); } if (contentsJson.templateId && contentsJson.dockerfileLines) { - printError("**** ERROR: captain-definition needs templateId or dockerfileLines, NOT BOTH! Please see docs! ****", true); + printError('**** ERROR: captain-definition needs templateId or dockerfileLines, NOT BOTH! Please see docs! ****', true); } } } diff --git a/app-cli/built/utils/validationsHandler.js.map b/app-cli/built/utils/validationsHandler.js.map index 3921845..6ce3cdb 100644 --- a/app-cli/built/utils/validationsHandler.js.map +++ b/app-cli/built/utils/validationsHandler.js.map @@ -1 +1 @@ -{"version":3,"file":"validationsHandler.js","sourceRoot":"","sources":["../../src/utils/validationsHandler.js"],"names":[],"mappings":";;;;;;;;AAAA,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAC9B,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAC7C,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;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A0B;IAC1B,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE;QACtB,OAAO,KAAK,CAAA;KACb;IAED,OAAO,IAAI,CAAA;AACb,CAAC;AAED,SAAS,WAAW,CAAC,SAAS;IAC5B,IACE,kKAAkK,CAAC,IAAI,CACrK,SAAS,CACV,EACD;QACA,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAe,sBAAsB;;QACnC,yBAAyB;QACzB,MAAM,eAAe,GAAG,MAAM,SAAS,CAAC,gBAAgB,EAAE,CAAA;QAE1D,mBAAmB;QACnB,WAAW;QACX,kBAAkB;QAClB,IAAI,CAAC,eAAe,EAAE;YACpB,MAAM,cAAc,GAAG,MAAM,YAAY,EAAE,CAAA;YAE3C,6BAA6B;YAC7B,2BAA2B,EAAE,CAAA;YAE7B,OAAO,cAAc,CAAA;SACtB;aAAM;YACL,OAAO,OAAO,CAAC,eAAe,CAAC,CAAA;SAChC;IACH,CAAC;CAAA;AAED,MAAM,CAAC,OAAO,GAAG;IACf,sBAAsB;IACtB,uBAAuB;IACvB,sBAAsB;IACtB,WAAW;IACX,gBAAgB;CACjB,CAAA"} \ No newline at end of file +{"version":3,"file":"validationsHandler.js","sourceRoot":"","sources":["../../src/utils/validationsHandler.ts"],"names":[],"mappings":";;;;;;;;AAAA,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAC/B,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC9C,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AACnD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AACtD,MAAM,EAAE,2BAA2B,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAEzE,SAAS,uBAAuB;IAC/B,MAAM,eAAe,GAAG,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;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;KACZ;IAED,OAAO,KAAK,CAAC;AACd,CAAC;AAED,SAAe,sBAAsB;;QACpC,yBAAyB;QACzB,MAAM,eAAe,GAAG,MAAM,SAAS,CAAC,gBAAgB,EAAE,CAAC;QAE3D,mBAAmB;QACnB,WAAW;QACX,kBAAkB;QAClB,IAAI,CAAC,eAAe,EAAE;YACrB,MAAM,cAAc,GAAG,MAAM,YAAY,EAAE,CAAC;YAE5C,6BAA6B;YAC7B,2BAA2B,EAAE,CAAC;YAE9B,OAAO,cAAc,CAAC;SACtB;aAAM;YACN,OAAO,OAAO,CAAC,eAAe,CAAC,CAAC;SAChC;IACF,CAAC;CAAA;AAED,MAAM,CAAC,OAAO,GAAG;IAChB,sBAAsB;IACtB,uBAAuB;IACvB,sBAAsB;IACtB,WAAW;IACX,gBAAgB;CAChB,CAAC"} \ No newline at end of file diff --git a/app-cli/src/models/IModels.ts b/app-cli/src/models/IModels.ts new file mode 100644 index 0000000..8123046 --- /dev/null +++ b/app-cli/src/models/IModels.ts @@ -0,0 +1,10 @@ +export interface IApp { + cwd: string; + appName: string; + branchToPush: string; + machineToDeploy: string; +} + +export interface IMachine { + name: string; +} diff --git a/app-cli/src/utils/loginHelpers.js b/app-cli/src/utils/loginHelpers.js deleted file mode 100644 index 187c417..0000000 --- a/app-cli/src/utils/loginHelpers.js +++ /dev/null @@ -1,46 +0,0 @@ -const MachineHelper = require("../helpers/MachineHelper") - -function cleanUpUrl(url) { - if (!url || !url.length) return null - - let cleanedUrl = url - const hasSlashAtTheEnd = url.substr(url.length - 1, 1) === "/" - - if (hasSlashAtTheEnd) { - // Remove the slash at the end - cleanedUrl = url.substr(0, url.length - 1) - } - - return cleanedUrl - .replace("http://", "") - .replace("https://", "") - .trim() -} - -function findDefaultCaptainName() { - let currentSuffix = MachineHelper.machines.length + 1 - - while (!isSuffixValid(currentSuffix)) { - currentSuffix++ - } - - return getCaptainFullName(currentSuffix) -} - -function getCaptainFullName(suffix) { - const formatSuffix = suffix < 10 ? `0${suffix}` : suffix - - return `captain-${formatSuffix}` -} - -const isSuffixValid = suffixNumber => - MachineHelper.machines.map(machine => { - machine.name !== getCaptainFullName(suffixNumber) - }) - -module.exports = { - cleanUpUrl, - findDefaultCaptainName, - isSuffixValid, - getCaptainFullName -} diff --git a/app-cli/src/utils/loginHelpers.ts b/app-cli/src/utils/loginHelpers.ts new file mode 100644 index 0000000..f40f59b --- /dev/null +++ b/app-cli/src/utils/loginHelpers.ts @@ -0,0 +1,45 @@ +import { IMachine } from '../models/IModels'; + +const MachineHelper = require('../helpers/MachineHelper'); + +function cleanUpUrl(url: string) { + if (!url || !url.length) return null; + + let cleanedUrl = url; + const hasSlashAtTheEnd = url.substr(url.length - 1, 1) === '/'; + + if (hasSlashAtTheEnd) { + // Remove the slash at the end + cleanedUrl = url.substr(0, url.length - 1); + } + + return cleanedUrl.replace('http://', '').replace('https://', '').trim(); +} + +function findDefaultCaptainName() { + let currentSuffix = MachineHelper.machines.length + 1; + + while (!isSuffixValid(currentSuffix)) { + currentSuffix++; + } + + return getCaptainFullName(currentSuffix); +} + +function getCaptainFullName(suffix: number) { + const formatSuffix = suffix < 10 ? `0${suffix}` : suffix; + + return `captain-${formatSuffix}`; +} + +const isSuffixValid = (suffixNumber: number) => + MachineHelper.machines.map((machine: IMachine) => { + machine.name !== getCaptainFullName(suffixNumber); + }); + +module.exports = { + cleanUpUrl, + findDefaultCaptainName, + isSuffixValid, + getCaptainFullName +}; diff --git a/app-cli/src/utils/machineUtils.js b/app-cli/src/utils/machineUtils.js deleted file mode 100644 index 53b27a7..0000000 --- a/app-cli/src/utils/machineUtils.js +++ /dev/null @@ -1,56 +0,0 @@ -const DeployApi = require("../api/DeployApi") -const MachineHelper = require("../helpers/MachineHelper") - -function initMachineFromLocalStorage() { - const possibleApp = MachineHelper.apps.find(app => app.cwd === process.cwd()) - - if (possibleApp) { - DeployApi.setMachineToDeploy(possibleApp.machineToDeploy) - - DeployApi.setAppName(possibleApp.appName) - - DeployApi.setBranchToPush(possibleApp.branchToPush) - } -} - -// Saves the app directory into local storage -function saveMachineToLocalStorage() { - const apps = MachineHelper.apps - const currentDirectory = process.cwd() - let appExists = false - // Update app - const updatedApps = apps.map(app => { - if (app.cwd === currentDirectory) { - appExists = true - - return { - cwd: app.cwd, - appName: DeployApi.appName, - branchToPush: DeployApi.branchToPush, - machineToDeploy: DeployApi.machineToDeploy - } - } - - return app - }) - - MachineHelper.setApps(updatedApps) - - if (!appExists) { - const newApp = { - cwd: process.cwd(), - appName: DeployApi.appName, - branchToPush: DeployApi.branchToPush, - machineToDeploy: DeployApi.machineToDeploy - } - - updatedApps.push(newApp) - - MachineHelper.setApps(apps) - } -} - -module.exports = { - initMachineFromLocalStorage, - saveMachineToLocalStorage -} diff --git a/app-cli/src/utils/machineUtils.ts b/app-cli/src/utils/machineUtils.ts new file mode 100644 index 0000000..5896215 --- /dev/null +++ b/app-cli/src/utils/machineUtils.ts @@ -0,0 +1,58 @@ +import { IApp } from '../models/IModels'; + +const DeployApi = require('../api/DeployApi'); +const MachineHelper = require('../helpers/MachineHelper'); + +function initMachineFromLocalStorage() { + const possibleApp = MachineHelper.apps.find((app: IApp) => app.cwd === process.cwd()); + + if (possibleApp) { + DeployApi.setMachineToDeploy(possibleApp.machineToDeploy); + + DeployApi.setAppName(possibleApp.appName); + + DeployApi.setBranchToPush(possibleApp.branchToPush); + } +} + +// Saves the app directory into local storage +function saveMachineToLocalStorage() { + const apps = MachineHelper.apps; + const currentDirectory = process.cwd(); + let appExists = false; + // Update app + const updatedApps = apps.map((app: IApp) => { + if (app.cwd === currentDirectory) { + appExists = true; + + return { + cwd: app.cwd, + appName: DeployApi.appName, + branchToPush: DeployApi.branchToPush, + machineToDeploy: DeployApi.machineToDeploy + }; + } + + return app; + }); + + MachineHelper.setApps(updatedApps); + + if (!appExists) { + const newApp = { + cwd: process.cwd(), + appName: DeployApi.appName, + branchToPush: DeployApi.branchToPush, + machineToDeploy: DeployApi.machineToDeploy + }; + + updatedApps.push(newApp); + + MachineHelper.setApps(apps); + } +} + +module.exports = { + initMachineFromLocalStorage, + saveMachineToLocalStorage +}; diff --git a/app-cli/src/utils/messageHandler.js b/app-cli/src/utils/messageHandler.js deleted file mode 100644 index 77152ea..0000000 --- a/app-cli/src/utils/messageHandler.js +++ /dev/null @@ -1,46 +0,0 @@ -const chalk = require("chalk") - -function printMessage(message) { - console.log(message) -} - -function printMessageAndExit(message) { - console.log(message) - - process.exit(0) -} - -function printGreenMessage(message, exit = false) { - console.log(`${chalk.green(message)}`) - - exit && process.exit(0) -} - -function printMagentaMessage(message, exit = false) { - console.log(`${chalk.magenta(message)}`) - - exit && process.exit(0) -} - -function printError(error, exit = false) { - console.log(`${chalk.bold.red(error)}`) - - exit && process.exit(0) -} - -function errorHandler(error) { - if (error.status) { - printError(`\nError: ${error.status}\nError: ${error.description}`, true) - } else { - printError(`\nError: ${error}`, true) - } -} - -module.exports = { - printMessage, - printMessageAndExit, - printError, - printGreenMessage, - printMagentaMessage, - errorHandler -} diff --git a/app-cli/src/utils/messageHandler.ts b/app-cli/src/utils/messageHandler.ts new file mode 100644 index 0000000..74fd4c3 --- /dev/null +++ b/app-cli/src/utils/messageHandler.ts @@ -0,0 +1,46 @@ +const chalk = require('chalk'); + +function printMessage(message: string) { + console.log(message); +} + +function printMessageAndExit(message: string) { + console.log(message); + + process.exit(0); +} + +function printGreenMessage(message: string, exit = false) { + console.log(`${chalk.green(message)}`); + + exit && process.exit(0); +} + +function printMagentaMessage(message: string, exit = false) { + console.log(`${chalk.magenta(message)}`); + + exit && process.exit(0); +} + +function printError(error: string, exit = false) { + console.log(`${chalk.bold.red(error)}`); + + exit && process.exit(0); +} + +function errorHandler(error: any) { + if (error.status) { + printError(`\nError: ${error.status}\nError: ${error.description}`, true); + } else { + printError(`\nError: ${error}`, true); + } +} + +export = { + printMessage, + printMessageAndExit, + printError, + printGreenMessage, + printMagentaMessage, + errorHandler +}; diff --git a/app-cli/src/utils/validationsHandler.js b/app-cli/src/utils/validationsHandler.js deleted file mode 100644 index 21f8d93..0000000 --- a/app-cli/src/utils/validationsHandler.js +++ /dev/null @@ -1,111 +0,0 @@ -const fs = require("fs-extra") -const DeployApi = require("../api/DeployApi") -const { printError } = require("./messageHandler") -const { requestLogin } = require("../commands/login") -const { initMachineFromLocalStorage } = require("../utils/machineUtils") - -function validateIsGitRepository() { - const gitFolderExists = fs.pathExistsSync("./.git") - - if (!gitFolderExists) { - printError( - "\n**** ERROR: You are not in a git root directory. This command will only deploys the current directory ****\n", - true - ) - } -} - -function validateDefinitionFile() { - const captainDefinitionExists = fs.pathExistsSync("./captain-definition") - - if (!captainDefinitionExists) { - printError( - "\n**** ERROR: captain-definition file cannot be found. Please see docs! ****\n", - true - ) - } - - const contents = fs.readFileSync("./captain-definition", "utf8") - let contentsJson = null - - try { - contentsJson = JSON.parse(contents) - } catch (e) { - printError( - `**** ERROR: captain-definition file is not a valid JSON! ****\n Error:${e}`, - true - ) - } - - if (contentsJson) { - if (!contentsJson.schemaVersion) { - printError( - "**** ERROR: captain-definition needs schemaVersion. Please see docs! ****", - true - ) - } - - if (!contentsJson.templateId && !contentsJson.dockerfileLines) { - printError( - "**** ERROR: captain-definition needs templateId or dockerfileLines. Please see docs! ****", - true - ) - } - - if (contentsJson.templateId && contentsJson.dockerfileLines) { - printError( - "**** ERROR: captain-definition needs templateId or dockerfileLines, NOT BOTH! Please see docs! ****", - true - ) - } - } -} - -// Only show that question if there is no option given as argument -function optionIsNotGiven(allOptions, option) { - // console.log(allOptions) - if (allOptions[option]) { - return false - } - - return true -} - -function isIpAddress(ipaddress) { - if ( - /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test( - ipaddress - ) - ) { - return true - } - - return false -} - -async function validateAuthentication() { - // 1. Check if valid auth - const isAuthenticated = await DeployApi.isAuthTokenValid() - - // 2. Request login - // 3. Login - // 4. Update token - if (!isAuthenticated) { - const loggedInStatus = await requestLogin() - - // Refresh token in DeployApi - initMachineFromLocalStorage() - - return loggedInStatus - } else { - return Boolean(isAuthenticated) - } -} - -module.exports = { - validateAuthentication, - validateIsGitRepository, - validateDefinitionFile, - isIpAddress, - optionIsNotGiven -} diff --git a/app-cli/src/utils/validationsHandler.ts b/app-cli/src/utils/validationsHandler.ts new file mode 100644 index 0000000..00204c0 --- /dev/null +++ b/app-cli/src/utils/validationsHandler.ts @@ -0,0 +1,102 @@ +const fs = require('fs-extra'); +const DeployApi = require('../api/DeployApi'); +const { printError } = require('./messageHandler'); +const { requestLogin } = require('../commands/login'); +const { initMachineFromLocalStorage } = require('../utils/machineUtils'); + +function validateIsGitRepository() { + const gitFolderExists = fs.pathExistsSync('./.git'); + + if (!gitFolderExists) { + printError( + '\n**** ERROR: You are not in a git root directory. This command will only deploys the current directory ****\n', + true + ); + } +} + +function validateDefinitionFile() { + const captainDefinitionExists = fs.pathExistsSync('./captain-definition'); + + if (!captainDefinitionExists) { + printError('\n**** ERROR: captain-definition file cannot be found. Please see docs! ****\n', true); + } + + const contents = fs.readFileSync('./captain-definition', 'utf8'); + let contentsJson = null; + + try { + contentsJson = JSON.parse(contents); + } catch (e) { + printError(`**** ERROR: captain-definition file is not a valid JSON! ****\n Error:${e}`, true); + } + + if (contentsJson) { + if (!contentsJson.schemaVersion) { + printError('**** ERROR: captain-definition needs schemaVersion. Please see docs! ****', true); + } + + if (!contentsJson.templateId && !contentsJson.dockerfileLines) { + printError( + '**** ERROR: captain-definition needs templateId or dockerfileLines. Please see docs! ****', + true + ); + } + + if (contentsJson.templateId && contentsJson.dockerfileLines) { + printError( + '**** ERROR: captain-definition needs templateId or dockerfileLines, NOT BOTH! Please see docs! ****', + true + ); + } + } +} + +// Only show that question if there is no option given as argument +function optionIsNotGiven(allOptions: { [id: string]: any }, option: string) { + // console.log(allOptions) + if (allOptions[option]) { + return false; + } + + return true; +} + +function isIpAddress(ipaddress: string) { + if ( + /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test( + ipaddress + ) + ) { + return true; + } + + return false; +} + +async function validateAuthentication() { + // 1. Check if valid auth + const isAuthenticated = await DeployApi.isAuthTokenValid(); + + // 2. Request login + // 3. Login + // 4. Update token + if (!isAuthenticated) { + const loggedInStatus = await requestLogin(); + + // Refresh token in DeployApi + initMachineFromLocalStorage(); + + return loggedInStatus; + } else { + return Boolean(isAuthenticated); + } +} + +module.exports = { + validateAuthentication, + validateIsGitRepository, + validateDefinitionFile, + isIpAddress, + optionIsNotGiven +}; From 23fb5e413102d886db04dab607a40df2de1651d7 Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Thu, 3 Jan 2019 23:27:30 -0800 Subject: [PATCH 29/44] helpers converted --- app-cli/built/helpers/MachineHelper.js | 38 +++---- app-cli/built/helpers/MachineHelper.js.map | 2 +- app-cli/built/helpers/SpinnerHelper.js | 9 +- app-cli/built/helpers/SpinnerHelper.js.map | 2 +- app-cli/src/helpers/MachineHelper.js | 111 --------------------- app-cli/src/helpers/MachineHelper.ts | 107 ++++++++++++++++++++ app-cli/src/helpers/SpinnerHelper.js | 29 ------ app-cli/src/helpers/SpinnerHelper.ts | 27 +++++ app-cli/src/models/IModels.ts | 4 +- 9 files changed, 162 insertions(+), 167 deletions(-) delete mode 100644 app-cli/src/helpers/MachineHelper.js create mode 100644 app-cli/src/helpers/MachineHelper.ts delete mode 100644 app-cli/src/helpers/SpinnerHelper.js create mode 100644 app-cli/src/helpers/SpinnerHelper.ts diff --git a/app-cli/built/helpers/MachineHelper.js b/app-cli/built/helpers/MachineHelper.js index 9d7b99e..94afcbe 100755 --- a/app-cli/built/helpers/MachineHelper.js +++ b/app-cli/built/helpers/MachineHelper.js @@ -1,23 +1,25 @@ -const { printMessage } = require("../utils/messageHandler"); -const configstore = require("configstore"); -const packagejson = require("../../package.json"); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const { printMessage } = require('../utils/messageHandler'); +const configstore = require('configstore'); +const packagejson = require('../../package.json'); const configs = new configstore(packagejson.name, { captainMachines: [] }); class MachineHelper { constructor() { - this.machines = configs.get("captainMachines"); - this.apps = configs.get("apps"); + this.machines = configs.get('captainMachines'); + this.apps = configs.get('apps'); } getMachinesAsOptions() { const firstItemInOption = [ { - name: "-- CANCEL --", - value: "", - short: "" + name: '-- CANCEL --', + value: '', + short: '' } ]; - const listOfMachines = this.machines.map(machine => { + const listOfMachines = this.machines.map((machine) => { return { name: `${machine.name} at ${machine.baseUrl}`, value: `${machine.name}`, @@ -28,11 +30,11 @@ class MachineHelper { } setMachines(newMachines) { this.machines = newMachines; - configs.set("captainMachines", newMachines); + configs.set('captainMachines', newMachines); } updateMachineAuthToken(machineName, authToken) { - let updatedMachine = {}; - const newMachines = this.machines.map(machine => { + let updatedMachine; + const newMachines = this.machines.map((machine) => { if (machine.name === machineName) { updatedMachine = Object.assign({}, machine, { authToken }); return updatedMachine; @@ -45,7 +47,7 @@ class MachineHelper { updateAppsAuthToken(updatedMachine) { if (!updatedMachine) return; - const newApps = this.apps.map(app => { + const newApps = this.apps.map((app) => { if (app.machineToDeploy.name === updatedMachine.name) { return Object.assign({}, app, { machineToDeploy: updatedMachine }); } @@ -55,18 +57,18 @@ class MachineHelper { } setApps(newApps) { this.apps = newApps; - configs.set("apps", newApps); + configs.set('apps', newApps); } addMachine(newMachine) { const tempMachines = this.machines; const newMachines = [...tempMachines, newMachine]; // Add to local storage - configs.set("captainMachines", newMachines); - this.setMachines(configs.get("captainMachines")); + configs.set('captainMachines', newMachines); + this.setMachines(configs.get('captainMachines')); } logoutMachine(machineName) { - const removedMachine = this.machines.filter(machine => machine.name === machineName)[0]; - const newMachines = this.machines.filter(machine => machine.name !== machineName); + const removedMachine = this.machines.filter((machine) => machine.name === machineName)[0]; + const newMachines = this.machines.filter((machine) => machine.name !== machineName); this.setMachines(newMachines); printMessage(`You are now logged out from ${removedMachine.name} at ${removedMachine.baseUrl}...\n`); } diff --git a/app-cli/built/helpers/MachineHelper.js.map b/app-cli/built/helpers/MachineHelper.js.map index 138dc57..69f8f40 100644 --- a/app-cli/built/helpers/MachineHelper.js.map +++ b/app-cli/built/helpers/MachineHelper.js.map @@ -1 +1 @@ -{"version":3,"file":"MachineHelper.js","sourceRoot":"","sources":["../../src/helpers/MachineHelper.js"],"names":[],"mappings":"AAAA,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAA;AAC3D,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;AAC1C,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AACjD,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE;IAChD,eAAe,EAAE,EAAE;CACpB,CAAC,CAAA;AAEF,MAAM,aAAa;IACjB;QACE,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;QAE9C,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACjC,CAAC;IAED,oBAAoB;QAClB,MAAM,iBAAiB,GAAG;YACxB;gBACE,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE,EAAE;gBACT,KAAK,EAAE,EAAE;aACV;SACF,CAAA;QACD,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YACjD,OAAO;gBACL,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,OAAO,OAAO,CAAC,OAAO,EAAE;gBAC7C,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE;gBACxB,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M,EAAE,OAAO,CAAC,CAAA;IAC9B,CAAC;IAED,UAAU,CAAC,UAAU;QACnB,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAA;QAClC,MAAM,WAAW,GAAG,CAAC,GAAG,YAAY,EAAE,UAAU,CAAC,CAAA;QAEjD,uBAAuB;QACvB,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAA;QAE3C,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAA;IAClD,CAAC;IAED,aAAa,CAAC,WAAW;QACvB,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CACzC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,WAAW,CACxC,CAAC,CAAC,CAAC,CAAA;QACJ,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CACtC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,WAAW,CACxC,CAAA;QAED,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAA;QAE7B,YAAY,CACV,+BAA+B,cAAc,CAAC,IAAI,OAChD,cAAc,CAAC,OACjB,OAAO,CACR,CAAA;IACH,CAAC;CACF;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,aAAa,EAAE,CAAA"} \ No newline at end of file +{"version":3,"file":"MachineHelper.js","sourceRoot":"","sources":["../../src/helpers/MachineHelper.ts"],"names":[],"mappings":";;AAEA,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAC5D,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAC3C,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAClD,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE;IACjD,eAAe,EAAE,EAAE;CACnB,CAAC,CAAC;AAEH,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,WAAW,CAAC,WAAW,CAAC,CAAC;QAE9B,YAAY,CAAC,+BAA+B,cAAc,CAAC,IAAI,OAAO,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC;IACtG,CAAC;CACD;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC"} \ No newline at end of file diff --git a/app-cli/built/helpers/SpinnerHelper.js b/app-cli/built/helpers/SpinnerHelper.js index 8869159..4aecc4d 100755 --- a/app-cli/built/helpers/SpinnerHelper.js +++ b/app-cli/built/helpers/SpinnerHelper.js @@ -1,14 +1,11 @@ -const ora = require("ora"); +const ora = require('ora'); class SpinnerHelper { - constructor() { - this.spinner; + start(message) { + this.spinner = ora(message).start(); } setColor(color) { this.spinner.color = color; } - start(message) { - this.spinner = ora(message).start(); - } stop() { this.spinner.stop(); } diff --git a/app-cli/built/helpers/SpinnerHelper.js.map b/app-cli/built/helpers/SpinnerHelper.js.map index fbbe894..f62b4db 100644 --- a/app-cli/built/helpers/SpinnerHelper.js.map +++ b/app-cli/built/helpers/SpinnerHelper.js.map @@ -1 +1 @@ -{"version":3,"file":"SpinnerHelper.js","sourceRoot":"","sources":["../../src/helpers/SpinnerHelper.js"],"names":[],"mappings":"AAAA,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAA;AAE1B,MAAM,aAAa;IACjB;QACE,IAAI,CAAC,OAAO,CAAA;IACd,CAAC;IAED,QAAQ,CAAC,KAAK;QACZ,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAA;IAC5B,CAAC;IAED,KAAK,CAAC,OAAO;QACX,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAA;IACrC,CAAC;IAED,IAAI;QACF,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAA;IACrB,CAAC;IAED,OAAO;QACL,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAA;IACxB,CAAC;IAED,IAAI;QACF,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAA;IACrB,CAAC;CACF;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,aAAa,EAAE,CAAA"} \ No newline at end of file +{"version":3,"file":"SpinnerHelper.js","sourceRoot":"","sources":["../../src/helpers/SpinnerHelper.ts"],"names":[],"mappings":"AAAA,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAE3B,MAAM,aAAa;IAGlB,KAAK,CAAC,OAAe;QACpB,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC;IACrC,CAAC;IAED,QAAQ,CAAC,KAAa;QACrB,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IAC5B,CAAC;IAED,IAAI;QACH,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;IAED,OAAO;QACN,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,IAAI;QACH,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;CACD;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC"} \ No newline at end of file diff --git a/app-cli/src/helpers/MachineHelper.js b/app-cli/src/helpers/MachineHelper.js deleted file mode 100644 index 4602bd5..0000000 --- a/app-cli/src/helpers/MachineHelper.js +++ /dev/null @@ -1,111 +0,0 @@ -const { printMessage } = require("../utils/messageHandler") -const configstore = require("configstore") -const packagejson = require("../../package.json") -const configs = new configstore(packagejson.name, { - captainMachines: [] -}) - -class MachineHelper { - constructor() { - this.machines = configs.get("captainMachines") - - this.apps = configs.get("apps") - } - - getMachinesAsOptions() { - const firstItemInOption = [ - { - name: "-- CANCEL --", - value: "", - short: "" - } - ] - const listOfMachines = this.machines.map(machine => { - return { - name: `${machine.name} at ${machine.baseUrl}`, - value: `${machine.name}`, - short: `${machine.name} at ${machine.baseUrl}` - } - }) - - return [...firstItemInOption, ...listOfMachines] - } - - setMachines(newMachines) { - this.machines = newMachines - - configs.set("captainMachines", newMachines) - } - - updateMachineAuthToken(machineName, authToken) { - let updatedMachine = {} - const newMachines = this.machines.map(machine => { - if (machine.name === machineName) { - updatedMachine = { - ...machine, - authToken - } - - return updatedMachine - } - - return machine - }) - - this.setMachines(newMachines) - - this.updateAppsAuthToken(updatedMachine) - } - - updateAppsAuthToken(updatedMachine) { - if (!updatedMachine) return - - const newApps = this.apps.map(app => { - if (app.machineToDeploy.name === updatedMachine.name) { - return { - ...app, - machineToDeploy: updatedMachine - } - } - - return app - }) - - this.setApps(newApps) - } - - setApps(newApps) { - this.apps = newApps - - configs.set("apps", newApps) - } - - addMachine(newMachine) { - const tempMachines = this.machines - const newMachines = [...tempMachines, newMachine] - - // Add to local storage - configs.set("captainMachines", newMachines) - - this.setMachines(configs.get("captainMachines")) - } - - logoutMachine(machineName) { - const removedMachine = this.machines.filter( - machine => machine.name === machineName - )[0] - const newMachines = this.machines.filter( - machine => machine.name !== machineName - ) - - this.setMachines(newMachines) - - printMessage( - `You are now logged out from ${removedMachine.name} at ${ - removedMachine.baseUrl - }...\n` - ) - } -} - -module.exports = new MachineHelper() diff --git a/app-cli/src/helpers/MachineHelper.ts b/app-cli/src/helpers/MachineHelper.ts new file mode 100644 index 0000000..6283e90 --- /dev/null +++ b/app-cli/src/helpers/MachineHelper.ts @@ -0,0 +1,107 @@ +import { IMachine, IApp } from '../models/IModels'; + +const { printMessage } = require('../utils/messageHandler'); +const configstore = require('configstore'); +const packagejson = require('../../package.json'); +const configs = new configstore(packagejson.name, { + captainMachines: [] +}); + +class MachineHelper { + private machines: IMachine[]; + private apps: IApp[]; + constructor() { + this.machines = configs.get('captainMachines'); + + this.apps = configs.get('apps'); + } + + getMachinesAsOptions() { + const firstItemInOption = [ + { + name: '-- CANCEL --', + value: '', + short: '' + } + ]; + const listOfMachines = this.machines.map((machine) => { + return { + name: `${machine.name} at ${machine.baseUrl}`, + value: `${machine.name}`, + short: `${machine.name} at ${machine.baseUrl}` + }; + }); + + return [ ...firstItemInOption, ...listOfMachines ]; + } + + setMachines(newMachines: IMachine[]) { + this.machines = newMachines; + + configs.set('captainMachines', newMachines); + } + + updateMachineAuthToken(machineName: string, authToken: string) { + let updatedMachine: IMachine; + const newMachines = this.machines.map((machine) => { + if (machine.name === machineName) { + updatedMachine = { + ...machine, + authToken + }; + + return updatedMachine; + } + + return machine; + }); + + this.setMachines(newMachines); + + this.updateAppsAuthToken(updatedMachine!); + } + + updateAppsAuthToken(updatedMachine: IMachine) { + if (!updatedMachine) return; + + const newApps = this.apps.map((app) => { + if (app.machineToDeploy.name === updatedMachine.name) { + return { + ...app, + machineToDeploy: updatedMachine + }; + } + + return app; + }); + + this.setApps(newApps); + } + + setApps(newApps: IApp[]) { + this.apps = newApps; + + configs.set('apps', newApps); + } + + addMachine(newMachine: IMachine) { + const tempMachines = this.machines; + const newMachines = [ ...tempMachines, newMachine ]; + + // Add to local storage + configs.set('captainMachines', newMachines); + + this.setMachines(configs.get('captainMachines')); + } + + logoutMachine(machineName: string) { + const removedMachine = this.machines.filter((machine) => machine.name === machineName)[0]; + const newMachines = this.machines.filter((machine) => machine.name !== machineName); + + this.setMachines(newMachines); + + printMessage(`You are now logged out from ${removedMachine.name} at ${removedMachine.baseUrl}...\n`); + } +} + +module.exports = new MachineHelper(); diff --git a/app-cli/src/helpers/SpinnerHelper.js b/app-cli/src/helpers/SpinnerHelper.js deleted file mode 100644 index b67c3a9..0000000 --- a/app-cli/src/helpers/SpinnerHelper.js +++ /dev/null @@ -1,29 +0,0 @@ -const ora = require("ora") - -class SpinnerHelper { - constructor() { - this.spinner - } - - setColor(color) { - this.spinner.color = color - } - - start(message) { - this.spinner = ora(message).start() - } - - stop() { - this.spinner.stop() - } - - succeed() { - this.spinner.succeed() - } - - fail() { - this.spinner.fail() - } -} - -module.exports = new SpinnerHelper() diff --git a/app-cli/src/helpers/SpinnerHelper.ts b/app-cli/src/helpers/SpinnerHelper.ts new file mode 100644 index 0000000..520b776 --- /dev/null +++ b/app-cli/src/helpers/SpinnerHelper.ts @@ -0,0 +1,27 @@ +const ora = require('ora'); + +class SpinnerHelper { + private spinner: any; + + start(message: string) { + this.spinner = ora(message).start(); + } + + setColor(color: string) { + this.spinner.color = color; + } + + stop() { + this.spinner.stop(); + } + + succeed() { + this.spinner.succeed(); + } + + fail() { + this.spinner.fail(); + } +} + +module.exports = new SpinnerHelper(); diff --git a/app-cli/src/models/IModels.ts b/app-cli/src/models/IModels.ts index 8123046..386ff21 100644 --- a/app-cli/src/models/IModels.ts +++ b/app-cli/src/models/IModels.ts @@ -2,9 +2,11 @@ export interface IApp { cwd: string; appName: string; branchToPush: string; - machineToDeploy: string; + machineToDeploy: IMachine; } export interface IMachine { name: string; + authToken: string; + baseUrl: string; } From 47e9936f3936bba4a42502de39c5d2fa574505d1 Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Thu, 3 Jan 2019 23:29:17 -0800 Subject: [PATCH 30/44] Added delete before build --- app-cli/built/api/DeployApi.js | 0 app-cli/built/api/LoginApi.js | 0 app-cli/built/api/MainApi.js | 0 app-cli/built/api/SystemApi.js | 0 app-cli/built/commands/captainduckduck.js | 0 app-cli/built/commands/deploy.js | 0 app-cli/built/commands/list.js | 0 app-cli/built/commands/login.js | 0 app-cli/built/commands/logout.js | 0 app-cli/built/commands/serversetup.js | 0 app-cli/built/helpers/MachineHelper.js | 0 app-cli/built/helpers/SpinnerHelper.js | 0 app-cli/built/utils/__tests__/loginHelpers.test.js | 0 app-cli/built/utils/__tests__/machineUtils.test.js | 0 app-cli/built/utils/__tests__/validationsHandler.test.js | 0 app-cli/built/utils/constants.js | 0 app-cli/built/utils/fileHelper.js | 0 app-cli/built/utils/loginHelpers.js | 0 app-cli/built/utils/machineUtils.js | 0 app-cli/built/utils/messageHandler.js | 0 app-cli/built/utils/validationsHandler.js | 0 app-cli/package.json | 2 +- 22 files changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 app-cli/built/api/DeployApi.js mode change 100755 => 100644 app-cli/built/api/LoginApi.js mode change 100755 => 100644 app-cli/built/api/MainApi.js mode change 100755 => 100644 app-cli/built/api/SystemApi.js mode change 100755 => 100644 app-cli/built/commands/captainduckduck.js mode change 100755 => 100644 app-cli/built/commands/deploy.js mode change 100755 => 100644 app-cli/built/commands/list.js mode change 100755 => 100644 app-cli/built/commands/login.js mode change 100755 => 100644 app-cli/built/commands/logout.js mode change 100755 => 100644 app-cli/built/commands/serversetup.js mode change 100755 => 100644 app-cli/built/helpers/MachineHelper.js mode change 100755 => 100644 app-cli/built/helpers/SpinnerHelper.js mode change 100755 => 100644 app-cli/built/utils/__tests__/loginHelpers.test.js mode change 100755 => 100644 app-cli/built/utils/__tests__/machineUtils.test.js mode change 100755 => 100644 app-cli/built/utils/__tests__/validationsHandler.test.js mode change 100755 => 100644 app-cli/built/utils/constants.js mode change 100755 => 100644 app-cli/built/utils/fileHelper.js mode change 100755 => 100644 app-cli/built/utils/loginHelpers.js mode change 100755 => 100644 app-cli/built/utils/machineUtils.js mode change 100755 => 100644 app-cli/built/utils/messageHandler.js mode change 100755 => 100644 app-cli/built/utils/validationsHandler.js diff --git a/app-cli/built/api/DeployApi.js b/app-cli/built/api/DeployApi.js old mode 100755 new mode 100644 diff --git a/app-cli/built/api/LoginApi.js b/app-cli/built/api/LoginApi.js old mode 100755 new mode 100644 diff --git a/app-cli/built/api/MainApi.js b/app-cli/built/api/MainApi.js old mode 100755 new mode 100644 diff --git a/app-cli/built/api/SystemApi.js b/app-cli/built/api/SystemApi.js old mode 100755 new mode 100644 diff --git a/app-cli/built/commands/captainduckduck.js b/app-cli/built/commands/captainduckduck.js old mode 100755 new mode 100644 diff --git a/app-cli/built/commands/deploy.js b/app-cli/built/commands/deploy.js old mode 100755 new mode 100644 diff --git a/app-cli/built/commands/list.js b/app-cli/built/commands/list.js old mode 100755 new mode 100644 diff --git a/app-cli/built/commands/login.js b/app-cli/built/commands/login.js old mode 100755 new mode 100644 diff --git a/app-cli/built/commands/logout.js b/app-cli/built/commands/logout.js old mode 100755 new mode 100644 diff --git a/app-cli/built/commands/serversetup.js b/app-cli/built/commands/serversetup.js old mode 100755 new mode 100644 diff --git a/app-cli/built/helpers/MachineHelper.js b/app-cli/built/helpers/MachineHelper.js old mode 100755 new mode 100644 diff --git a/app-cli/built/helpers/SpinnerHelper.js b/app-cli/built/helpers/SpinnerHelper.js old mode 100755 new mode 100644 diff --git a/app-cli/built/utils/__tests__/loginHelpers.test.js b/app-cli/built/utils/__tests__/loginHelpers.test.js old mode 100755 new mode 100644 diff --git a/app-cli/built/utils/__tests__/machineUtils.test.js b/app-cli/built/utils/__tests__/machineUtils.test.js old mode 100755 new mode 100644 diff --git a/app-cli/built/utils/__tests__/validationsHandler.test.js b/app-cli/built/utils/__tests__/validationsHandler.test.js old mode 100755 new mode 100644 diff --git a/app-cli/built/utils/constants.js b/app-cli/built/utils/constants.js old mode 100755 new mode 100644 diff --git a/app-cli/built/utils/fileHelper.js b/app-cli/built/utils/fileHelper.js old mode 100755 new mode 100644 diff --git a/app-cli/built/utils/loginHelpers.js b/app-cli/built/utils/loginHelpers.js old mode 100755 new mode 100644 diff --git a/app-cli/built/utils/machineUtils.js b/app-cli/built/utils/machineUtils.js old mode 100755 new mode 100644 diff --git a/app-cli/built/utils/messageHandler.js b/app-cli/built/utils/messageHandler.js old mode 100755 new mode 100644 diff --git a/app-cli/built/utils/validationsHandler.js b/app-cli/built/utils/validationsHandler.js old mode 100755 new mode 100644 diff --git a/app-cli/package.json b/app-cli/package.json index 5d9208e..f978722 100644 --- a/app-cli/package.json +++ b/app-cli/package.json @@ -5,7 +5,7 @@ "main": "captainduckduck.js", "scripts": { "test": "jest", - "build": "npx tsc" + "build": "rm -rf ./built && npx tsc" }, "bin": { "captainduckduck": "./built/commands/captainduckduck.js", From 28b7d8e2d0111c650e1dc22fe86697afa19b860f Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Thu, 3 Jan 2019 23:30:34 -0800 Subject: [PATCH 31/44] Made files executable --- app-cli/built/api/DeployApi.js | 0 app-cli/built/api/DeployApi.js.map | 0 app-cli/built/api/LoginApi.js | 0 app-cli/built/api/LoginApi.js.map | 0 app-cli/built/api/MainApi.js | 0 app-cli/built/api/MainApi.js.map | 0 app-cli/built/api/SystemApi.js | 0 app-cli/built/api/SystemApi.js.map | 0 app-cli/built/commands/captainduckduck.js | 0 app-cli/built/commands/captainduckduck.js.map | 0 app-cli/built/commands/deploy.js | 0 app-cli/built/commands/deploy.js.map | 0 app-cli/built/commands/list.js | 0 app-cli/built/commands/list.js.map | 0 app-cli/built/commands/login.js | 0 app-cli/built/commands/login.js.map | 0 app-cli/built/commands/logout.js | 0 app-cli/built/commands/logout.js.map | 0 app-cli/built/commands/serversetup.js | 0 app-cli/built/commands/serversetup.js.map | 0 app-cli/built/helpers/MachineHelper.js | 0 app-cli/built/helpers/MachineHelper.js.map | 0 app-cli/built/helpers/SpinnerHelper.js | 0 app-cli/built/helpers/SpinnerHelper.js.map | 0 app-cli/built/models/IModels.js | 0 app-cli/built/models/IModels.js.map | 0 app-cli/built/utils/__tests__/loginHelpers.test.js | 0 app-cli/built/utils/__tests__/loginHelpers.test.js.map | 0 app-cli/built/utils/__tests__/machineUtils.test.js | 0 app-cli/built/utils/__tests__/machineUtils.test.js.map | 0 app-cli/built/utils/__tests__/validationsHandler.test.js | 0 app-cli/built/utils/__tests__/validationsHandler.test.js.map | 0 app-cli/built/utils/constants.js | 0 app-cli/built/utils/constants.js.map | 0 app-cli/built/utils/fileHelper.js | 0 app-cli/built/utils/fileHelper.js.map | 0 app-cli/built/utils/loginHelpers.js | 0 app-cli/built/utils/loginHelpers.js.map | 0 app-cli/built/utils/machineUtils.js | 0 app-cli/built/utils/machineUtils.js.map | 0 app-cli/built/utils/messageHandler.js | 0 app-cli/built/utils/messageHandler.js.map | 0 app-cli/built/utils/validationsHandler.js | 0 app-cli/built/utils/validationsHandler.js.map | 0 app-cli/package.json | 2 +- 45 files changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 app-cli/built/api/DeployApi.js mode change 100644 => 100755 app-cli/built/api/DeployApi.js.map mode change 100644 => 100755 app-cli/built/api/LoginApi.js mode change 100644 => 100755 app-cli/built/api/LoginApi.js.map mode change 100644 => 100755 app-cli/built/api/MainApi.js mode change 100644 => 100755 app-cli/built/api/MainApi.js.map mode change 100644 => 100755 app-cli/built/api/SystemApi.js mode change 100644 => 100755 app-cli/built/api/SystemApi.js.map mode change 100644 => 100755 app-cli/built/commands/captainduckduck.js mode change 100644 => 100755 app-cli/built/commands/captainduckduck.js.map mode change 100644 => 100755 app-cli/built/commands/deploy.js mode change 100644 => 100755 app-cli/built/commands/deploy.js.map mode change 100644 => 100755 app-cli/built/commands/list.js mode change 100644 => 100755 app-cli/built/commands/list.js.map mode change 100644 => 100755 app-cli/built/commands/login.js mode change 100644 => 100755 app-cli/built/commands/login.js.map mode change 100644 => 100755 app-cli/built/commands/logout.js mode change 100644 => 100755 app-cli/built/commands/logout.js.map mode change 100644 => 100755 app-cli/built/commands/serversetup.js mode change 100644 => 100755 app-cli/built/commands/serversetup.js.map mode change 100644 => 100755 app-cli/built/helpers/MachineHelper.js mode change 100644 => 100755 app-cli/built/helpers/MachineHelper.js.map mode change 100644 => 100755 app-cli/built/helpers/SpinnerHelper.js mode change 100644 => 100755 app-cli/built/helpers/SpinnerHelper.js.map mode change 100644 => 100755 app-cli/built/models/IModels.js mode change 100644 => 100755 app-cli/built/models/IModels.js.map mode change 100644 => 100755 app-cli/built/utils/__tests__/loginHelpers.test.js mode change 100644 => 100755 app-cli/built/utils/__tests__/loginHelpers.test.js.map mode change 100644 => 100755 app-cli/built/utils/__tests__/machineUtils.test.js mode change 100644 => 100755 app-cli/built/utils/__tests__/machineUtils.test.js.map mode change 100644 => 100755 app-cli/built/utils/__tests__/validationsHandler.test.js mode change 100644 => 100755 app-cli/built/utils/__tests__/validationsHandler.test.js.map mode change 100644 => 100755 app-cli/built/utils/constants.js mode change 100644 => 100755 app-cli/built/utils/constants.js.map mode change 100644 => 100755 app-cli/built/utils/fileHelper.js mode change 100644 => 100755 app-cli/built/utils/fileHelper.js.map mode change 100644 => 100755 app-cli/built/utils/loginHelpers.js mode change 100644 => 100755 app-cli/built/utils/loginHelpers.js.map mode change 100644 => 100755 app-cli/built/utils/machineUtils.js mode change 100644 => 100755 app-cli/built/utils/machineUtils.js.map mode change 100644 => 100755 app-cli/built/utils/messageHandler.js mode change 100644 => 100755 app-cli/built/utils/messageHandler.js.map mode change 100644 => 100755 app-cli/built/utils/validationsHandler.js mode change 100644 => 100755 app-cli/built/utils/validationsHandler.js.map diff --git a/app-cli/built/api/DeployApi.js b/app-cli/built/api/DeployApi.js old mode 100644 new mode 100755 diff --git a/app-cli/built/api/DeployApi.js.map b/app-cli/built/api/DeployApi.js.map old mode 100644 new mode 100755 diff --git a/app-cli/built/api/LoginApi.js b/app-cli/built/api/LoginApi.js old mode 100644 new mode 100755 diff --git a/app-cli/built/api/LoginApi.js.map b/app-cli/built/api/LoginApi.js.map old mode 100644 new mode 100755 diff --git a/app-cli/built/api/MainApi.js b/app-cli/built/api/MainApi.js old mode 100644 new mode 100755 diff --git a/app-cli/built/api/MainApi.js.map b/app-cli/built/api/MainApi.js.map old mode 100644 new mode 100755 diff --git a/app-cli/built/api/SystemApi.js b/app-cli/built/api/SystemApi.js old mode 100644 new mode 100755 diff --git a/app-cli/built/api/SystemApi.js.map b/app-cli/built/api/SystemApi.js.map old mode 100644 new mode 100755 diff --git a/app-cli/built/commands/captainduckduck.js b/app-cli/built/commands/captainduckduck.js old mode 100644 new mode 100755 diff --git a/app-cli/built/commands/captainduckduck.js.map b/app-cli/built/commands/captainduckduck.js.map old mode 100644 new mode 100755 diff --git a/app-cli/built/commands/deploy.js b/app-cli/built/commands/deploy.js old mode 100644 new mode 100755 diff --git a/app-cli/built/commands/deploy.js.map b/app-cli/built/commands/deploy.js.map old mode 100644 new mode 100755 diff --git a/app-cli/built/commands/list.js b/app-cli/built/commands/list.js old mode 100644 new mode 100755 diff --git a/app-cli/built/commands/list.js.map b/app-cli/built/commands/list.js.map old mode 100644 new mode 100755 diff --git a/app-cli/built/commands/login.js b/app-cli/built/commands/login.js old mode 100644 new mode 100755 diff --git a/app-cli/built/commands/login.js.map b/app-cli/built/commands/login.js.map old mode 100644 new mode 100755 diff --git a/app-cli/built/commands/logout.js b/app-cli/built/commands/logout.js old mode 100644 new mode 100755 diff --git a/app-cli/built/commands/logout.js.map b/app-cli/built/commands/logout.js.map old mode 100644 new mode 100755 diff --git a/app-cli/built/commands/serversetup.js b/app-cli/built/commands/serversetup.js old mode 100644 new mode 100755 diff --git a/app-cli/built/commands/serversetup.js.map b/app-cli/built/commands/serversetup.js.map old mode 100644 new mode 100755 diff --git a/app-cli/built/helpers/MachineHelper.js b/app-cli/built/helpers/MachineHelper.js old mode 100644 new mode 100755 diff --git a/app-cli/built/helpers/MachineHelper.js.map b/app-cli/built/helpers/MachineHelper.js.map old mode 100644 new mode 100755 diff --git a/app-cli/built/helpers/SpinnerHelper.js b/app-cli/built/helpers/SpinnerHelper.js old mode 100644 new mode 100755 diff --git a/app-cli/built/helpers/SpinnerHelper.js.map b/app-cli/built/helpers/SpinnerHelper.js.map old mode 100644 new mode 100755 diff --git a/app-cli/built/models/IModels.js b/app-cli/built/models/IModels.js old mode 100644 new mode 100755 diff --git a/app-cli/built/models/IModels.js.map b/app-cli/built/models/IModels.js.map old mode 100644 new mode 100755 diff --git a/app-cli/built/utils/__tests__/loginHelpers.test.js b/app-cli/built/utils/__tests__/loginHelpers.test.js old mode 100644 new mode 100755 diff --git a/app-cli/built/utils/__tests__/loginHelpers.test.js.map b/app-cli/built/utils/__tests__/loginHelpers.test.js.map old mode 100644 new mode 100755 diff --git a/app-cli/built/utils/__tests__/machineUtils.test.js b/app-cli/built/utils/__tests__/machineUtils.test.js old mode 100644 new mode 100755 diff --git a/app-cli/built/utils/__tests__/machineUtils.test.js.map b/app-cli/built/utils/__tests__/machineUtils.test.js.map old mode 100644 new mode 100755 diff --git a/app-cli/built/utils/__tests__/validationsHandler.test.js b/app-cli/built/utils/__tests__/validationsHandler.test.js old mode 100644 new mode 100755 diff --git a/app-cli/built/utils/__tests__/validationsHandler.test.js.map b/app-cli/built/utils/__tests__/validationsHandler.test.js.map old mode 100644 new mode 100755 diff --git a/app-cli/built/utils/constants.js b/app-cli/built/utils/constants.js old mode 100644 new mode 100755 diff --git a/app-cli/built/utils/constants.js.map b/app-cli/built/utils/constants.js.map old mode 100644 new mode 100755 diff --git a/app-cli/built/utils/fileHelper.js b/app-cli/built/utils/fileHelper.js old mode 100644 new mode 100755 diff --git a/app-cli/built/utils/fileHelper.js.map b/app-cli/built/utils/fileHelper.js.map old mode 100644 new mode 100755 diff --git a/app-cli/built/utils/loginHelpers.js b/app-cli/built/utils/loginHelpers.js old mode 100644 new mode 100755 diff --git a/app-cli/built/utils/loginHelpers.js.map b/app-cli/built/utils/loginHelpers.js.map old mode 100644 new mode 100755 diff --git a/app-cli/built/utils/machineUtils.js b/app-cli/built/utils/machineUtils.js old mode 100644 new mode 100755 diff --git a/app-cli/built/utils/machineUtils.js.map b/app-cli/built/utils/machineUtils.js.map old mode 100644 new mode 100755 diff --git a/app-cli/built/utils/messageHandler.js b/app-cli/built/utils/messageHandler.js old mode 100644 new mode 100755 diff --git a/app-cli/built/utils/messageHandler.js.map b/app-cli/built/utils/messageHandler.js.map old mode 100644 new mode 100755 diff --git a/app-cli/built/utils/validationsHandler.js b/app-cli/built/utils/validationsHandler.js old mode 100644 new mode 100755 diff --git a/app-cli/built/utils/validationsHandler.js.map b/app-cli/built/utils/validationsHandler.js.map old mode 100644 new mode 100755 diff --git a/app-cli/package.json b/app-cli/package.json index f978722..4390862 100644 --- a/app-cli/package.json +++ b/app-cli/package.json @@ -5,7 +5,7 @@ "main": "captainduckduck.js", "scripts": { "test": "jest", - "build": "rm -rf ./built && npx tsc" + "build": "rm -rf ./built && npx tsc && chmod +x ./built -R" }, "bin": { "captainduckduck": "./built/commands/captainduckduck.js", From 8f63c31c9fa263f889df9b0fed116a611279905c Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Thu, 3 Jan 2019 23:48:38 -0800 Subject: [PATCH 32/44] commands converted to ts --- app-cli/built/commands/captainduckduck.js | 61 ++--- app-cli/built/commands/captainduckduck.js.map | 2 +- app-cli/built/commands/deploy.js | 84 +++--- app-cli/built/commands/deploy.js.map | 2 +- app-cli/built/commands/list.js | 19 +- app-cli/built/commands/list.js.map | 2 +- app-cli/built/commands/login.js | 80 +++--- app-cli/built/commands/login.js.map | 2 +- app-cli/built/commands/logout.js | 25 +- app-cli/built/commands/logout.js.map | 2 +- app-cli/built/commands/serversetup.js | 103 ++++---- app-cli/built/commands/serversetup.js.map | 2 +- app-cli/built/helpers/MachineHelper.js | 6 +- app-cli/built/helpers/MachineHelper.js.map | 2 +- app-cli/built/utils/fileHelper.js | 1 - app-cli/built/utils/fileHelper.js.map | 2 +- app-cli/built/utils/loginHelpers.js | 7 +- app-cli/built/utils/loginHelpers.js.map | 2 +- app-cli/built/utils/machineUtils.js | 1 - app-cli/built/utils/machineUtils.js.map | 2 +- app-cli/built/utils/validationsHandler.js | 14 +- app-cli/built/utils/validationsHandler.js.map | 2 +- app-cli/src/commands/captainduckduck.js | 87 ------- app-cli/src/commands/captainduckduck.ts | 67 +++++ app-cli/src/commands/deploy.js | 216 ---------------- app-cli/src/commands/deploy.ts | 200 +++++++++++++++ app-cli/src/commands/list.js | 26 -- app-cli/src/commands/list.ts | 22 ++ app-cli/src/commands/login.js | 158 ------------ app-cli/src/commands/login.ts | 145 +++++++++++ app-cli/src/commands/logout.js | 42 --- app-cli/src/commands/logout.ts | 42 +++ app-cli/src/commands/serversetup.js | 241 ------------------ app-cli/src/commands/serversetup.ts | 218 ++++++++++++++++ app-cli/src/helpers/MachineHelper.ts | 8 +- app-cli/src/utils/fileHelper.ts | 3 +- app-cli/src/utils/loginHelpers.ts | 9 +- app-cli/src/utils/machineUtils.ts | 2 +- app-cli/src/utils/validationsHandler.ts | 18 +- 39 files changed, 924 insertions(+), 1003 deletions(-) delete mode 100755 app-cli/src/commands/captainduckduck.js create mode 100755 app-cli/src/commands/captainduckduck.ts delete mode 100644 app-cli/src/commands/deploy.js create mode 100644 app-cli/src/commands/deploy.ts delete mode 100644 app-cli/src/commands/list.js create mode 100644 app-cli/src/commands/list.ts delete mode 100644 app-cli/src/commands/login.js create mode 100644 app-cli/src/commands/login.ts delete mode 100644 app-cli/src/commands/logout.js create mode 100644 app-cli/src/commands/logout.ts delete mode 100644 app-cli/src/commands/serversetup.js create mode 100644 app-cli/src/commands/serversetup.ts diff --git a/app-cli/built/commands/captainduckduck.js b/app-cli/built/commands/captainduckduck.js index 8191e16..ec2b943 100755 --- a/app-cli/built/commands/captainduckduck.js +++ b/app-cli/built/commands/captainduckduck.js @@ -1,59 +1,54 @@ #!/usr/bin/env node -const { printError } = require("../utils/messageHandler"); -const packagejson = require("../../package.json"); -const updateNotifier = require("update-notifier"); -const program = require("commander"); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const logout = require("./logout"); +const { printError } = require('../utils/messageHandler'); +const packagejson = require('../../package.json'); +const updateNotifier = require('update-notifier'); +const program = require('commander'); updateNotifier({ pkg: packagejson }).notify({ isGlobal: true }); // Command actions -const serversetup = require("./serversetup"); -const { login } = require("./login"); -const logout = require("./logout"); -const list = require("./list"); -const deploy = require("./deploy"); +const serversetup = require('./serversetup'); +const { login } = require('./login'); +const list = require('./list'); +const deploy = require('./deploy'); // Setup program.version(packagejson.version).description(packagejson.description); // Commands program - .command("serversetup") - .description("Performs necessary actions and prepares your Captain server.") + .command('serversetup') + .description('Performs necessary actions and prepares your Captain server.') .action(() => { serversetup(); }); program - .command("login") - .description("Login to a CaptainDuckDuck machine. You can be logged in to multiple machines simultaneously.") + .command('login') + .description('Login to a CaptainDuckDuck machine. You can be logged in to multiple machines simultaneously.') .action(() => { login(); }); -program - .command("logout") - .description("Logout from a specific Captain machine.") - .action(() => { +program.command('logout').description('Logout from a specific Captain machine.').action(() => { logout(); }); -program - .command("list") - .alias("ls") - .description("List all Captain machines currently logged in.") - .action(() => { +program.command('list').alias('ls').description('List all Captain machines currently logged in.').action(() => { list(); }); program - .command("deploy") + .command('deploy') .description("Deploy your app (current directory) to a specific Captain machine. You'll be prompted to choose your Captain machine.") - .option("-t, --tarFile ", "Specify file to be uploaded (rather than using git archive)") - .option("-d, --default", "Run with default options") - .option("-s, --stateless", "Run deploy stateless") - .option("-h, --host ", "Only for stateless mode: Host of the captain machine") - .option("-a, --appName ", "Only for stateless mode: Name of the app") - .option("-p, --pass ", "Only for stateless mode: Password for Captain") - .option("-b, --branch ", "Only for stateless mode: Branch name (default master)") - .action(options => { + .option('-t, --tarFile ', 'Specify file to be uploaded (rather than using git archive)') + .option('-d, --default', 'Run with default options') + .option('-s, --stateless', 'Run deploy stateless') + .option('-h, --host ', 'Only for stateless mode: Host of the captain machine') + .option('-a, --appName ', 'Only for stateless mode: Name of the app') + .option('-p, --pass ', 'Only for stateless mode: Password for Captain') + .option('-b, --branch ', 'Only for stateless mode: Branch name (default master)') + .action((options) => { deploy(options); }); // Error on unknown commands -program.on("command:*", () => { - const wrongCommands = program.args.join(" "); +program.on('command:*', () => { + const wrongCommands = program.args.join(' '); printError(`\nInvalid command: ${wrongCommands}\nSee --help for a list of available commands.`, true); }); program.parse(process.argv); diff --git a/app-cli/built/commands/captainduckduck.js.map b/app-cli/built/commands/captainduckduck.js.map index 4989592..d55a2d8 100755 --- a/app-cli/built/commands/captainduckduck.js.map +++ b/app-cli/built/commands/captainduckduck.js.map @@ -1 +1 @@ -{"version":3,"file":"captainduckduck.js","sourceRoot":"","sources":["../../src/commands/captainduckduck.js"],"names":[],"mappings":";AAEA,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAA;AACzD,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA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AC,GAAG,EAAE;IACX,IAAI,EAAE,CAAA;AACR,CAAC,CAAC,CAAA;AAEJ,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CACV,uHAAuH,CACxH;KACA,MAAM,CACL,uBAAuB,EACvB,6DAA6D,CAC9D;KACA,MAAM,CAAC,eAAe,EAAE,0BAA0B,CAAC;KACnD,MAAM,CAAC,iBAAiB,EAAE,sBAAsB,CAAC;KACjD,MAAM,CACL,oBAAoB,EACpB,sDAAsD,CACvD;KACA,MAAM,CAAC,uBAAuB,EAAE,0CAA0C,CAAC;KAC3E,MAAM,CAAC,oBAAoB,EAAE,+CAA+C,CAAC;KAC7E,MAAM,CACL,sBAAsB,EACtB,uDAAuD,CACxD;KACA,MAAM,CAAC,OAAO,CAAC,EAAE;IAChB,MAAM,CAAC,OAAO,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA;AAEJ,4BAA4B;AAC5B,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;IAC3B,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAE5C,UAAU,CACR,sBAAsB,aAAa,gDAAgD,EACnF,IAAI,CACL,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"captainduckduck.js","sourceRoot":"","sources":["../../src/commands/captainduckduck.ts"],"names":[],"mappings":";;;AAEA,mCAAoC;AAEpC,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAC1D,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAClD,MAAM,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAClD,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAErC,cAAc,CAAC,EAAE,GAAG,EAAE,WA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,eAAe,EAAE,0BAA0B,CAAC;KACnD,MAAM,CAAC,iBAAiB,EAAE,sBAAsB,CAAC;KACjD,MAAM,CAAC,oBAAoB,EAAE,sDAAsD,CAAC;KACpF,MAAM,CAAC,uBAAuB,EAAE,0CAA0C,CAAC;KAC3E,MAAM,CAAC,oBAAoB,EAAE,+CAA+C,CAAC;KAC7E,MAAM,CAAC,sBAAsB,EAAE,uDAAuD,CAAC;KACvF,MAAM,CAAC,CAAC,OAAY,EAAE,EAAE;IACxB,MAAM,CAAC,OAAO,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC;AAEJ,4BAA4B;AAC5B,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;IAC5B,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE7C,UAAU,CAAC,sBAAsB,aAAa,gDAAgD,EAAE,IAAI,CAAC,CAAC;AACvG,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/deploy.js b/app-cli/built/commands/deploy.js index 5b57bb6..4574360 100755 --- a/app-cli/built/commands/deploy.js +++ b/app-cli/built/commands/deploy.js @@ -1,4 +1,5 @@ #!/usr/bin/env node +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } @@ -7,18 +8,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -const MachineHelper = require("../helpers/MachineHelper"); -const DeployApi = require("../api/DeployApi"); -const LoginApi = require("../api/LoginApi"); -const { printError, printMessage } = require("../utils/messageHandler"); -const { validateIsGitRepository, validateDefinitionFile, optionIsNotGiven, validateAuthentication } = require("../utils/validationsHandler"); -const { uploadFile } = require("../utils/fileHelper"); -const { gitArchiveFile } = require("../utils/fileHelper"); -const fs = require("fs-extra"); -const path = require("path"); -const inquirer = require("inquirer"); -const commandExistsSync = require("command-exists").sync; -const { initMachineFromLocalStorage } = require("../utils/machineUtils"); +Object.defineProperty(exports, "__esModule", { value: true }); +const MachineHelper_1 = require("../helpers/MachineHelper"); +const inquirer = require('inquirer'); +const DeployApi = require('../api/DeployApi'); +const LoginApi = require('../api/LoginApi'); +const { printError, printMessage } = require('../utils/messageHandler'); +const { validateIsGitRepository, validateDefinitionFile, optionIsNotGiven, validateAuthentication } = require('../utils/validationsHandler'); +const { uploadFile } = require('../utils/fileHelper'); +const { gitArchiveFile } = require('../utils/fileHelper'); +const fs = require('fs-extra'); +const path = require('path'); +const commandExistsSync = require('command-exists').sync; +const { initMachineFromLocalStorage } = require('../utils/machineUtils'); function deployAsDefaultValues() { return __awaiter(this, void 0, void 0, function* () { try { @@ -26,13 +28,13 @@ function deployAsDefaultValues() { if (isValidAuthentication) { const { appName, branchToPush, machineToDeploy } = DeployApi; if (!appName || !branchToPush || !machineToDeploy) { - printError("Default deploy failed. There are no default options selected.", true); + printError('Default deploy failed. There are no default options selected.', true); } printMessage(`Deploying to ${machineToDeploy.name}`); deployFromGitProject(); } else { - printError("Incorrect login details", true); + printError('Incorrect login details', true); } } catch (e) { @@ -51,14 +53,14 @@ function deployAsStateless(host, appName, branch, pass) { const data = JSON.parse(response); const newToken = data.token; // Update the token to the machine that corresponds (if needed) - MachineHelper.updateMachineAuthToken(name, newToken); + MachineHelper_1.default.updateMachineAuthToken(name, newToken); if (data) { printMessage(`Starting stateless deploy to\n${host}\n${branch}\n${appName}`); deployFromGitProject(); } } else { - printError("You are missing parameters for deploying on stateless. "); + printError('You are missing parameters for deploying on stateless. '); } }); } @@ -69,11 +71,11 @@ function deployFromTarFile(tarFile) { if (isValidAuthentication) { // Send from tar file const filePath = tarFile; - const gitHash = "sendviatarfile"; + const gitHash = 'sendviatarfile'; yield uploadFile(filePath, gitHash); } else { - printError("Incorrect login details", true); + printError('Incorrect login details', true); } } catch (e) { @@ -82,11 +84,11 @@ function deployFromTarFile(tarFile) { }); } function deployFromGitProject() { - if (!commandExistsSync("git")) { + if (!commandExistsSync('git')) { printError("'git' command not found..."); printError("Captain needs 'git' to create tar file of your source files...", true); } - const zipFileNameToDeploy = "temporary-captain-to-deploy.tar"; + const zipFileNameToDeploy = 'temporary-captain-to-deploy.tar'; const zipFileFullPath = path.join(process.cwd(), zipFileNameToDeploy); printMessage(`Saving tar file to:\n${zipFileFullPath}\n`); // Removes the temporarly file created @@ -109,7 +111,7 @@ function deploy(options) { validateIsGitRepository(); validateDefinitionFile(); } - printMessage("Preparing deployment to Captain...\n"); + printMessage('Preparing deployment to Captain...\n'); if (options.default) { deployAsDefaultValues(); } @@ -122,38 +124,38 @@ function deploy(options) { else { const questions = [ { - type: "list", - name: "captainNameToDeploy", - default: DeployApi.machineToDeploy.name || "", - message: "Select the Captain Machine you want to deploy to:", - choices: MachineHelper.getMachinesAsOptions(), - when: () => optionIsNotGiven(options, "host") + type: 'list', + name: 'captainNameToDeploy', + default: DeployApi.machineToDeploy.name || '', + message: 'Select the Captain Machine you want to deploy to:', + choices: MachineHelper_1.default.getMachinesAsOptions(), + when: () => optionIsNotGiven(options, 'host') }, { - type: "input", - default: DeployApi.branchToPush || "master", - name: "branchToPush", + type: 'input', + default: DeployApi.branchToPush || 'master', + name: 'branchToPush', message: "Enter the 'git' branch you would like to deploy:", - when: () => optionIsNotGiven(options, "branch") + when: () => optionIsNotGiven(options, 'branch') }, { - type: "input", + type: 'input', default: DeployApi.appName, - name: "appName", - message: "Enter the Captain app name this directory will be deployed to:", - when: () => optionIsNotGiven(options, "appName") + name: 'appName', + message: 'Enter the Captain app name this directory will be deployed to:', + when: () => optionIsNotGiven(options, 'appName') }, { - type: "confirm", - name: "confirmedToDeploy", - message: "Note that uncommitted files and files in gitignore (if any) will not be pushed to server. Please confirm so that deployment process can start.", + type: 'confirm', + name: 'confirmedToDeploy', + message: 'Note that uncommitted files and files in gitignore (if any) will not be pushed to server. Please confirm so that deployment process can start.', default: true, - when: () => optionIsNotGiven(options, "stateless") + when: () => optionIsNotGiven(options, 'stateless') } ]; const answers = yield inquirer.prompt(questions); if (!answers.confirmedToDeploy && !options.stateless) { - printMessage("\nOperation cancelled by the user...\n"); + printMessage('\nOperation cancelled by the user...\n'); process.exit(0); } const captainNameToDeploy = answers.captainNameToDeploy; @@ -171,7 +173,7 @@ function deploy(options) { deployFromGitProject(); } else { - printError("Incorrect login details", true); + printError('Incorrect login details', true); } } catch (e) { diff --git a/app-cli/built/commands/deploy.js.map b/app-cli/built/commands/deploy.js.map index ca1b4f7..36aca3e 100755 --- a/app-cli/built/commands/deploy.js.map +++ b/app-cli/built/commands/deploy.js.map @@ -1 +1 @@ -{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/commands/deploy.js"],"names":[],"mappings":";;;;;;;;;AAEA,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACzD,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAC7C,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;AAC3C,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAA;AACvE,MAAM,EACJ,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACvB,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAA;AAC1C,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AACrD,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AACzD,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAC9B,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,MAAM,QAAQ,GAAG,OAAO,C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C,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;iBAC5B;aACD;SACD;IACF,CAAC;CAAA;AAED,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/list.js b/app-cli/built/commands/list.js index c78e2ae..ea9639c 100755 --- a/app-cli/built/commands/list.js +++ b/app-cli/built/commands/list.js @@ -1,19 +1,18 @@ #!/usr/bin/env node -const chalk = require("chalk"); -const MachineHelper = require("../helpers/MachineHelper"); -const { printMessage } = require("../utils/messageHandler"); +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const chalk = require('chalk'); +const MachineHelper_1 = require("../helpers/MachineHelper"); +const { printMessage } = require('../utils/messageHandler'); function _displayMachine(machine) { - console.log(">> " + - chalk.greenBright(machine.name) + - " at " + - chalk.cyan(machine.baseUrl)); + console.log('>> ' + chalk.greenBright(machine.name) + ' at ' + chalk.cyan(machine.baseUrl)); } function list() { - printMessage("\nLogged in Captain Machines:\n"); - MachineHelper.machines.map(machine => { + printMessage('\nLogged in Captain Machines:\n'); + MachineHelper_1.default.getMachines().map((machine) => { _displayMachine(machine); }); - printMessage(""); + printMessage(''); } module.exports = list; //# sourceMappingURL=list.js.map \ No newline at end of file diff --git a/app-cli/built/commands/list.js.map b/app-cli/built/commands/list.js.map index 9b2415a..0e6f965 100755 --- a/app-cli/built/commands/list.js.map +++ b/app-cli/built/commands/list.js.map @@ -1 +1 @@ -{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.js"],"names":[],"mappings":";AAEA,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;AAC9B,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACzD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAA;AAE3D,SAAS,eAAe,CAAC,OAAO;IAC9B,OAAO,CAAC,GAAG,CACT,KAAK;QACH,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC;QAC/B,MAAM;QACN,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAC9B,CAAA;AACH,CAAC;AAED,SAAS,IAAI;IACX,YAAY,CAAC,iCAAiC,CAAC,CAAA;IAE/C,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;QACnC,eAAe,CAAC,OAAO,CAAC,CAAA;IAC1B,CAAC,CAAC,CAAA;IAEF,YAAY,CAAC,EAAE,CAAC,CAAA;AAClB,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,CAAA"} \ No newline at end of file +{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":";;;AAEA,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/B,4DAAqD;AAErD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAE5D,SAAS,eAAe,CAAC,OAAiB;IACzC,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7F,CAAC;AAED,SAAS,IAAI;IACZ,YAAY,CAAC,iCAAiC,CAAC,CAAC;IAEhD,uBAAa,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QAC3C,eAAe,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,YAAY,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/login.js b/app-cli/built/commands/login.js index 6b01fe0..5856751 100755 --- a/app-cli/built/commands/login.js +++ b/app-cli/built/commands/login.js @@ -1,4 +1,5 @@ #!/usr/bin/env node +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } @@ -7,28 +8,29 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -const MachineHelper = require("../helpers/MachineHelper"); -const { printMessage, printGreenMessage, printError } = require("../utils/messageHandler"); -const inquirer = require("inquirer"); -const DeployApi = require("../api/DeployApi"); -const { cleanUpUrl, findDefaultCaptainName } = require("../utils/loginHelpers"); -const { SAMPLE_DOMAIN } = require("../utils/constants"); -const LoginApi = require("../api/LoginApi"); +Object.defineProperty(exports, "__esModule", { value: true }); +const MachineHelper_1 = require("../helpers/MachineHelper"); +const { printMessage, printGreenMessage, printError } = require('../utils/messageHandler'); +const inquirer = require('inquirer'); +const DeployApi = require('../api/DeployApi'); +const { cleanUpUrl, findDefaultCaptainName } = require('../utils/loginHelpers'); +const { SAMPLE_DOMAIN } = require('../utils/constants'); +const LoginApi = require('../api/LoginApi'); // In case the token is expired function requestLogin() { return __awaiter(this, void 0, void 0, function* () { const { baseUrl, name } = DeployApi.machineToDeploy; - printMessage("Your auth token is not valid anymore. Try to login again."); + printMessage('Your auth token is not valid anymore. Try to login again.'); const questions = [ { - type: "password", - name: "captainPassword", - message: "Please enter your password for " + baseUrl, - validate: function (value) { + type: 'password', + name: 'captainPassword', + message: 'Please enter your password for ' + baseUrl, + validate: (value) => { if (value && value.trim()) { return true; } - return "Please enter your password for " + baseUrl; + return 'Please enter your password for ' + baseUrl; } } ]; @@ -40,26 +42,26 @@ function requestLogin() { if (!newToken) return false; // Update the token to the machine that corresponds - MachineHelper.updateMachineAuthToken(name, newToken); + MachineHelper_1.default.updateMachineAuthToken(name, newToken); return true; }); } function login() { return __awaiter(this, void 0, void 0, function* () { - printMessage("Login to a Captain Machine"); + printMessage('Login to a Captain Machine'); const questions = [ { - type: "input", + type: 'input', default: SAMPLE_DOMAIN, - name: "captainAddress", - message: "\nEnter address of the Captain machine. \nIt is captain.[your-captain-root-domain] :", - validate: value => { + name: 'captainAddress', + message: '\nEnter address of the Captain machine. \nIt is captain.[your-captain-root-domain] :', + validate: (value) => { if (value === SAMPLE_DOMAIN) { - return "Enter a valid URL"; + return 'Enter a valid URL'; } if (!cleanUpUrl(value)) - return "This is an invalid URL: " + value; - MachineHelper.machines.map(machine => { + return 'This is an invalid URL: ' + value; + MachineHelper_1.default.getMachines().map((machine) => { if (cleanUpUrl(machine.baseUrl) === cleanUpUrl(value)) { return `${value} already exist as ${machine.name}. If you want to replace the existing entry, you have to first use command, and then re-login.`; } @@ -67,33 +69,33 @@ function login() { if (value && value.trim()) { return true; } - return "Please enter a valid address."; + return 'Please enter a valid address.'; } }, { - type: "confirm", - name: "captainHasRootSsl", - message: "Is HTTPS activated for this Captain machine?", + type: 'confirm', + name: 'captainHasRootSsl', + message: 'Is HTTPS activated for this Captain machine?', default: true }, { - type: "password", - name: "captainPassword", - message: "Enter your password:", - validate: value => { + type: 'password', + name: 'captainPassword', + message: 'Enter your password:', + validate: (value) => { if (value && value.trim()) { return true; } - return "Please enter your password."; + return 'Please enter your password.'; } }, { - type: "input", - name: "captainName", - message: "Enter a name for this Captain machine:", + type: 'input', + name: 'captainName', + message: 'Enter a name for this Captain machine:', default: findDefaultCaptainName(), - validate: value => { - MachineHelper.machines.map(machine => { + validate: (value) => { + MachineHelper_1.default.getMachines().map((machine) => { if (machine.name === value) { return `${value} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.`; } @@ -101,13 +103,13 @@ function login() { if (value.match(/^[-\d\w]+$/i)) { return true; } - return "Please enter a Captain Name."; + return 'Please enter a Captain Name.'; } } ]; const answers = yield inquirer.prompt(questions); const { captainHasRootSsl, captainPassword, captainAddress, captainName } = answers; - const handleHttp = captainHasRootSsl ? "https://" : "http://"; + const handleHttp = captainHasRootSsl ? 'https://' : 'http://'; const baseUrl = `${handleHttp}${cleanUpUrl(captainAddress)}`; try { const data = yield LoginApi.loginMachine(baseUrl, captainPassword); @@ -121,7 +123,7 @@ function login() { baseUrl, name: captainName }; - MachineHelper.addMachine(newMachine); + MachineHelper_1.default.addMachine(newMachine); printGreenMessage(`Logged in successfully to ${baseUrl}`); printGreenMessage(`Authorization token is now saved as ${captainName} \n`); } diff --git a/app-cli/built/commands/login.js.map b/app-cli/built/commands/login.js.map index f1a7868..73dc2ca 100755 --- a/app-cli/built/commands/login.js.map +++ b/app-cli/built/commands/login.js.map @@ -1 +1 @@ -{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.js"],"names":[],"mappings":";;;;;;;;;AAEA,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACzD,MAAM,EACJ,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACX,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAA;AACtC,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AACpC,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAC7C,MAAM,EAAE,UAAU,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AAC/E,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AACvD,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;AAE3C,+BAA+B;AAC/B,SAAe,YAAY;;QACzB,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC,eAAe,CAAA;QAEnD,YAAY,CAAC,2DAA2D,CAAC,CAAA;QAEzE,MAAM,SAAS,GAAG;YAChB;gBACE,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,iBAAiB;gBACvB,OAAO,EAAE,iCAAiC,GAAG,OAAO;gBACpD,QAAQ,EAAE,UAAS,KAAK;oBACtB,IAAI,KAAK,IAAI,KA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AC;YAEF,uBAAa,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;YAErC,iBAAiB,CAAC,6BAA6B,OAAO,EAAE,CAAC,CAAC;YAE1D,iBAAiB,CAAC,uCAAuC,WAAW,KAAK,CAAC,CAAC;SAC3E;QAAC,OAAO,KAAK,EAAE;YACf,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;YAE3D,UAAU,CAAC,wCAAwC,WAAW,OAAO,YAAY,EAAE,CAAC,CAAC;SACrF;IACF,CAAC;CAAA;AAED,MAAM,CAAC,OAAO,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/logout.js b/app-cli/built/commands/logout.js index 7d8b72d..2693deb 100755 --- a/app-cli/built/commands/logout.js +++ b/app-cli/built/commands/logout.js @@ -1,4 +1,5 @@ #!/usr/bin/env node +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } @@ -7,35 +8,35 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -const MachineHelper = require("../helpers/MachineHelper"); -const { printMessage } = require("../utils/messageHandler"); -const inquirer = require("inquirer"); +const MachineHelper = require('../helpers/MachineHelper'); +const { printMessage } = require('../utils/messageHandler'); +const inquirer = require('inquirer'); function generateQuestions() { const listOfMachines = MachineHelper.getMachinesAsOptions(); return [ { - type: "list", - name: "captainNameToLogout", - message: "Select the Captain Machine you want to logout from:", + type: 'list', + name: 'captainNameToLogout', + message: 'Select the Captain Machine you want to logout from:', choices: listOfMachines }, { - type: "confirm", - name: "confirmedToLogout", - message: "Are you sure you want to logout from this Captain machine?", + type: 'confirm', + name: 'confirmedToLogout', + message: 'Are you sure you want to logout from this Captain machine?', default: false, - when: answers => answers.captainNameToLogout + when: (answers) => answers.captainNameToLogout } ]; } function logout() { return __awaiter(this, void 0, void 0, function* () { const questions = generateQuestions(); - printMessage("Logout from a Captain Machine and clear auth info"); + printMessage('Logout from a Captain Machine and clear auth info'); const answers = yield inquirer.prompt(questions); const { captainNameToLogout } = answers; if (!captainNameToLogout) { - printMessage("\nOperation cancelled by the user...\n", true); + printMessage('\nOperation cancelled by the user...\n', true); } MachineHelper.logoutMachine(captainNameToLogout); }); diff --git a/app-cli/built/commands/logout.js.map b/app-cli/built/commands/logout.js.map index 976e792..26dfc25 100755 --- a/app-cli/built/commands/logout.js.map +++ b/app-cli/built/commands/logout.js.map @@ -1 +1 @@ -{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../src/commands/logout.js"],"names":[],"mappings":";;;;;;;;;AAEA,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACzD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAA;AAC3D,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAEpC,SAAS,iBAAiB;IACxB,MAAM,cAAc,GAAG,aAAa,CAAC,oBAAoB,EAAE,CAAA;IAE3D,OAAO;QACL;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,qBAAqB;YAC3B,OAAO,EAAE,qDAAqD;YAC9D,OAAO,EAAE,cAAc;SACxB;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,4DAA4D;YACrE,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,mBAAmB;SAC7C;KACF,CAAA;AACH,CAAC;AAED,SAAe,MAAM;;QACnB,MAAM,SAAS,GAAG,iBAAiB,EAAE,CAAA;QAErC,YAAY,CAAC,mDAAmD,CAAC,CAAA;QAEjE,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;QAChD,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAA;QAEvC,IAAI,CAAC,mBAAmB,EAAE;YACxB,YAAY,CAAC,wCAAwC,EAAE,IAAI,CAAC,CAAA;SAC7D;QAED,aAAa,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAA;IAClD,CAAC;CAAA;AAED,MAAM,CAAC,OAAO,GAAG,MAAM,CAAA"} \ No newline at end of file +{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../src/commands/logout.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAC1D,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAC5D,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAErC,SAAS,iBAAiB;IACzB,MAAM,cAAc,GAAG,aAAa,CAAC,oBAAoB,EAAE,CAAC;IAE5D,OAAO;QACN;YACC,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,qBAAqB;YAC3B,OAAO,EAAE,qDAAqD;YAC9D,OAAO,EAAE,cAAc;SACvB;QACD;YACC,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,4DAA4D;YACrE,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,CAAC,OAAY,EAAE,EAAE,CAAC,OAAO,CAAC,mBAAmB;SACnD;KACD,CAAC;AACH,CAAC;AAED,SAAe,MAAM;;QACpB,MAAM,SAAS,GAAG,iBAAiB,EAAE,CAAC;QAEtC,YAAY,CAAC,mDAAmD,CAAC,CAAC;QAElE,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACjD,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC;QAExC,IAAI,CAAC,mBAAmB,EAAE;YACzB,YAAY,CAAC,wCAAwC,EAAE,IAAI,CAAC,CAAC;SAC7D;QAED,aAAa,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC;IAClD,CAAC;CAAA;AAED,iBAAS,MAAM,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/serversetup.js b/app-cli/built/commands/serversetup.js index 8cc26a0..6e9e3a2 100755 --- a/app-cli/built/commands/serversetup.js +++ b/app-cli/built/commands/serversetup.js @@ -1,4 +1,5 @@ #!/usr/bin/env node +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } @@ -7,39 +8,39 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -const MachineHelper = require("../helpers/MachineHelper"); -const SystemApi = require("../api/SystemApi"); -const LoginApi = require("../api/LoginApi"); -const inquirer = require("inquirer"); -const { findDefaultCaptainName } = require("../utils/loginHelpers"); -const { isIpAddress } = require("../utils/validationsHandler"); -const { SAMPLE_IP, DEFAULT_PASSWORD } = require("../utils/constants"); -const { printMessage, printError, printMessageAndExit, errorHandler } = require("../utils/messageHandler"); +const validationsHandler_1 = require("../utils/validationsHandler"); +const SystemApi = require('../api/SystemApi'); +const LoginApi = require('../api/LoginApi'); +const inquirer = require('inquirer'); +const { findDefaultCaptainName } = require('../utils/loginHelpers'); +const { SAMPLE_IP, DEFAULT_PASSWORD } = require('../utils/constants'); +const { printMessage, printError, printMessageAndExit, errorHandler } = require('../utils/messageHandler'); +const MachineHelper_1 = require("../helpers/MachineHelper"); let newPasswordFirstTry = undefined; const questions = [ { - type: "list", - name: "hasInstalledCaptain", - message: "Have you already installed Captain on your server by running the following line:" + - "\nmkdir /captain && docker run -p 80:80 -p 443:443 -p 3000:3000 -v /var/run/docker.sock:/var/run/docker.sock dockersaturn/captainduckduck ?", - default: "Yes", - choices: ["Yes", "No"], - filter: value => { + type: 'list', + name: 'hasInstalledCaptain', + message: 'Have you already installed Captain on your server by running the following line:' + + '\nmkdir /captain && docker run -p 80:80 -p 443:443 -p 3000:3000 -v /var/run/docker.sock:/var/run/docker.sock dockersaturn/captainduckduck ?', + default: 'Yes', + choices: ['Yes', 'No'], + filter: (value) => { const answerFromUser = value.trim(); - if (answerFromUser === "Yes") + if (answerFromUser === 'Yes') return answerFromUser; - printMessage("\n\nCannot start the setup process if Captain is not installed."); - printMessageAndExit("Please read tutorial on CaptainDuckDuck.com to learn how to install CaptainDuckDuck on a server."); + printMessage('\n\nCannot start the setup process if Captain is not installed.'); + printMessageAndExit('Please read tutorial on CaptainDuckDuck.com to learn how to install CaptainDuckDuck on a server.'); } }, { - type: "input", + type: 'input', default: SAMPLE_IP, - name: "captainAddress", - message: "Enter IP address of your captain server:", + name: 'captainAddress', + message: 'Enter IP address of your captain server:', filter: (value) => __awaiter(this, void 0, void 0, function* () { const ipFromUser = value.trim(); - if (ipFromUser === SAMPLE_IP || !isIpAddress(ipFromUser)) { + if (ipFromUser === SAMPLE_IP || !validationsHandler_1.isIpAddress(ipFromUser)) { printError(`\nThis is an invalid IP Address: ${ipFromUser}`, true); } try { @@ -56,9 +57,9 @@ const questions = [ }) }, { - type: "password", - name: "captainOriginalPassword", - message: "Enter your current password:", + type: 'password', + name: 'captainOriginalPassword', + message: 'Enter your current password:', when: () => !LoginApi.token, filter: (value) => __awaiter(this, void 0, void 0, function* () { try { @@ -75,11 +76,11 @@ const questions = [ }) }, { - type: "input", - name: "captainRootDomain", - message: "Enter a root domain for this Captain server. For example, enter test.yourdomain.com if you" + - " setup your DNS to point *.test.yourdomain.com to ip address of your server" + - ": ", + type: 'input', + name: 'captainRootDomain', + message: 'Enter a root domain for this Captain server. For example, enter test.yourdomain.com if you' + + ' setup your DNS to point *.test.yourdomain.com to ip address of your server' + + ': ', filter: (value) => __awaiter(this, void 0, void 0, function* () { try { const captainRootDomainFromUser = value.trim(); @@ -96,8 +97,8 @@ const questions = [ }) }, { - type: "input", - name: "emailAddress", + type: 'input', + name: 'emailAddress', message: "Enter your 'valid' email address to enable HTTPS: ", filter: (value) => __awaiter(this, void 0, void 0, function* () { try { @@ -114,25 +115,25 @@ const questions = [ }) }, { - type: "password", - name: "newPasswordFirstTry", - message: "Enter a new password:", - filter: value => { + type: 'password', + name: 'newPasswordFirstTry', + message: 'Enter a new password:', + filter: (value) => { newPasswordFirstTry = value; return value; } }, { - type: "password", - name: "newPassword", - message: "Enter a new password:", + type: 'password', + name: 'newPassword', + message: 'Enter a new password:', filter: (value) => __awaiter(this, void 0, void 0, function* () { const { customDomainFromUser } = SystemApi; try { const confirmPasswordValueFromUser = value; const machineUrl = `https://${customDomainFromUser}`; if (newPasswordFirstTry !== confirmPasswordValueFromUser) { - printError("Passwords do not match", true); + printError('Passwords do not match', true); } const changePassData = yield LoginApi.changePass(machineUrl, confirmPasswordValueFromUser); if (changePassData) { @@ -142,32 +143,32 @@ const questions = [ } } catch (e) { - printError("\nIMPORTANT!! Server setup is completed by password is not changed."); - printError("\nYou CANNOT use serversetup anymore. To continue:"); + printError('\nIMPORTANT!! Server setup is completed by password is not changed.'); + printError('\nYou CANNOT use serversetup anymore. To continue:'); printError(`\n- Go to https://${customDomainFromUser} login with default password and change the password in settings.`); printError(`\n- In terminal (here), type captainduckduck login and enter this as your root domain: ${customDomainFromUser}`, true); } }) }, { - type: "input", - name: "captainName", - message: "Enter a name for this Captain machine:", + type: 'input', + name: 'captainName', + message: 'Enter a name for this Captain machine:', default: findDefaultCaptainName(), - validate: value => { + validate: (value) => { const newMachineName = value.trim(); - MachineHelper.machines.map(machine => machine.name === newMachineName && + MachineHelper_1.default.getMachines().map((machine) => machine.name === newMachineName && `${newMachineName} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.`); if (value.match(/^[-\d\w]+$/i)) { return true; } - return "Please enter a Captain Name."; + return 'Please enter a Captain Name.'; } } ]; function serversetup() { return __awaiter(this, void 0, void 0, function* () { - printMessage("\nSetup your Captain server\n"); + printMessage('\nSetup your Captain server\n'); const answers = yield inquirer.prompt(questions); const captainAddress = `https://${SystemApi.customDomainFromUser}`; const newMachine = { @@ -175,9 +176,9 @@ function serversetup() { baseUrl: captainAddress, name: answers.captainName }; - MachineHelper.addMachine(newMachine); + MachineHelper_1.default.addMachine(newMachine); printMessage(`\n\nCaptain is available at ${captainAddress}`); - printMessage("\nFor more details and docs see http://www.captainduckduck.com\n\n"); + printMessage('\nFor more details and docs see http://www.captainduckduck.com\n\n'); }); } module.exports = serversetup; diff --git a/app-cli/built/commands/serversetup.js.map b/app-cli/built/commands/serversetup.js.map index 91d6e11..4f526c7 100755 --- a/app-cli/built/commands/serversetup.js.map +++ b/app-cli/built/commands/serversetup.js.map @@ -1 +1 @@ -{"version":3,"file":"serversetup.js","sourceRoot":"","sources":["../../src/commands/serversetup.js"],"names":[],"mappings":";;;;;;;;;AAEA,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACzD,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;AAC7C,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;AAC3C,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AACpC,MAAM,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AACnE,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAA;AAC9D,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AACrE,MAAM,EACJ,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,YAAY,EACb,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAA;AACtC,IAAI,mBAAmB,GAAG,SAAS,CAAA;AACnC,MAAM,SAAS,GAAG;IAChB;QACE,IAAI,EAAE,MAAM;QACZ,IAAI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AoD,CAAC,CAAA;gBAEhE,UAAU,CACR,qBAAqB,oBAAoB,mEAAmE,CAC7G,CAAA;gBAED,UAAU,CACR,0FAA0F,oBAAoB,EAAE,EAChH,IAAI,CACL,CAAA;aACF;QACH,CAAC,CAAA;KACF;IACD;QACE,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,wCAAwC;QACjD,OAAO,EAAE,sBAAsB,EAAE;QACjC,QAAQ,EAAE,KAAK,CAAC,EAAE;YAChB,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;YAEnC,aAAa,CAAC,QAAQ,CAAC,GAAG,CACxB,OAAO,CAAC,EAAE,CACR,OAAO,CAAC,IAAI,KAAK,cAAc;gBAC/B,GAAG,cAAc,uHAAuH,CAC3I,CAAA;YAED,IAAI,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE;gBAC9B,OAAO,IAAI,CAAA;aACZ;YAED,OAAO,8BAA8B,CAAA;QACvC,CAAC;KACF;CACF,CAAA;AAED,SAAe,WAAW;;QACxB,YAAY,CAAC,+BAA+B,CAAC,CAAA;QAE7C,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;QAChD,MAAM,cAAc,GAAG,WAAW,SAAS,CAAC,oBAAoB,EAAE,CAAA;QAClE,MAAM,UAAU,GAAG;YACjB,SAAS,EAAE,QAAQ,CAAC,KAAK;YACzB,OAAO,EAAE,cAAc;YACvB,IAAI,EAAE,OAAO,CAAC,WAAW;SAC1B,CAAA;QAED,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC,CAAA;QAEpC,YAAY,CAAC,+BAA+B,cAAc,EAAE,CAAC,CAAA;QAE7D,YAAY,CACV,oEAAoE,CACrE,CAAA;IACH,CAAC;CAAA;AAED,MAAM,CAAC,OAAO,GAAG,WAAW,CAAA"} \ No newline at end of file +{"version":3,"file":"serversetup.js","sourceRoot":"","sources":["../../src/commands/serversetup.ts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AAC;aACZ;YAED,OAAO,8BAA8B,CAAC;QACvC,CAAC;KACD;CACD,CAAC;AAEF,SAAe,WAAW;;QACzB,YAAY,CAAC,+BAA+B,CAAC,CAAC;QAE9C,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACjD,MAAM,cAAc,GAAG,WAAW,SAAS,CAAC,oBAAoB,EAAE,CAAC;QACnE,MAAM,UAAU,GAAG;YAClB,SAAS,EAAE,QAAQ,CAAC,KAAK;YACzB,OAAO,EAAE,cAAc;YACvB,IAAI,EAAE,OAAO,CAAC,WAAW;SACzB,CAAC;QAEF,uBAAa,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAErC,YAAY,CAAC,+BAA+B,cAAc,EAAE,CAAC,CAAC;QAE9D,YAAY,CAAC,oEAAoE,CAAC,CAAC;IACpF,CAAC;CAAA;AAED,iBAAS,WAAW,CAAC"} \ No newline at end of file diff --git a/app-cli/built/helpers/MachineHelper.js b/app-cli/built/helpers/MachineHelper.js index 94afcbe..89b2ff3 100755 --- a/app-cli/built/helpers/MachineHelper.js +++ b/app-cli/built/helpers/MachineHelper.js @@ -28,6 +28,9 @@ class MachineHelper { }); return [...firstItemInOption, ...listOfMachines]; } + getMachines() { + return this.machines; + } setMachines(newMachines) { this.machines = newMachines; configs.set('captainMachines', newMachines); @@ -73,5 +76,6 @@ class MachineHelper { printMessage(`You are now logged out from ${removedMachine.name} at ${removedMachine.baseUrl}...\n`); } } -module.exports = new MachineHelper(); +const instance = new MachineHelper(); +exports.default = instance; //# sourceMappingURL=MachineHelper.js.map \ No newline at end of file diff --git a/app-cli/built/helpers/MachineHelper.js.map b/app-cli/built/helpers/MachineHelper.js.map index 69f8f40..789e74b 100755 --- a/app-cli/built/helpers/MachineHelper.js.map +++ b/app-cli/built/helpers/MachineHelper.js.map @@ -1 +1 @@ -{"version":3,"file":"MachineHelper.js","sourceRoot":"","sources":["../../src/helpers/MachineHelper.ts"],"names":[],"m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li/built/utils/fileHelper.js +++ b/app-cli/built/utils/fileHelper.js @@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -Object.defineProperty(exports, "__esModule", { value: true }); const { printMessage, printError, printGreenMessage, printMagentaMessage } = require('./messageHandler'); const SpinnerHelper = require('../helpers/SpinnerHelper'); const child_process_1 = require("child_process"); diff --git a/app-cli/built/utils/fileHelper.js.map b/app-cli/built/utils/fileHelper.js.map index 44dc849..216292f 100755 --- a/app-cli/built/utils/fileHelper.js.map +++ b/app-cli/built/utils/fileHelper.js.map @@ -1 +1 @@ -{"version":3,"file":"fileHelper.js","sourceRoot":"","sources":["../../src/utils/fileHelper.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AACzG,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAC1D,iDAAqC;AACrC,+BAA+B;AAC/B,MAAM,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACxC,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC9C,MAAM,EAAE,yBAAyB,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AACvE,IAAI,qBAAqB,GAAG,CAAC,KAAK,CAAC,CAAC,2CAA2C;AAW/E,SAAS,cAAc,CAAC,eAAuB,EAAE,YAAoB;IACpE,oBAAI,CAAC,sCAAsC,eAAe,KAAK,YAAY,EAAE,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;QACtG,IAAI,GAAG,EAAE;YACR,UAAU,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;YAExC,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;YAE/B,OAAO;SACP;QAED,oB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AAG,CAAC;YAClD,MAAM,sBAAsB,GAAG,IAAI,CAAC,MAAM,KAAK,GAAG,CAAC;YAEnD,IAAI,kBAAkB,EAAE;gBACvB,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;aAC/C;YAED,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB;YAE/C,4BAA4B;YAC5B,yBAAyB,EAAE,CAAC;YAE5B,IAAI,qBAAqB,EAAE;gBAC1B,sBAAsB,EAAE,CAAC;aACzB;YAED,IAAI,sBAAsB,EAAE;gBAC3B,iBAAiB,CAAC,0BAA0B,SAAS,CAAC,OAAO,IAAI,EAAE,IAAI,CAAC,CAAC;aACzE;SACD;QAAC,OAAO,CAAC,EAAE;YACX,UAAU,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;SAC5B;IACF,CAAC;CAAA;AAED,SAAS,kBAAkB,CAAC,QAAgB;IAC3C,IAAI,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;QAChC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;KACxB;AACF,CAAC;AACD,iBAAS;IACR,cAAc;IACd,aAAa;IACb,UAAU;IACV,sBAAsB;CACtB,CAAC"} \ No newline at end of file diff --git a/app-cli/built/utils/loginHelpers.js b/app-cli/built/utils/loginHelpers.js index 543693a..13a102e 100755 --- a/app-cli/built/utils/loginHelpers.js +++ b/app-cli/built/utils/loginHelpers.js @@ -1,6 +1,5 @@ "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const MachineHelper = require('../helpers/MachineHelper'); +const MachineHelper_1 = require("../helpers/MachineHelper"); function cleanUpUrl(url) { if (!url || !url.length) return null; @@ -13,7 +12,7 @@ function cleanUpUrl(url) { return cleanedUrl.replace('http://', '').replace('https://', '').trim(); } function findDefaultCaptainName() { - let currentSuffix = MachineHelper.machines.length + 1; + let currentSuffix = MachineHelper_1.default.getMachines().length + 1; while (!isSuffixValid(currentSuffix)) { currentSuffix++; } @@ -23,7 +22,7 @@ function getCaptainFullName(suffix) { const formatSuffix = suffix < 10 ? `0${suffix}` : suffix; return `captain-${formatSuffix}`; } -const isSuffixValid = (suffixNumber) => MachineHelper.machines.map((machine) => { +const isSuffixValid = (suffixNumber) => MachineHelper_1.default.getMachines().map((machine) => { machine.name !== getCaptainFullName(suffixNumber); }); module.exports = { diff --git a/app-cli/built/utils/loginHelpers.js.map b/app-cli/built/utils/loginHelpers.js.map index 11494f8..f624f74 100755 --- a/app-cli/built/utils/loginHelpers.js.map +++ b/app-cli/built/utils/loginHelpers.js.map @@ -1 +1 @@ -{"version":3,"file":"loginHelpers.js","sourceRoot":"","sources":["../../src/utils/loginHelpers.ts"],"names":[],"mappings":";;AAEA,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAE1D,SAAS,UAAU,CAAC,GAAW;IAC9B,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAErC,IAAI,UAAU,GAAG,GAAG,CAAC;IACrB,MAAM,gBAAgB,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC;IAE/D,IAAI,gBAAgB,EAAE;QACrB,8BAA8B;QAC9B,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;KAC3C;IAED,OAAO,UAAU,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AACzE,CAAC;AAED,SAAS,sBAAsB;IAC9B,IAAI,aAAa,GAAG,aAAa,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IAEtD,OAAO,CAAC,aAAa,CAA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E,CAAC;AAED,SAAS,sBAAsB;IAC9B,IAAI,aAAa,GAAG,uBAAa,CAAC,WAAW,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;IAE3D,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE;QACrC,aAAa,EAAE,CAAC;KAChB;IAED,OAAO,kBAAkB,CAAC,aAAa,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAc;IACzC,MAAM,YAAY,GAAG,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;IAEzD,OAAO,WAAW,YAAY,EAAE,CAAC;AAClC,CAAC;AAED,MAAM,aAAa,GAAG,CAAC,YAAoB,EAAE,EAAE,CAC9C,uBAAa,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,CAAC,OAAiB,EAAE,EAAE;IACrD,OAAO,CAAC,IAAI,KAAK,kBAAkB,CAAC,YAAY,CAAC,CAAC;AACnD,CAAC,CAAC,CAAC;AAEJ,iBAAS;IACR,UAAU;IACV,sBAAsB;IACtB,aAAa;IACb,kBAAkB;CAClB,CAAC"} \ No newline at end of file diff --git a/app-cli/built/utils/machineUtils.js b/app-cli/built/utils/machineUtils.js index 505bfcf..a955848 100755 --- a/app-cli/built/utils/machineUtils.js +++ b/app-cli/built/utils/machineUtils.js @@ -1,5 +1,4 @@ "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); const DeployApi = require('../api/DeployApi'); const MachineHelper = require('../helpers/MachineHelper'); function initMachineFromLocalStorage() { diff --git a/app-cli/built/utils/machineUtils.js.map b/app-cli/built/utils/machineUtils.js.map index 03de31e..906656f 100755 --- a/app-cli/built/utils/machineUtils.js.map +++ b/app-cli/built/utils/machineUtils.js.map @@ -1 +1 @@ -{"version":3,"file":"machineUtils.js","sourceRoot":"","sources":["../../src/utils/machineUtils.ts"],"names":[],"mappings":";;AAEA,MAAM,SAAS,GAAG,OAAO,CAAC,kB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,GAAG,CAAC,GAAG;gBACZ,OAAO,EAAE,SAAS,CAAC,OAAO;gBAC1B,YAAY,EAAE,SAAS,CAAC,YAAY;gBACpC,eAAe,EAAE,SAAS,CAAC,eAAe;aAC1C,CAAC;SACF;QAED,OAAO,GAAG,CAAC;IACZ,CAAC,CAAC,CAAC;IAEH,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAEnC,IAAI,CAAC,SAAS,EAAE;QACf,MAAM,MAAM,GAAG;YACd,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;YAClB,OAAO,EAAE,SAAS,CAAC,OAAO;YAC1B,YAAY,EAAE,SAAS,CAAC,YAAY;YACpC,eAAe,EAAE,SAAS,CAAC,eAAe;SAC1C,CAAC;QAEF,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAEzB,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KAC5B;AACF,CAAC;AAED,iBAAS;IACR,2BAA2B;IAC3B,yBAAyB;CACzB,CAAC"} \ No newline at end of file diff --git a/app-cli/built/utils/validationsHandler.js b/app-cli/built/utils/validationsHandler.js index 5080b7f..fc1bd61 100755 --- a/app-cli/built/utils/validationsHandler.js +++ b/app-cli/built/utils/validationsHandler.js @@ -1,3 +1,4 @@ +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } @@ -6,6 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; +Object.defineProperty(exports, "__esModule", { value: true }); const fs = require('fs-extra'); const DeployApi = require('../api/DeployApi'); const { printError } = require('./messageHandler'); @@ -17,6 +19,7 @@ function validateIsGitRepository() { printError('\n**** ERROR: You are not in a git root directory. This command will only deploys the current directory ****\n', true); } } +exports.validateIsGitRepository = validateIsGitRepository; function validateDefinitionFile() { const captainDefinitionExists = fs.pathExistsSync('./captain-definition'); if (!captainDefinitionExists) { @@ -42,6 +45,7 @@ function validateDefinitionFile() { } } } +exports.validateDefinitionFile = validateDefinitionFile; // Only show that question if there is no option given as argument function optionIsNotGiven(allOptions, option) { // console.log(allOptions) @@ -50,12 +54,14 @@ function optionIsNotGiven(allOptions, option) { } return true; } +exports.optionIsNotGiven = optionIsNotGiven; function isIpAddress(ipaddress) { if (/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(ipaddress)) { return true; } return false; } +exports.isIpAddress = isIpAddress; function validateAuthentication() { return __awaiter(this, void 0, void 0, function* () { // 1. Check if valid auth @@ -74,11 +80,5 @@ function validateAuthentication() { } }); } -module.exports = { - validateAuthentication, - validateIsGitRepository, - validateDefinitionFile, - isIpAddress, - optionIsNotGiven -}; +exports.validateAuthentication = validateAuthentication; //# sourceMappingURL=validationsHandler.js.map \ No newline at end of file diff --git a/app-cli/built/utils/validationsHandler.js.map b/app-cli/built/utils/validationsHandler.js.map index 6ce3cdb..d09000e 100755 --- a/app-cli/built/utils/validationsHandler.js.map +++ b/app-cli/built/utils/validationsHandler.js.map @@ -1 +1 @@ -{"version":3,"file":"validationsHandler.js","sourceRoot":"","sources":["../../src/utils/validationsHandler.ts"],"names":[],"mappings":";;;;;;;;AAAA,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAC/B,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC9C,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AACnD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AACtD,MAAM,EAAE,2BAA2B,EAAE,GAAG,OA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AAC;AACb,CAAC;AAED,SAAS,WAAW,CAAC,SAAiB;IACrC,IACC,kKAAkK,CAAC,IAAI,CACtK,SAAS,CACT,EACA;QACD,OAAO,IAAI,CAAC;KACZ;IAED,OAAO,KAAK,CAAC;AACd,CAAC;AAED,SAAe,sBAAsB;;QACpC,yBAAyB;QACzB,MAAM,eAAe,GAAG,MAAM,SAAS,CAAC,gBAAgB,EAAE,CAAC;QAE3D,mBAAmB;QACnB,WAAW;QACX,kBAAkB;QAClB,IAAI,CAAC,eAAe,EAAE;YACrB,MAAM,cAAc,GAAG,MAAM,YAAY,EAAE,CAAC;YAE5C,6BAA6B;YAC7B,2BAA2B,EAAE,CAAC;YAE9B,OAAO,cAAc,CAAC;SACtB;aAAM;YACN,OAAO,OAAO,CAAC,eAAe,CAAC,CAAC;SAChC;IACF,CAAC;CAAA;AAED,MAAM,CAAC,OAAO,GAAG;IAChB,sBAAsB;IACtB,uBAAuB;IACvB,sBAAsB;IACtB,WAAW;IACX,gBAAgB;CAChB,CAAC"} \ No newline at end of file +{"version":3,"file":"validationsHandler.js","sourceRoot":"","sources":["../../src/utils/validationsHandler.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAC/B,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC9C,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AACnD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AACtD,MAAM,EAAE,2BAA2B,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAEzE,SAAgB,uBAAuB;IACtC,MAAM,eAAe,GAAG,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAEpD,IAAI,CAAC,eAAe,EAAE;QACrB,UAAU,CACT,gHAAgH,EAChH,IAAI,CACJ,CAAC;KACF;AACF,C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AUC;AAED,SAAsB,sBAAsB;;QAC3C,yBAAyB;QACzB,MAAM,eAAe,GAAG,MAAM,SAAS,CAAC,gBAAgB,EAAE,CAAC;QAE3D,mBAAmB;QACnB,WAAW;QACX,kBAAkB;QAClB,IAAI,CAAC,eAAe,EAAE;YACrB,MAAM,cAAc,GAAG,MAAM,YAAY,EAAE,CAAC;YAE5C,6BAA6B;YAC7B,2BAA2B,EAAE,CAAC;YAE9B,OAAO,cAAc,CAAC;SACtB;aAAM;YACN,OAAO,OAAO,CAAC,eAAe,CAAC,CAAC;SAChC;IACF,CAAC;CAAA;AAjBD,wDAiBC"} \ No newline at end of file diff --git a/app-cli/src/commands/captainduckduck.js b/app-cli/src/commands/captainduckduck.js deleted file mode 100755 index c72825f..0000000 --- a/app-cli/src/commands/captainduckduck.js +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env node - -const { printError } = require("../utils/messageHandler") -const packagejson = require("../../package.json") -const updateNotifier = require("update-notifier") -const program = require("commander") - -updateNotifier({ pkg: packagejson }).notify({ isGlobal: true }) - -// Command actions -const serversetup = require("./serversetup") -const { login } = require("./login") -const logout = require("./logout") -const list = require("./list") -const deploy = require("./deploy") - -// Setup -program.version(packagejson.version).description(packagejson.description) - -// Commands -program - .command("serversetup") - .description("Performs necessary actions and prepares your Captain server.") - .action(() => { - serversetup() - }) - -program - .command("login") - .description( - "Login to a CaptainDuckDuck machine. You can be logged in to multiple machines simultaneously." - ) - .action(() => { - login() - }) - -program - .command("logout") - .description("Logout from a specific Captain machine.") - .action(() => { - logout() - }) - -program - .command("list") - .alias("ls") - .description("List all Captain machines currently logged in.") - .action(() => { - list() - }) - -program - .command("deploy") - .description( - "Deploy your app (current directory) to a specific Captain machine. You'll be prompted to choose your Captain machine." - ) - .option( - "-t, --tarFile ", - "Specify file to be uploaded (rather than using git archive)" - ) - .option("-d, --default", "Run with default options") - .option("-s, --stateless", "Run deploy stateless") - .option( - "-h, --host ", - "Only for stateless mode: Host of the captain machine" - ) - .option("-a, --appName ", "Only for stateless mode: Name of the app") - .option("-p, --pass ", "Only for stateless mode: Password for Captain") - .option( - "-b, --branch ", - "Only for stateless mode: Branch name (default master)" - ) - .action(options => { - deploy(options) - }) - -// Error on unknown commands -program.on("command:*", () => { - const wrongCommands = program.args.join(" ") - - printError( - `\nInvalid command: ${wrongCommands}\nSee --help for a list of available commands.`, - true - ) -}) - -program.parse(process.argv) diff --git a/app-cli/src/commands/captainduckduck.ts b/app-cli/src/commands/captainduckduck.ts new file mode 100755 index 0000000..fb6dca0 --- /dev/null +++ b/app-cli/src/commands/captainduckduck.ts @@ -0,0 +1,67 @@ +#!/usr/bin/env node + +import logout = require("./logout"); + +const { printError } = require('../utils/messageHandler'); +const packagejson = require('../../package.json'); +const updateNotifier = require('update-notifier'); +const program = require('commander'); + +updateNotifier({ pkg: packagejson }).notify({ isGlobal: true }); + +// Command actions +const serversetup = require('./serversetup'); +const { login } = require('./login'); +const list = require('./list'); +const deploy = require('./deploy'); + +// Setup +program.version(packagejson.version).description(packagejson.description); + +// Commands +program + .command('serversetup') + .description('Performs necessary actions and prepares your Captain server.') + .action(() => { + serversetup(); + }); + +program + .command('login') + .description('Login to a CaptainDuckDuck machine. You can be logged in to multiple machines simultaneously.') + .action(() => { + login(); + }); + +program.command('logout').description('Logout from a specific Captain machine.').action(() => { + logout(); +}); + +program.command('list').alias('ls').description('List all Captain machines currently logged in.').action(() => { + list(); +}); + +program + .command('deploy') + .description( + "Deploy your app (current directory) to a specific Captain machine. You'll be prompted to choose your Captain machine." + ) + .option('-t, --tarFile ', 'Specify file to be uploaded (rather than using git archive)') + .option('-d, --default', 'Run with default options') + .option('-s, --stateless', 'Run deploy stateless') + .option('-h, --host ', 'Only for stateless mode: Host of the captain machine') + .option('-a, --appName ', 'Only for stateless mode: Name of the app') + .option('-p, --pass ', 'Only for stateless mode: Password for Captain') + .option('-b, --branch ', 'Only for stateless mode: Branch name (default master)') + .action((options: any) => { + deploy(options); + }); + +// Error on unknown commands +program.on('command:*', () => { + const wrongCommands = program.args.join(' '); + + printError(`\nInvalid command: ${wrongCommands}\nSee --help for a list of available commands.`, true); +}); + +program.parse(process.argv); diff --git a/app-cli/src/commands/deploy.js b/app-cli/src/commands/deploy.js deleted file mode 100644 index 971a855..0000000 --- a/app-cli/src/commands/deploy.js +++ /dev/null @@ -1,216 +0,0 @@ -#!/usr/bin/env node - -const MachineHelper = require("../helpers/MachineHelper") -const DeployApi = require("../api/DeployApi") -const LoginApi = require("../api/LoginApi") -const { printError, printMessage } = require("../utils/messageHandler") -const { - validateIsGitRepository, - validateDefinitionFile, - optionIsNotGiven, - validateAuthentication -} = require("../utils/validationsHandler") -const { uploadFile } = require("../utils/fileHelper") -const { gitArchiveFile } = require("../utils/fileHelper") -const fs = require("fs-extra") -const path = require("path") -const inquirer = require("inquirer") -const commandExistsSync = require("command-exists").sync -const { initMachineFromLocalStorage } = require("../utils/machineUtils") - -async function deployAsDefaultValues() { - try { - const isValidAuthentication = await validateAuthentication() - - if (isValidAuthentication) { - const { appName, branchToPush, machineToDeploy } = DeployApi - - if (!appName || !branchToPush || !machineToDeploy) { - printError( - "Default deploy failed. There are no default options selected.", - true - ) - } - - printMessage(`Deploying to ${machineToDeploy.name}`) - - deployFromGitProject() - } else { - printError("Incorrect login details", true) - } - } catch (e) { - printError(e.message, true) - } -} - -async function deployAsStateless(host, appName, branch, pass) { - const isStateless = host && appName && branch && pass - - if (isStateless) { - // login first - printMessage(`Trying to login to ${host}\n`) - - const { name } = DeployApi.machineToDeploy - const response = await LoginApi.loginMachine(host, pass) - const data = JSON.parse(response) - const newToken = data.token - - // Update the token to the machine that corresponds (if needed) - MachineHelper.updateMachineAuthToken(name, newToken) - - if (data) { - printMessage( - `Starting stateless deploy to\n${host}\n${branch}\n${appName}` - ) - - deployFromGitProject() - } - } else { - printError( - "You are missing parameters for deploying on stateless. " - ) - } -} - -async function deployFromTarFile(tarFile) { - try { - const isValidAuthentication = await validateAuthentication() - - if (isValidAuthentication) { - // Send from tar file - const filePath = tarFile - const gitHash = "sendviatarfile" - - await uploadFile(filePath, gitHash) - } else { - printError("Incorrect login details", true) - } - } catch (e) { - printError(e.message, true) - } -} - -function deployFromGitProject() { - if (!commandExistsSync("git")) { - printError("'git' command not found...") - - printError( - "Captain needs 'git' to create tar file of your source files...", - true - ) - } - - const zipFileNameToDeploy = "temporary-captain-to-deploy.tar" - const zipFileFullPath = path.join(process.cwd(), zipFileNameToDeploy) - - printMessage(`Saving tar file to:\n${zipFileFullPath}\n`) - - // Removes the temporarly file created - try { - const tempFileExists = fs.pathExistsSync(zipFileFullPath) - - if (tempFileExists) { - fs.removeSync(zipFileFullPath) - } - } catch (e) { - // IgnoreError - } - - gitArchiveFile(zipFileFullPath, DeployApi.branchToPush) -} - -async function deploy(options) { - // Reads local storage and sets the machine if found - initMachineFromLocalStorage() - - if (!options.tarFile || !options.stateless) { - validateIsGitRepository() - - validateDefinitionFile() - } - - printMessage("Preparing deployment to Captain...\n") - - if (options.default) { - deployAsDefaultValues() - } else if (options.stateless) { - deployAsStateless( - options.host, - options.appName, - options.branch, - options.pass - ) - } else if (options.tarFile) { - deployFromTarFile(options.tarFile) - } else { - const questions = [ - { - type: "list", - name: "captainNameToDeploy", - default: DeployApi.machineToDeploy.name || "", - message: "Select the Captain Machine you want to deploy to:", - choices: MachineHelper.getMachinesAsOptions(), - when: () => optionIsNotGiven(options, "host") - }, - { - type: "input", - default: DeployApi.branchToPush || "master", - name: "branchToPush", - message: "Enter the 'git' branch you would like to deploy:", - when: () => optionIsNotGiven(options, "branch") - }, - { - type: "input", - default: DeployApi.appName, - name: "appName", - message: - "Enter the Captain app name this directory will be deployed to:", - when: () => optionIsNotGiven(options, "appName") - }, - { - type: "confirm", - name: "confirmedToDeploy", - message: - "Note that uncommitted files and files in gitignore (if any) will not be pushed to server. Please confirm so that deployment process can start.", - default: true, - when: () => optionIsNotGiven(options, "stateless") - } - ] - const answers = await inquirer.prompt(questions) - - if (!answers.confirmedToDeploy && !options.stateless) { - printMessage("\nOperation cancelled by the user...\n") - - process.exit(0) - } - - const captainNameToDeploy = answers.captainNameToDeploy - const branchToPush = answers.branchToPush || options.branch - const appName = answers.appName || options.appName - - DeployApi.updateMachineToDeploy(captainNameToDeploy || options.host) - - DeployApi.setBranchToPush(branchToPush) - - DeployApi.setAppName(appName) - - printMessage(`Deploying to ${DeployApi.machineToDeploy.name}`) - - // Normal deploy - if (answers.confirmedToDeploy) { - try { - const isValidAuthentication = await validateAuthentication() - - if (isValidAuthentication) { - deployFromGitProject() - } else { - printError("Incorrect login details", true) - } - } catch (e) { - printError(e.message, true) - } - } - } -} - -module.exports = deploy diff --git a/app-cli/src/commands/deploy.ts b/app-cli/src/commands/deploy.ts new file mode 100644 index 0000000..0e5d9f7 --- /dev/null +++ b/app-cli/src/commands/deploy.ts @@ -0,0 +1,200 @@ +#!/usr/bin/env node + +import MachineHelper from '../helpers/MachineHelper'; +const inquirer = require('inquirer'); +const DeployApi = require('../api/DeployApi'); +const LoginApi = require('../api/LoginApi'); +const { printError, printMessage } = require('../utils/messageHandler'); +const { + validateIsGitRepository, + validateDefinitionFile, + optionIsNotGiven, + validateAuthentication +} = require('../utils/validationsHandler'); +const { uploadFile } = require('../utils/fileHelper'); +const { gitArchiveFile } = require('../utils/fileHelper'); +const fs = require('fs-extra'); +const path = require('path'); +const commandExistsSync = require('command-exists').sync; +const { initMachineFromLocalStorage } = require('../utils/machineUtils'); + +async function deployAsDefaultValues() { + try { + const isValidAuthentication = await validateAuthentication(); + + if (isValidAuthentication) { + const { appName, branchToPush, machineToDeploy } = DeployApi; + + if (!appName || !branchToPush || !machineToDeploy) { + printError('Default deploy failed. There are no default options selected.', true); + } + + printMessage(`Deploying to ${machineToDeploy.name}`); + + deployFromGitProject(); + } else { + printError('Incorrect login details', true); + } + } catch (e) { + printError(e.message, true); + } +} + +async function deployAsStateless(host: string, appName: string, branch: string, pass: string) { + const isStateless = host && appName && branch && pass; + + if (isStateless) { + // login first + printMessage(`Trying to login to ${host}\n`); + + const { name } = DeployApi.machineToDeploy; + const response = await LoginApi.loginMachine(host, pass); + const data = JSON.parse(response); + const newToken = data.token; + + // Update the token to the machine that corresponds (if needed) + MachineHelper.updateMachineAuthToken(name, newToken); + + if (data) { + printMessage(`Starting stateless deploy to\n${host}\n${branch}\n${appName}`); + + deployFromGitProject(); + } + } else { + printError('You are missing parameters for deploying on stateless. '); + } +} + +async function deployFromTarFile(tarFile: string) { + try { + const isValidAuthentication = await validateAuthentication(); + + if (isValidAuthentication) { + // Send from tar file + const filePath = tarFile; + const gitHash = 'sendviatarfile'; + + await uploadFile(filePath, gitHash); + } else { + printError('Incorrect login details', true); + } + } catch (e) { + printError(e.message, true); + } +} + +function deployFromGitProject() { + if (!commandExistsSync('git')) { + printError("'git' command not found..."); + + printError("Captain needs 'git' to create tar file of your source files...", true); + } + + const zipFileNameToDeploy = 'temporary-captain-to-deploy.tar'; + const zipFileFullPath = path.join(process.cwd(), zipFileNameToDeploy); + + printMessage(`Saving tar file to:\n${zipFileFullPath}\n`); + + // Removes the temporarly file created + try { + const tempFileExists = fs.pathExistsSync(zipFileFullPath); + + if (tempFileExists) { + fs.removeSync(zipFileFullPath); + } + } catch (e) { + // IgnoreError + } + + gitArchiveFile(zipFileFullPath, DeployApi.branchToPush); +} + +async function deploy(options: any) { + // Reads local storage and sets the machine if found + initMachineFromLocalStorage(); + + if (!options.tarFile || !options.stateless) { + validateIsGitRepository(); + + validateDefinitionFile(); + } + + printMessage('Preparing deployment to Captain...\n'); + + if (options.default) { + deployAsDefaultValues(); + } else if (options.stateless) { + deployAsStateless(options.host, options.appName, options.branch, options.pass); + } else if (options.tarFile) { + deployFromTarFile(options.tarFile); + } else { + const questions = [ + { + type: 'list', + name: 'captainNameToDeploy', + default: DeployApi.machineToDeploy.name || '', + message: 'Select the Captain Machine you want to deploy to:', + choices: MachineHelper.getMachinesAsOptions(), + when: () => optionIsNotGiven(options, 'host') + }, + { + type: 'input', + default: DeployApi.branchToPush || 'master', + name: 'branchToPush', + message: "Enter the 'git' branch you would like to deploy:", + when: () => optionIsNotGiven(options, 'branch') + }, + { + type: 'input', + default: DeployApi.appName, + name: 'appName', + message: 'Enter the Captain app name this directory will be deployed to:', + when: () => optionIsNotGiven(options, 'appName') + }, + { + type: 'confirm', + name: 'confirmedToDeploy', + message: + 'Note that uncommitted files and files in gitignore (if any) will not be pushed to server. Please confirm so that deployment process can start.', + default: true, + when: () => optionIsNotGiven(options, 'stateless') + } + ]; + const answers = await inquirer.prompt(questions); + + if (!answers.confirmedToDeploy && !options.stateless) { + printMessage('\nOperation cancelled by the user...\n'); + + process.exit(0); + } + + const captainNameToDeploy = answers.captainNameToDeploy; + const branchToPush = answers.branchToPush || options.branch; + const appName = answers.appName || options.appName; + + DeployApi.updateMachineToDeploy(captainNameToDeploy || options.host); + + DeployApi.setBranchToPush(branchToPush); + + DeployApi.setAppName(appName); + + printMessage(`Deploying to ${DeployApi.machineToDeploy.name}`); + + // Normal deploy + if (answers.confirmedToDeploy) { + try { + const isValidAuthentication = await validateAuthentication(); + + if (isValidAuthentication) { + deployFromGitProject(); + } else { + printError('Incorrect login details', true); + } + } catch (e) { + printError(e.message, true); + } + } + } +} + +export = deploy; diff --git a/app-cli/src/commands/list.js b/app-cli/src/commands/list.js deleted file mode 100644 index d0172df..0000000 --- a/app-cli/src/commands/list.js +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env node - -const chalk = require("chalk") -const MachineHelper = require("../helpers/MachineHelper") -const { printMessage } = require("../utils/messageHandler") - -function _displayMachine(machine) { - console.log( - ">> " + - chalk.greenBright(machine.name) + - " at " + - chalk.cyan(machine.baseUrl) - ) -} - -function list() { - printMessage("\nLogged in Captain Machines:\n") - - MachineHelper.machines.map(machine => { - _displayMachine(machine) - }) - - printMessage("") -} - -module.exports = list diff --git a/app-cli/src/commands/list.ts b/app-cli/src/commands/list.ts new file mode 100644 index 0000000..efeee5e --- /dev/null +++ b/app-cli/src/commands/list.ts @@ -0,0 +1,22 @@ +#!/usr/bin/env node + +const chalk = require('chalk'); +import MachineHelper from '../helpers/MachineHelper'; +import { IMachine } from '../models/IModels'; +const { printMessage } = require('../utils/messageHandler'); + +function _displayMachine(machine: IMachine) { + console.log('>> ' + chalk.greenBright(machine.name) + ' at ' + chalk.cyan(machine.baseUrl)); +} + +function list() { + printMessage('\nLogged in Captain Machines:\n'); + + MachineHelper.getMachines().map((machine) => { + _displayMachine(machine); + }); + + printMessage(''); +} + +export = list; diff --git a/app-cli/src/commands/login.js b/app-cli/src/commands/login.js deleted file mode 100644 index 1f4ef74..0000000 --- a/app-cli/src/commands/login.js +++ /dev/null @@ -1,158 +0,0 @@ -#!/usr/bin/env node - -const MachineHelper = require("../helpers/MachineHelper") -const { - printMessage, - printGreenMessage, - printError -} = require("../utils/messageHandler") -const inquirer = require("inquirer") -const DeployApi = require("../api/DeployApi") -const { cleanUpUrl, findDefaultCaptainName } = require("../utils/loginHelpers") -const { SAMPLE_DOMAIN } = require("../utils/constants") -const LoginApi = require("../api/LoginApi") - -// In case the token is expired -async function requestLogin() { - const { baseUrl, name } = DeployApi.machineToDeploy - - printMessage("Your auth token is not valid anymore. Try to login again.") - - const questions = [ - { - type: "password", - name: "captainPassword", - message: "Please enter your password for " + baseUrl, - validate: function(value) { - if (value && value.trim()) { - return true - } - - return "Please enter your password for " + baseUrl - } - } - ] - const loginPassword = await inquirer.prompt(questions) - const password = loginPassword.captainPassword - const response = await LoginApi.loginMachine(baseUrl, password) - const data = JSON.parse(response) - const newToken = data.token - - if (!newToken) return false - - // Update the token to the machine that corresponds - MachineHelper.updateMachineAuthToken(name, newToken) - - return true -} - -async function login() { - printMessage("Login to a Captain Machine") - - const questions = [ - { - type: "input", - default: SAMPLE_DOMAIN, - name: "captainAddress", - message: - "\nEnter address of the Captain machine. \nIt is captain.[your-captain-root-domain] :", - validate: value => { - if (value === SAMPLE_DOMAIN) { - return "Enter a valid URL" - } - - if (!cleanUpUrl(value)) return "This is an invalid URL: " + value - - MachineHelper.machines.map(machine => { - if (cleanUpUrl(machine.baseUrl) === cleanUpUrl(value)) { - return `${value} already exist as ${ - machine.name - }. If you want to replace the existing entry, you have to first use command, and then re-login.` - } - }) - - if (value && value.trim()) { - return true - } - - return "Please enter a valid address." - } - }, - { - type: "confirm", - name: "captainHasRootSsl", - message: "Is HTTPS activated for this Captain machine?", - default: true - }, - { - type: "password", - name: "captainPassword", - message: "Enter your password:", - validate: value => { - if (value && value.trim()) { - return true - } - - return "Please enter your password." - } - }, - { - type: "input", - name: "captainName", - message: "Enter a name for this Captain machine:", - default: findDefaultCaptainName(), - validate: value => { - MachineHelper.machines.map(machine => { - if (machine.name === value) { - return `${value} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.` - } - }) - - if (value.match(/^[-\d\w]+$/i)) { - return true - } - - return "Please enter a Captain Name." - } - } - ] - const answers = await inquirer.prompt(questions) - const { - captainHasRootSsl, - captainPassword, - captainAddress, - captainName - } = answers - const handleHttp = captainHasRootSsl ? "https://" : "http://" - const baseUrl = `${handleHttp}${cleanUpUrl(captainAddress)}` - - try { - const data = await LoginApi.loginMachine(baseUrl, captainPassword) - const response = JSON.parse(data) - - // TODO - This status should be 200 maybe? - if (response.status !== 100) { - throw new Error(JSON.stringify(response, null, 2)) - } - - const newMachine = { - authToken: response.token, - baseUrl, - name: captainName - } - - MachineHelper.addMachine(newMachine) - - printGreenMessage(`Logged in successfully to ${baseUrl}`) - - printGreenMessage(`Authorization token is now saved as ${captainName} \n`) - } catch (error) { - const errorMessage = error.message ? error.message : error - - printError( - `Something bad happened. Cannot save "${captainName}" \n${errorMessage}` - ) - } -} - -module.exports = { login, requestLogin } diff --git a/app-cli/src/commands/login.ts b/app-cli/src/commands/login.ts new file mode 100644 index 0000000..fb2b75b --- /dev/null +++ b/app-cli/src/commands/login.ts @@ -0,0 +1,145 @@ +#!/usr/bin/env node + +import MachineHelper from '../helpers/MachineHelper'; + +const { printMessage, printGreenMessage, printError } = require('../utils/messageHandler'); +const inquirer = require('inquirer'); +const DeployApi = require('../api/DeployApi'); +const { cleanUpUrl, findDefaultCaptainName } = require('../utils/loginHelpers'); +const { SAMPLE_DOMAIN } = require('../utils/constants'); +const LoginApi = require('../api/LoginApi'); + +// In case the token is expired +async function requestLogin() { + const { baseUrl, name } = DeployApi.machineToDeploy; + + printMessage('Your auth token is not valid anymore. Try to login again.'); + + const questions = [ + { + type: 'password', + name: 'captainPassword', + message: 'Please enter your password for ' + baseUrl, + validate: (value: string) => { + if (value && value.trim()) { + return true; + } + + return 'Please enter your password for ' + baseUrl; + } + } + ]; + const loginPassword = await inquirer.prompt(questions); + const password = loginPassword.captainPassword; + const response = await LoginApi.loginMachine(baseUrl, password); + const data = JSON.parse(response); + const newToken = data.token; + + if (!newToken) return false; + + // Update the token to the machine that corresponds + MachineHelper.updateMachineAuthToken(name, newToken); + + return true; +} + +async function login() { + printMessage('Login to a Captain Machine'); + + const questions = [ + { + type: 'input', + default: SAMPLE_DOMAIN, + name: 'captainAddress', + message: '\nEnter address of the Captain machine. \nIt is captain.[your-captain-root-domain] :', + validate: (value: string) => { + if (value === SAMPLE_DOMAIN) { + return 'Enter a valid URL'; + } + + if (!cleanUpUrl(value)) return 'This is an invalid URL: ' + value; + + MachineHelper.getMachines().map((machine) => { + if (cleanUpUrl(machine.baseUrl) === cleanUpUrl(value)) { + return `${value} already exist as ${machine.name}. If you want to replace the existing entry, you have to first use command, and then re-login.`; + } + }); + + if (value && value.trim()) { + return true; + } + + return 'Please enter a valid address.'; + } + }, + { + type: 'confirm', + name: 'captainHasRootSsl', + message: 'Is HTTPS activated for this Captain machine?', + default: true + }, + { + type: 'password', + name: 'captainPassword', + message: 'Enter your password:', + validate: (value: string) => { + if (value && value.trim()) { + return true; + } + + return 'Please enter your password.'; + } + }, + { + type: 'input', + name: 'captainName', + message: 'Enter a name for this Captain machine:', + default: findDefaultCaptainName(), + validate: (value: string) => { + MachineHelper.getMachines().map((machine) => { + if (machine.name === value) { + return `${value} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.`; + } + }); + + if (value.match(/^[-\d\w]+$/i)) { + return true; + } + + return 'Please enter a Captain Name.'; + } + } + ]; + const answers = await inquirer.prompt(questions); + const { captainHasRootSsl, captainPassword, captainAddress, captainName } = answers; + const handleHttp = captainHasRootSsl ? 'https://' : 'http://'; + const baseUrl = `${handleHttp}${cleanUpUrl(captainAddress)}`; + + try { + const data = await LoginApi.loginMachine(baseUrl, captainPassword); + const response = JSON.parse(data); + + // TODO - This status should be 200 maybe? + if (response.status !== 100) { + throw new Error(JSON.stringify(response, null, 2)); + } + + const newMachine = { + authToken: response.token, + baseUrl, + name: captainName + }; + + MachineHelper.addMachine(newMachine); + + printGreenMessage(`Logged in successfully to ${baseUrl}`); + + printGreenMessage(`Authorization token is now saved as ${captainName} \n`); + } catch (error) { + const errorMessage = error.message ? error.message : error; + + printError(`Something bad happened. Cannot save "${captainName}" \n${errorMessage}`); + } +} + +export = { login, requestLogin }; diff --git a/app-cli/src/commands/logout.js b/app-cli/src/commands/logout.js deleted file mode 100644 index ddcc401..0000000 --- a/app-cli/src/commands/logout.js +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env node - -const MachineHelper = require("../helpers/MachineHelper") -const { printMessage } = require("../utils/messageHandler") -const inquirer = require("inquirer") - -function generateQuestions() { - const listOfMachines = MachineHelper.getMachinesAsOptions() - - return [ - { - type: "list", - name: "captainNameToLogout", - message: "Select the Captain Machine you want to logout from:", - choices: listOfMachines - }, - { - type: "confirm", - name: "confirmedToLogout", - message: "Are you sure you want to logout from this Captain machine?", - default: false, - when: answers => answers.captainNameToLogout - } - ] -} - -async function logout() { - const questions = generateQuestions() - - printMessage("Logout from a Captain Machine and clear auth info") - - const answers = await inquirer.prompt(questions) - const { captainNameToLogout } = answers - - if (!captainNameToLogout) { - printMessage("\nOperation cancelled by the user...\n", true) - } - - MachineHelper.logoutMachine(captainNameToLogout) -} - -module.exports = logout diff --git a/app-cli/src/commands/logout.ts b/app-cli/src/commands/logout.ts new file mode 100644 index 0000000..27547a7 --- /dev/null +++ b/app-cli/src/commands/logout.ts @@ -0,0 +1,42 @@ +#!/usr/bin/env node + +const MachineHelper = require('../helpers/MachineHelper'); +const { printMessage } = require('../utils/messageHandler'); +const inquirer = require('inquirer'); + +function generateQuestions() { + const listOfMachines = MachineHelper.getMachinesAsOptions(); + + return [ + { + type: 'list', + name: 'captainNameToLogout', + message: 'Select the Captain Machine you want to logout from:', + choices: listOfMachines + }, + { + type: 'confirm', + name: 'confirmedToLogout', + message: 'Are you sure you want to logout from this Captain machine?', + default: false, + when: (answers: any) => answers.captainNameToLogout + } + ]; +} + +async function logout() { + const questions = generateQuestions(); + + printMessage('Logout from a Captain Machine and clear auth info'); + + const answers = await inquirer.prompt(questions); + const { captainNameToLogout } = answers; + + if (!captainNameToLogout) { + printMessage('\nOperation cancelled by the user...\n', true); + } + + MachineHelper.logoutMachine(captainNameToLogout); +} + +export = logout; diff --git a/app-cli/src/commands/serversetup.js b/app-cli/src/commands/serversetup.js deleted file mode 100644 index 7b9f753..0000000 --- a/app-cli/src/commands/serversetup.js +++ /dev/null @@ -1,241 +0,0 @@ -#!/usr/bin/env node - -const MachineHelper = require("../helpers/MachineHelper") -const SystemApi = require("../api/SystemApi") -const LoginApi = require("../api/LoginApi") -const inquirer = require("inquirer") -const { findDefaultCaptainName } = require("../utils/loginHelpers") -const { isIpAddress } = require("../utils/validationsHandler") -const { SAMPLE_IP, DEFAULT_PASSWORD } = require("../utils/constants") -const { - printMessage, - printError, - printMessageAndExit, - errorHandler -} = require("../utils/messageHandler") -let newPasswordFirstTry = undefined -const questions = [ - { - type: "list", - name: "hasInstalledCaptain", - message: - "Have you already installed Captain on your server by running the following line:" + - "\nmkdir /captain && docker run -p 80:80 -p 443:443 -p 3000:3000 -v /var/run/docker.sock:/var/run/docker.sock dockersaturn/captainduckduck ?", - default: "Yes", - choices: ["Yes", "No"], - filter: value => { - const answerFromUser = value.trim() - - if (answerFromUser === "Yes") return answerFromUser - - printMessage( - "\n\nCannot start the setup process if Captain is not installed." - ) - - printMessageAndExit( - "Please read tutorial on CaptainDuckDuck.com to learn how to install CaptainDuckDuck on a server." - ) - } - }, - { - type: "input", - default: SAMPLE_IP, - name: "captainAddress", - message: "Enter IP address of your captain server:", - filter: async value => { - const ipFromUser = value.trim() - - if (ipFromUser === SAMPLE_IP || !isIpAddress(ipFromUser)) { - printError(`\nThis is an invalid IP Address: ${ipFromUser}`, true) - } - - try { - // login using captain42. and set the ipAddressToServer - const data = await LoginApi.loginMachine( - `http://${ipFromUser}:3000`, - DEFAULT_PASSWORD - ) - - SystemApi.setIpAddressOfServer(ipFromUser) - - // All went well - if (data) return ipFromUser - } catch (e) { - errorHandler(e) - } - } - }, - { - type: "password", - name: "captainOriginalPassword", - message: "Enter your current password:", - when: () => !LoginApi.token, - filter: async value => { - try { - const captainPasswordFromUser = value.trim() - const data = await LoginApi.loginMachine( - `http://${SystemApi.ipAddressOfServer}:3000`, - captainPasswordFromUser - ) - - if (data) { - SystemApi.setIpAddressOfServer(captainPasswordFromUser) - - LoginApi.setOldPassword(captainPasswordFromUser) - } - } catch (e) { - errorHandler(e) - } - } - }, - { - type: "input", - name: "captainRootDomain", - message: - "Enter a root domain for this Captain server. For example, enter test.yourdomain.com if you" + - " setup your DNS to point *.test.yourdomain.com to ip address of your server" + - ": ", - filter: async value => { - try { - const captainRootDomainFromUser = value.trim() - const data = await SystemApi.setCustomDomain( - `http://${SystemApi.ipAddressOfServer}:3000`, - captainRootDomainFromUser - ) - - if (data) { - const newCustomDomainFromUser = `captain.${captainRootDomainFromUser}` - - SystemApi.setCustomDomainFromUser(newCustomDomainFromUser) - - return captainRootDomainFromUser - } - } catch (e) { - errorHandler(e) - } - } - }, - { - type: "input", - name: "emailAddress", - message: "Enter your 'valid' email address to enable HTTPS: ", - filter: async value => { - try { - const emailAddressFromUser = value.trim() - const { customDomainFromUser } = SystemApi - - await SystemApi.enableHttps( - `http://${customDomainFromUser}`, - emailAddressFromUser - ) - - const data = await SystemApi.forceHttps( - `https://${customDomainFromUser}` - ) - - if (data) return emailAddressFromUser - } catch (e) { - errorHandler(e) - } - } - }, - { - type: "password", - name: "newPasswordFirstTry", - message: "Enter a new password:", - filter: value => { - newPasswordFirstTry = value - - return value - } - }, - { - type: "password", - name: "newPassword", - message: "Enter a new password:", - filter: async value => { - const { customDomainFromUser } = SystemApi - - try { - const confirmPasswordValueFromUser = value - const machineUrl = `https://${customDomainFromUser}` - - if (newPasswordFirstTry !== confirmPasswordValueFromUser) { - printError("Passwords do not match", true) - } - - const changePassData = await LoginApi.changePass( - machineUrl, - confirmPasswordValueFromUser - ) - - if (changePassData) { - const loginData = await LoginApi.login( - machineUrl, - confirmPasswordValueFromUser - ) - - if (loginData) return - } - } catch (e) { - printError( - "\nIMPORTANT!! Server setup is completed by password is not changed." - ) - - printError("\nYou CANNOT use serversetup anymore. To continue:") - - printError( - `\n- Go to https://${customDomainFromUser} login with default password and change the password in settings.` - ) - - printError( - `\n- In terminal (here), type captainduckduck login and enter this as your root domain: ${customDomainFromUser}`, - true - ) - } - } - }, - { - type: "input", - name: "captainName", - message: "Enter a name for this Captain machine:", - default: findDefaultCaptainName(), - validate: value => { - const newMachineName = value.trim() - - MachineHelper.machines.map( - machine => - machine.name === newMachineName && - `${newMachineName} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.` - ) - - if (value.match(/^[-\d\w]+$/i)) { - return true - } - - return "Please enter a Captain Name." - } - } -] - -async function serversetup() { - printMessage("\nSetup your Captain server\n") - - const answers = await inquirer.prompt(questions) - const captainAddress = `https://${SystemApi.customDomainFromUser}` - const newMachine = { - authToken: LoginApi.token, - baseUrl: captainAddress, - name: answers.captainName - } - - MachineHelper.addMachine(newMachine) - - printMessage(`\n\nCaptain is available at ${captainAddress}`) - - printMessage( - "\nFor more details and docs see http://www.captainduckduck.com\n\n" - ) -} - -module.exports = serversetup diff --git a/app-cli/src/commands/serversetup.ts b/app-cli/src/commands/serversetup.ts new file mode 100644 index 0000000..70bc8a9 --- /dev/null +++ b/app-cli/src/commands/serversetup.ts @@ -0,0 +1,218 @@ +#!/usr/bin/env node + +import { isIpAddress } from '../utils/validationsHandler'; + +const SystemApi = require('../api/SystemApi'); +const LoginApi = require('../api/LoginApi'); +const inquirer = require('inquirer'); +const { findDefaultCaptainName } = require('../utils/loginHelpers'); +const { SAMPLE_IP, DEFAULT_PASSWORD } = require('../utils/constants'); +const { printMessage, printError, printMessageAndExit, errorHandler } = require('../utils/messageHandler'); +import MachineHelper from '../helpers/MachineHelper'; + +let newPasswordFirstTry: string | undefined = undefined; +const questions = [ + { + type: 'list', + name: 'hasInstalledCaptain', + message: + 'Have you already installed Captain on your server by running the following line:' + + '\nmkdir /captain && docker run -p 80:80 -p 443:443 -p 3000:3000 -v /var/run/docker.sock:/var/run/docker.sock dockersaturn/captainduckduck ?', + default: 'Yes', + choices: [ 'Yes', 'No' ], + filter: (value: string) => { + const answerFromUser = value.trim(); + + if (answerFromUser === 'Yes') return answerFromUser; + + printMessage('\n\nCannot start the setup process if Captain is not installed.'); + + printMessageAndExit( + 'Please read tutorial on CaptainDuckDuck.com to learn how to install CaptainDuckDuck on a server.' + ); + } + }, + { + type: 'input', + default: SAMPLE_IP, + name: 'captainAddress', + message: 'Enter IP address of your captain server:', + filter: async (value: string) => { + const ipFromUser = value.trim(); + + if (ipFromUser === SAMPLE_IP || !isIpAddress(ipFromUser)) { + printError(`\nThis is an invalid IP Address: ${ipFromUser}`, true); + } + + try { + // login using captain42. and set the ipAddressToServer + const data = await LoginApi.loginMachine(`http://${ipFromUser}:3000`, DEFAULT_PASSWORD); + + SystemApi.setIpAddressOfServer(ipFromUser); + + // All went well + if (data) return ipFromUser; + } catch (e) { + errorHandler(e); + } + } + }, + { + type: 'password', + name: 'captainOriginalPassword', + message: 'Enter your current password:', + when: () => !LoginApi.token, + filter: async (value: string) => { + try { + const captainPasswordFromUser = value.trim(); + const data = await LoginApi.loginMachine( + `http://${SystemApi.ipAddressOfServer}:3000`, + captainPasswordFromUser + ); + + if (data) { + SystemApi.setIpAddressOfServer(captainPasswordFromUser); + + LoginApi.setOldPassword(captainPasswordFromUser); + } + } catch (e) { + errorHandler(e); + } + } + }, + { + type: 'input', + name: 'captainRootDomain', + message: + 'Enter a root domain for this Captain server. For example, enter test.yourdomain.com if you' + + ' setup your DNS to point *.test.yourdomain.com to ip address of your server' + + ': ', + filter: async (value: string) => { + try { + const captainRootDomainFromUser = value.trim(); + const data = await SystemApi.setCustomDomain( + `http://${SystemApi.ipAddressOfServer}:3000`, + captainRootDomainFromUser + ); + + if (data) { + const newCustomDomainFromUser = `captain.${captainRootDomainFromUser}`; + + SystemApi.setCustomDomainFromUser(newCustomDomainFromUser); + + return captainRootDomainFromUser; + } + } catch (e) { + errorHandler(e); + } + } + }, + { + type: 'input', + name: 'emailAddress', + message: "Enter your 'valid' email address to enable HTTPS: ", + filter: async (value: string) => { + try { + const emailAddressFromUser = value.trim(); + const { customDomainFromUser } = SystemApi; + + await SystemApi.enableHttps(`http://${customDomainFromUser}`, emailAddressFromUser); + + const data = await SystemApi.forceHttps(`https://${customDomainFromUser}`); + + if (data) return emailAddressFromUser; + } catch (e) { + errorHandler(e); + } + } + }, + { + type: 'password', + name: 'newPasswordFirstTry', + message: 'Enter a new password:', + filter: (value: string) => { + newPasswordFirstTry = value; + + return value; + } + }, + { + type: 'password', + name: 'newPassword', + message: 'Enter a new password:', + filter: async (value: string) => { + const { customDomainFromUser } = SystemApi; + + try { + const confirmPasswordValueFromUser = value; + const machineUrl = `https://${customDomainFromUser}`; + + if (newPasswordFirstTry !== confirmPasswordValueFromUser) { + printError('Passwords do not match', true); + } + + const changePassData = await LoginApi.changePass(machineUrl, confirmPasswordValueFromUser); + + if (changePassData) { + const loginData = await LoginApi.login(machineUrl, confirmPasswordValueFromUser); + + if (loginData) return; + } + } catch (e) { + printError('\nIMPORTANT!! Server setup is completed by password is not changed.'); + + printError('\nYou CANNOT use serversetup anymore. To continue:'); + + printError( + `\n- Go to https://${customDomainFromUser} login with default password and change the password in settings.` + ); + + printError( + `\n- In terminal (here), type captainduckduck login and enter this as your root domain: ${customDomainFromUser}`, + true + ); + } + } + }, + { + type: 'input', + name: 'captainName', + message: 'Enter a name for this Captain machine:', + default: findDefaultCaptainName(), + validate: (value: string) => { + const newMachineName = value.trim(); + + MachineHelper.getMachines().map( + (machine) => + machine.name === newMachineName && + `${newMachineName} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.` + ); + + if (value.match(/^[-\d\w]+$/i)) { + return true; + } + + return 'Please enter a Captain Name.'; + } + } +]; + +async function serversetup() { + printMessage('\nSetup your Captain server\n'); + + const answers = await inquirer.prompt(questions); + const captainAddress = `https://${SystemApi.customDomainFromUser}`; + const newMachine = { + authToken: LoginApi.token, + baseUrl: captainAddress, + name: answers.captainName + }; + + MachineHelper.addMachine(newMachine); + + printMessage(`\n\nCaptain is available at ${captainAddress}`); + + printMessage('\nFor more details and docs see http://www.captainduckduck.com\n\n'); +} + +export = serversetup; diff --git a/app-cli/src/helpers/MachineHelper.ts b/app-cli/src/helpers/MachineHelper.ts index 6283e90..ac3509b 100644 --- a/app-cli/src/helpers/MachineHelper.ts +++ b/app-cli/src/helpers/MachineHelper.ts @@ -35,6 +35,10 @@ class MachineHelper { return [ ...firstItemInOption, ...listOfMachines ]; } + getMachines() { + return this.machines; + } + setMachines(newMachines: IMachine[]) { this.machines = newMachines; @@ -104,4 +108,6 @@ class MachineHelper { } } -module.exports = new MachineHelper(); +const instance = new MachineHelper(); + +export default instance; diff --git a/app-cli/src/utils/fileHelper.ts b/app-cli/src/utils/fileHelper.ts index 344e4cf..3817549 100644 --- a/app-cli/src/utils/fileHelper.ts +++ b/app-cli/src/utils/fileHelper.ts @@ -161,8 +161,7 @@ function deleteFileFromDisk(filePath: string) { fs.removeSync(filePath); } } - -module.exports = { +export = { gitArchiveFile, getFileStream, uploadFile, diff --git a/app-cli/src/utils/loginHelpers.ts b/app-cli/src/utils/loginHelpers.ts index f40f59b..2be1d38 100644 --- a/app-cli/src/utils/loginHelpers.ts +++ b/app-cli/src/utils/loginHelpers.ts @@ -1,6 +1,5 @@ import { IMachine } from '../models/IModels'; - -const MachineHelper = require('../helpers/MachineHelper'); +import MachineHelper from '../helpers/MachineHelper'; function cleanUpUrl(url: string) { if (!url || !url.length) return null; @@ -17,7 +16,7 @@ function cleanUpUrl(url: string) { } function findDefaultCaptainName() { - let currentSuffix = MachineHelper.machines.length + 1; + let currentSuffix = MachineHelper.getMachines().length + 1; while (!isSuffixValid(currentSuffix)) { currentSuffix++; @@ -33,11 +32,11 @@ function getCaptainFullName(suffix: number) { } const isSuffixValid = (suffixNumber: number) => - MachineHelper.machines.map((machine: IMachine) => { + MachineHelper.getMachines().map((machine: IMachine) => { machine.name !== getCaptainFullName(suffixNumber); }); -module.exports = { +export = { cleanUpUrl, findDefaultCaptainName, isSuffixValid, diff --git a/app-cli/src/utils/machineUtils.ts b/app-cli/src/utils/machineUtils.ts index 5896215..88b2c23 100644 --- a/app-cli/src/utils/machineUtils.ts +++ b/app-cli/src/utils/machineUtils.ts @@ -52,7 +52,7 @@ function saveMachineToLocalStorage() { } } -module.exports = { +export = { initMachineFromLocalStorage, saveMachineToLocalStorage }; diff --git a/app-cli/src/utils/validationsHandler.ts b/app-cli/src/utils/validationsHandler.ts index 00204c0..0b7a955 100644 --- a/app-cli/src/utils/validationsHandler.ts +++ b/app-cli/src/utils/validationsHandler.ts @@ -4,7 +4,7 @@ const { printError } = require('./messageHandler'); const { requestLogin } = require('../commands/login'); const { initMachineFromLocalStorage } = require('../utils/machineUtils'); -function validateIsGitRepository() { +export function validateIsGitRepository() { const gitFolderExists = fs.pathExistsSync('./.git'); if (!gitFolderExists) { @@ -15,7 +15,7 @@ function validateIsGitRepository() { } } -function validateDefinitionFile() { +export function validateDefinitionFile() { const captainDefinitionExists = fs.pathExistsSync('./captain-definition'); if (!captainDefinitionExists) { @@ -53,7 +53,7 @@ function validateDefinitionFile() { } // Only show that question if there is no option given as argument -function optionIsNotGiven(allOptions: { [id: string]: any }, option: string) { +export function optionIsNotGiven(allOptions: { [id: string]: any }, option: string) { // console.log(allOptions) if (allOptions[option]) { return false; @@ -62,7 +62,7 @@ function optionIsNotGiven(allOptions: { [id: string]: any }, option: string) { return true; } -function isIpAddress(ipaddress: string) { +export function isIpAddress(ipaddress: string) { if ( /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test( ipaddress @@ -74,7 +74,7 @@ function isIpAddress(ipaddress: string) { return false; } -async function validateAuthentication() { +export async function validateAuthentication() { // 1. Check if valid auth const isAuthenticated = await DeployApi.isAuthTokenValid(); @@ -92,11 +92,3 @@ async function validateAuthentication() { return Boolean(isAuthenticated); } } - -module.exports = { - validateAuthentication, - validateIsGitRepository, - validateDefinitionFile, - isIpAddress, - optionIsNotGiven -}; From 1ae2a90ef3190d94d5355b5291aa0ec56d1471c9 Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Fri, 4 Jan 2019 00:00:35 -0800 Subject: [PATCH 33/44] api changed to ts --- app-cli/built/api/DeployApi.js | 27 +++--- app-cli/built/api/DeployApi.js.map | 2 +- app-cli/built/api/LoginApi.js | 11 +-- app-cli/built/api/LoginApi.js.map | 2 +- app-cli/built/api/MainApi.js | 18 ++-- app-cli/built/api/MainApi.js.map | 2 +- app-cli/built/api/SystemApi.js | 17 ++-- app-cli/built/api/SystemApi.js.map | 2 +- app-cli/built/commands/deploy.js | 1 - app-cli/built/commands/deploy.js.map | 2 +- app-cli/built/commands/list.js | 1 - app-cli/built/commands/list.js.map | 2 +- app-cli/built/commands/login.js | 1 - app-cli/built/commands/login.js.map | 2 +- app-cli/package-lock.json | 43 ++++++++++ app-cli/package.json | 1 + app-cli/src/api/DeployApi.js | 124 --------------------------- app-cli/src/api/DeployApi.ts | 109 +++++++++++++++++++++++ app-cli/src/api/LoginApi.js | 63 -------------- app-cli/src/api/LoginApi.ts | 56 ++++++++++++ app-cli/src/api/MainApi.js | 97 --------------------- app-cli/src/api/MainApi.ts | 99 +++++++++++++++++++++ app-cli/src/api/SystemApi.js | 87 ------------------- app-cli/src/api/SystemApi.ts | 83 ++++++++++++++++++ 24 files changed, 436 insertions(+), 416 deletions(-) delete mode 100644 app-cli/src/api/DeployApi.js create mode 100644 app-cli/src/api/DeployApi.ts delete mode 100644 app-cli/src/api/LoginApi.js create mode 100644 app-cli/src/api/LoginApi.ts delete mode 100644 app-cli/src/api/MainApi.js create mode 100644 app-cli/src/api/MainApi.ts delete mode 100644 app-cli/src/api/SystemApi.js create mode 100644 app-cli/src/api/SystemApi.ts diff --git a/app-cli/built/api/DeployApi.js b/app-cli/built/api/DeployApi.js index b7374d0..6d0221a 100755 --- a/app-cli/built/api/DeployApi.js +++ b/app-cli/built/api/DeployApi.js @@ -1,3 +1,4 @@ +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } @@ -6,15 +7,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -const MainApi = require("./MainApi"); -const MachineHelper = require("../helpers/MachineHelper"); -const { DEFAULT_BRANCH_TO_PUSH, DEFAULT_APP_NAME } = require("../utils/constants"); +const MachineHelper_1 = require("../helpers/MachineHelper"); +const MainApi = require('./MainApi'); +const { DEFAULT_BRANCH_TO_PUSH, DEFAULT_APP_NAME } = require('../utils/constants'); class DeployApi { constructor() { - this.machineToDeploy = {}; this.branchToPush = DEFAULT_BRANCH_TO_PUSH; this.appName = DEFAULT_APP_NAME; - this.appUrl = ""; + this.appUrl = ''; } setMachineToDeploy(machineToDeploy) { this.machineToDeploy = machineToDeploy; @@ -22,14 +22,13 @@ class DeployApi { updateMachineToDeploy(machineToDeploy) { let possibleMachine = {}; // Look machine by host - if (machineToDeploy.startsWith("http")) { - possibleMachine = MachineHelper.machines.find(machine => machine.baseUrl === machineToDeploy); + if (machineToDeploy.startsWith('http')) { + this.machineToDeploy = MachineHelper_1.default.getMachines().find((machine) => machine.baseUrl === machineToDeploy); } else { // Look machine by name - possibleMachine = MachineHelper.machines.find(machine => machine.name === machineToDeploy); + this.machineToDeploy = MachineHelper_1.default.getMachines().find((machine) => machine.name === machineToDeploy); } - this.machineToDeploy = possibleMachine; } setBranchToPush(branchToPush) { this.branchToPush = branchToPush; @@ -40,8 +39,8 @@ class DeployApi { } setAppUrl() { this.appUrl = this.machineToDeploy.baseUrl - .replace("//captain.", "//" + this.appName + ".") - .replace("https://", "http://"); + .replace('//captain.', '//' + this.appName + '.') + .replace('https://', 'http://'); } fetchBuildLogs() { return __awaiter(this, void 0, void 0, function* () { @@ -49,7 +48,7 @@ class DeployApi { const { authToken, baseUrl } = this.machineToDeploy; const customOptions = { headers: { - "x-captain-auth": authToken + 'x-captain-auth': authToken } }; const data = yield MainApi.get(`${baseUrl}/api/v1/user/appData/${this.appName}`, customOptions); @@ -71,7 +70,7 @@ class DeployApi { }; const options = { headers: { - "x-captain-auth": authToken + 'x-captain-auth': authToken } }; const data = yield MainApi.postWithFile(url, form, options); @@ -92,7 +91,7 @@ class DeployApi { const currentToken = this.machineToDeploy.authToken; const options = { headers: { - "x-captain-auth": currentToken + 'x-captain-auth': currentToken } }; const response = yield MainApi.get(url, options); diff --git a/app-cli/built/api/DeployApi.js.map b/app-cli/built/api/DeployApi.js.map index 8ed5267..e1eeb18 100755 --- a/app-cli/built/api/DeployApi.js.map +++ b/app-cli/built/api/DeployApi.js.map @@ -1 +1 @@ -{"version":3,"file":"DeployApi.js","sourceRoot":"","sources":["../../src/api/DeployApi.js"],"names":[],"mappings":";;;;;;;;AAAA,MAAM,OAAO,GAAG,OAAO,CAAC,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ginApi.js index c481337..9d659da 100755 --- a/app-cli/built/api/LoginApi.js +++ b/app-cli/built/api/LoginApi.js @@ -1,3 +1,4 @@ +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } @@ -6,12 +7,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -const MainApi = require("./MainApi"); -const SystemApi = require("./SystemApi"); -const { DEFAULT_PASSWORD } = require("../utils/constants"); +const MainApi = require('./MainApi'); +const SystemApi = require('./SystemApi'); +const { DEFAULT_PASSWORD } = require('../utils/constants'); class LoginApi { constructor() { - this.token = ""; + this.token = ''; this.oldPassword = DEFAULT_PASSWORD; } setOldPassword(newPassword) { @@ -40,7 +41,7 @@ class LoginApi { try { const customOptions = { headers: { - "x-captain-auth": LoginApi.token + 'x-captain-auth': this.token } }; const form = { diff --git a/app-cli/built/api/LoginApi.js.map b/app-cli/built/api/LoginApi.js.map index 604fa41..6ba869d 100755 --- a/app-cli/built/api/LoginApi.js.map +++ b/app-cli/built/api/LoginApi.js.map @@ -1 +1 @@ -{"version":3,"file":"LoginApi.js","sourceRoot":"","sources":["../../src/api/LoginApi.js"],"names":[],"mappings":";;;;;;;;AAAA,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;AACpC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;AACxC,MAAM,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AAE1D,MAAM,QAAQ;IACZ;QACE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAA;QAEf,IAAI,CAAC,WAAW,GAAG,gBAAgB,CAAA;IACrC,CAAC;IAED,cAAc,CAAC,WAAW;QACxB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;IAChC,CAAC;IAED,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C,IAAI,CAAC,KAAK,CAAC,CAAC;gBAE1B,SAAS,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;gBAExC,OAAO,IAAI,CAAC;aACZ;YAAC,OAAO,CAAC,EAAE;gBACX,MAAM,CAAC,CAAC;aACR;QACF,CAAC;KAAA;CACD;AAED,iBAAS,IAAI,QAAQ,EAAE,CAAC"} \ No newline at end of file diff --git a/app-cli/built/api/MainApi.js b/app-cli/built/api/MainApi.js index d43630b..a82a13a 100755 --- a/app-cli/built/api/MainApi.js +++ b/app-cli/built/api/MainApi.js @@ -1,9 +1,10 @@ +"use strict"; const Request = require("request-promise"); class MainApi { constructor() { this.sharedOptions = { headers: { - "x-namespace": "captain" + 'x-namespace': 'captain' } }; } @@ -17,34 +18,35 @@ class MainApi { } get(url, options) { const overrideOptions = this._buildOptions(options); - const optionsToSend = Object.assign({}, overrideOptions, { url, method: "GET" }); + const optionsToSend = Object.assign({}, overrideOptions, { url, method: 'GET' }); return Request(optionsToSend); } post(url, form, options) { const overrideOptions = this._buildOptions(options); - const optionsToSend = Object.assign({}, overrideOptions, { url, method: "POST", form }); + const optionsToSend = Object.assign({}, overrideOptions, { url, method: 'POST', form }); return Request(optionsToSend); } postWithFile(url, formData, options) { const overrideOptions = this._buildOptions(options); - const optionsToSend = Object.assign({}, overrideOptions, { url, method: "POST", formData }); + const optionsToSend = Object.assign({}, overrideOptions, { url, method: 'POST', formData }); return Request(optionsToSend); } put(url, form, options) { const overrideOptions = this._buildOptions(options); - const optionsToSend = Object.assign({}, overrideOptions, { url, method: "PUT", form }); + const optionsToSend = Object.assign({}, overrideOptions, { url, method: 'PUT', form }); return Request(optionsToSend); } patch(url, form, options) { const overrideOptions = this._buildOptions(options); - const optionsToSend = Object.assign({}, overrideOptions, { url, method: "PATCH", form }); + const optionsToSend = Object.assign({}, overrideOptions, { url, method: 'PATCH', form }); return Request(optionsToSend); } delete(url, options) { const overrideOptions = this._buildOptions(options); - const optionsToSend = Object.assign({}, overrideOptions, { url, method: "DELETE" }); + const optionsToSend = Object.assign({}, overrideOptions, { url, method: 'DELETE' }); return Request(optionsToSend); } } -module.exports = new MainApi(); +const instance = new MainApi(); +module.exports = instance; //# sourceMappingURL=MainApi.js.map \ No newline at end of file diff --git a/app-cli/built/api/MainApi.js.map b/app-cli/built/api/MainApi.js.map index 99bb77b..db32412 100755 --- a/app-cli/built/api/MainApi.js.map +++ b/app-cli/built/api/MainApi.js.map @@ -1 +1 @@ -{"version":3,"file":"MainApi.js","sourceRoot":"","sources":["../../src/api/MainApi.js"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;AAE1C,MAAM,OAAO;IACX;QACE,IAAI,CAAC,aAAa,GAAG;YACnB,OAAO,EAAE;gBACP,aAAa,EAAE,SAAS;aACzB;SACF,CAAA;IACH,CAAC;IAED,aAAa,CAAC,OAAO;QACnB,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC,aAAa,CAAA;QAEvC,IAAI,OAAO,CAAC,OAAO,EAAE;YACnB,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAC7B,EAAE,EACF,IAAI,CAAC,aAAa,CAAC,OAAO,EAC1B,OAAO,CAAC,OAAO,CAChB,CAAA;SACF;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAA;IACvD,CAAC;IAED,GAAG,CAAC,GAAG,EAAE,OAAO;QACd,MAAM,eAAe,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;QACnD,MAAM,aAAa,qBACd,eAAe,IAClB,GAAG,EACH,MAAM,EAAE,KAAK,GACd,CAAA;QAED,OAAO,OAAO,CAAC,aAAa,CAAC,CAAA;IAC/B,CAAC;IAED,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO;QACrB,MAAM,eAAe,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,C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,GACR,CAAC;QAEF,OAAO,OAAO,CAAC,aAAa,CAAC,CAAC;IAC/B,CAAC;IAED,GAAG,CAAC,GAAW,EAAE,IAAS,EAAE,OAAiB;QAC5C,MAAM,eAAe,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACpD,MAAM,aAAa,qBACf,eAAe,IAClB,GAAG,EACH,MAAM,EAAE,KAAK,EACb,IAAI,GACJ,CAAC;QAEF,OAAO,OAAO,CAAC,aAAa,CAAC,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,GAAW,EAAE,IAAS,EAAE,OAAiB;QAC9C,MAAM,eAAe,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACpD,MAAM,aAAa,qBACf,eAAe,IAClB,GAAG,EACH,MAAM,EAAE,OAAO,EACf,IAAI,GACJ,CAAC;QAEF,OAAO,OAAO,CAAC,aAAa,CAAC,CAAC;IAC/B,CAAC;IAED,MAAM,CAAC,GAAW,EAAE,OAAiB;QACpC,MAAM,eAAe,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACpD,MAAM,aAAa,qBACf,eAAe,IAClB,GAAG,EACH,MAAM,EAAE,QAAQ,GAChB,CAAC;QAEF,OAAO,OAAO,CAAC,aAAa,CAAC,CAAC;IAC/B,CAAC;CACD;AAED,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAE,CAAC;AAC/B,iBAAS,QAAQ,CAAC"} \ No newline at end of file diff --git a/app-cli/built/api/SystemApi.js b/app-cli/built/api/SystemApi.js index 479d815..ea342e0 100755 --- a/app-cli/built/api/SystemApi.js +++ b/app-cli/built/api/SystemApi.js @@ -1,3 +1,4 @@ +"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } @@ -6,14 +7,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -const MainApi = require("./MainApi"); -const LoginApi = require("./LoginApi"); +const MainApi = require('./MainApi'); +const LoginApi = require('./LoginApi'); // const spinnerUtil = require("../../utils/spinner") class SystemApi { constructor() { - this.ipAddressOfServer = ""; - this.customDomainFromUser = ""; - this.newPasswordFirstTry = ""; + this.ipAddressOfServer = ''; + this.customDomainFromUser = ''; + this.newPasswordFirstTry = ''; } setCustomDomainFromUser(newCustomDomainFromUser) { this.customDomainFromUser = newCustomDomainFromUser; @@ -26,7 +27,7 @@ class SystemApi { try { const customOptions = { headers: { - "x-captain-auth": LoginApi.token + 'x-captain-auth': LoginApi.token } }; const data = yield MainApi.post(`${baseUrl}/api/v1/user/system/changerootdomain/`, { @@ -43,7 +44,7 @@ class SystemApi { return __awaiter(this, void 0, void 0, function* () { const customOptions = { headers: { - "x-captain-auth": LoginApi.token + 'x-captain-auth': LoginApi.token } }; try { @@ -62,7 +63,7 @@ class SystemApi { try { const customOptions = { headers: { - "x-captain-auth": LoginApi.token + 'x-captain-auth': LoginApi.token } }; const data = yield MainApi.post(`${baseUrl}/api/v1/user/system/forcessl/`, { diff --git a/app-cli/built/api/SystemApi.js.map b/app-cli/built/api/SystemApi.js.map index b61c08d..2416dea 100755 --- a/app-cli/built/api/SystemApi.js.map +++ b/app-cli/built/api/SystemApi.js.map @@ -1 +1 @@ -{"version":3,"file":"SystemApi.js","sourceRoot":"","sources":["../../src/api/SystemApi.js"],"names":[],"mappings":";;;;;;;;AAAA,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;AACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;AACtC,qDAAqD;AAErD,MAAM,SAAS;IACb;QACE,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAA;QAE3B,IAAI,CAAC,oBAAoB,GAAG,EAAE,CAAA;QAE9B,IAAI,CAAC,mBAAmB,GAAG,EAAE,CAAA;IAC/B,CAAC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,IAAI,CAAA;aACZ;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,CAAC,CAAA;aACR;QACH,CAAC;KAAA;CACF;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,SAAS,EAAE,CAAA"} \ No newline at end of file +{"version":3,"file":"SystemApi.js","sourceRoot":"","sources":["../../src/api/SystemApi.ts"],"names":[],"mappings":";;;;;;;;;AAAA,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACrC,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AACvC,qDAAqD;AAErD,MAAM,SAAS;IAAf;QACS,sBAAiB,GAAG,EAAE,CAAC;QACvB,yBAAoB,GAAG,EAAE,CAAC;QAC1B,wBAAmB,GAAG,EAAE,CAAC;IAyElC,CAAC;IAvEA,uBAAuB,CAAC,uBAA+B;QACtD,IAAI,CAAC,oBAAoB,GAAG,uBAAuB,CAAC;IACrD,CAAC;IAED,oBAAoB,CAAC,YAAoB;QACxC,IAAI,CAAC,iBAAiB,GAAG,YAAY,CAAC,IAAI,EAAE,CAAC;IAC9C,CAAC;IAEK,eAAe,CAAC,OAAe,EAAE,UAAkB;;YACxD,IAAI;gBACH,MAAM,aAAa,GAAG;oBACrB,OAAO,EAAE;wBACR,gBAAgB,EAAE,QAAQ,CAAC,KAAK;qBAChC;iBACD,CAAC;gBACF,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,CAC9B,GAAG,OAAO,uCAAuC,EACjD;oBACC,UAAU;iBACV,EACD,aAAa,CACb,CAAC;gBAEF,OAAO,IAAI,CAAC;aACZ;YAAC,OAAO,CAAC,EAAE;gBACX,MAAM,CAAC,CAAC;aACR;QACF,CAAC;KAAA;IAEK,WAAW,CAAC,OAAe,EAAE,YAAoB;;YACtD,MAAM,aAAa,GAAG;gBACrB,OAAO,EAAE;oBACR,gBAAgB,EAAE,QAAQ,CAAC,KAAK;iBAChC;aACD,CAAC;YAEF,IAAI;gBACH,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,CAC9B,GAAG,OAAO,gCAAgC,EAC1C;oBACC,YAAY;iBACZ,EACD,aAAa,CACb,CAAC;gBAEF,OAAO,IAAI,CAAC;aACZ;YAAC,OAAO,CAAC,EAAE;gBACX,MAAM,CAAC,CAAC;aACR;QACF,CAAC;KAAA;IAEK,UAAU,CAAC,OAAc,EAAE,SAAS,GAAG,IAAI;;YAChD,IAAI;gBACH,MAAM,aAAa,GAAG;oBACrB,OAAO,EAAE;wBACR,gBAAgB,EAAE,QAAQ,CAAC,KAAK;qBAChC;iBACD,CAAC;gBACF,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,CAC9B,GAAG,OAAO,+BAA+B,EACzC;oBACC,SAAS;iBACT,EACD,aAAa,CACb,CAAC;gBAEF,OAAO,IAAI,CAAC;aACZ;YAAC,OAAO,CAAC,EAAE;gBACX,MAAM,CAAC,CAAC;aACR;QACF,CAAC;KAAA;CACD;AAED,iBAAS,IAAI,SAAS,EAAE,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/deploy.js b/app-cli/built/commands/deploy.js index 4574360..9407893 100755 --- a/app-cli/built/commands/deploy.js +++ b/app-cli/built/commands/deploy.js @@ -8,7 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -Object.defineProperty(exports, "__esModule", { value: true }); const MachineHelper_1 = require("../helpers/MachineHelper"); const inquirer = require('inquirer'); const DeployApi = require('../api/DeployApi'); diff --git a/app-cli/built/commands/deploy.js.map b/app-cli/built/commands/deploy.js.map index 36aca3e..6d3f638 100755 --- a/app-cli/built/commands/deploy.js.map +++ b/app-cli/built/commands/deploy.js.map @@ -1 +1 @@ -{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,4DAAqD;AACrD,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,C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,OAAO,CAAC,OAAO,CAAC;YAEnD,SAAS,CAAC,qBAAqB,CAAC,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;YAErE,SAAS,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;YAExC,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YAE9B,YAAY,CAAC,gBAAgB,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC;YAE/D,gBAAgB;YAChB,IAAI,OAAO,CAAC,iBAAiB,EAAE;gBAC9B,IAAI;oBACH,MAAM,qBAAqB,GAAG,MAAM,sBAAsB,EAAE,CAAC;oBAE7D,IAAI,qBAAqB,EAAE;wBAC1B,oBAAoB,EAAE,CAAC;qBACvB;yBAAM;wBACN,UAAU,CAAC,yBAAyB,EAAE,IAAI,CAAC,CAAC;qBAC5C;iBACD;gBAAC,OAAO,CAAC,EAAE;oBACX,UAAU,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;iBAC5B;aACD;SACD;IACF,CAAC;CAAA;AAED,iBAAS,MAAM,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/list.js b/app-cli/built/commands/list.js index ea9639c..275e811 100755 --- a/app-cli/built/commands/list.js +++ b/app-cli/built/commands/list.js @@ -1,6 +1,5 @@ #!/usr/bin/env node "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); const chalk = require('chalk'); const MachineHelper_1 = require("../helpers/MachineHelper"); const { printMessage } = require('../utils/messageHandler'); diff --git a/app-cli/built/commands/list.js.map b/app-cli/built/commands/list.js.map index 0e6f965..6ffd08b 100755 --- a/app-cli/built/commands/list.js.map +++ b/app-cli/built/commands/list.js.map @@ -1 +1 @@ -{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":";;;AAEA,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/B,4DAAqD;AAErD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAE5D,SAAS,eAAe,CAAC,OAAiB;IACzC,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7F,CAAC;AAED,SAAS,IAAI;IACZ,YAAY,CAAC,iCAAiC,CAAC,CAAC;IAEhD,uBAAa,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QAC3C,eAAe,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,YAAY,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC"} \ No newline at end of file +{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":";;AAEA,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/B,4DAAqD;AAErD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAE5D,SAAS,eAAe,CAAC,OAAiB;IACzC,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7F,CAAC;AAED,SAAS,IAAI;IACZ,YAAY,CAAC,iCAAiC,CAAC,CAAC;IAEhD,uBAAa,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QAC3C,eAAe,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,YAAY,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC;AAED,iBAAS,IAAI,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/login.js b/app-cli/built/commands/login.js index 5856751..d86e6f6 100755 --- a/app-cli/built/commands/login.js +++ b/app-cli/built/commands/login.js @@ -8,7 +8,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -Object.defineProperty(exports, "__esModule", { value: true }); const MachineHelper_1 = require("../helpers/MachineHelper"); const { printMessage, printGreenMessage, printError } = require('../utils/messageHandler'); const inquirer = require('inquirer'); diff --git a/app-cli/built/commands/login.js.map b/app-cli/built/commands/login.js.map index 73dc2ca..d63e0f1 100755 --- a/app-cli/built/commands/login.js.map +++ b/app-cli/built/commands/login.js.map @@ -1 +1 @@ -{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,4DAAqD;AAErD,MAAM,EAAE,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAC3F,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACrC,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC9C,MAAM,EAAE,UAAU,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAChF,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AACxD,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE5C,+BAA+B;AAC/B,SAAe,YAAY;;QAC1B,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC,eAAe,CAAC;QAEpD,YAAY,CAAC,2DAA2D,CAAC,CAAC;QAE1E,MAAM,SAAS,GAAG;YACjB;gBACC,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,iBAAiB;gBACvB,OAAO,EAAE,iCAAiC,GAAG,OAAO;gBACp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AC,CAAC,CAAC;aACnD;YAED,MAAM,UAAU,GAAG;gBAClB,SAAS,EAAE,QAAQ,CAAC,KAAK;gBACzB,OAAO;gBACP,IAAI,EAAE,WAAW;aACjB,CAAC;YAEF,uBAAa,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;YAErC,iBAAiB,CAAC,6BAA6B,OAAO,EAAE,CAAC,CAAC;YAE1D,iBAAiB,CAAC,uCAAuC,WAAW,KAAK,CAAC,CAAC;SAC3E;QAAC,OAAO,KAAK,EAAE;YACf,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;YAE3D,UAAU,CAAC,wCAAwC,WAAW,OAAO,YAAY,EAAE,CAAC,CAAC;SACrF;IACF,CAAC;CAAA;AAED,iBAAS,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC"} \ No newline at end of file diff --git a/app-cli/package-lock.json b/app-cli/package-lock.json index 7c8b032..24b8eb6 100644 --- a/app-cli/package-lock.json +++ b/app-cli/package-lock.json @@ -24,6 +24,24 @@ "js-tokens": "^4.0.0" } }, + "@types/bluebird": { + "version": "3.5.25", + "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.25.tgz", + "integrity": "sha512-yfhIBix+AIFTmYGtkC0Bi+XGjSkOINykqKvO/Wqdz/DuXlAKK7HmhLAXdPIGsV4xzKcL3ev/zYc4yLNo+OvGaw==" + }, + "@types/caseless": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.1.tgz", + "integrity": "sha512-FhlMa34NHp9K5MY1Uz8yb+ZvuX0pnvn3jScRSNAb75KHGB8d3rEU6hqMs3Z2vjuytcMfRg6c5CHMc3wtYyD2/A==" + }, + "@types/form-data": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-2.2.1.tgz", + "integrity": "sha512-JAMFhOaHIciYVh8fb5/83nmuO/AHwmto+Hq7a9y8FzLDcC1KCU344XDOMEmahnrTFlHjgh4L0WJFczNIX2GxnQ==", + "requires": { + "@types/node": "*" + } + }, "@types/fs-extra": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-5.0.4.tgz", @@ -37,6 +55,31 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz", "integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==" }, + "@types/request": { + "version": "2.48.1", + "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.1.tgz", + "integrity": "sha512-ZgEZ1TiD+KGA9LiAAPPJL68Id2UWfeSO62ijSXZjFJArVV+2pKcsVHmrcu+1oiE3q6eDGiFiSolRc4JHoerBBg==", + "requires": { + "@types/caseless": "*", + "@types/form-data": "*", + "@types/node": "*", + "@types/tough-cookie": "*" + } + }, + "@types/request-promise": { + "version": "4.1.42", + "resolved": "https://registry.npmjs.org/@types/request-promise/-/request-promise-4.1.42.tgz", + "integrity": "sha512-b8li55sEZ00BXZstZ3d8WOi48dnapTqB1VufEG9Qox0nVI2JVnTVT1Mw4JbBa1j+1sGVX/qJ0R4WDv4v2GjT0w==", + "requires": { + "@types/bluebird": "*", + "@types/request": "*" + } + }, + "@types/tough-cookie": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.4.tgz", + "integrity": "sha512-Set5ZdrAaKI/qHdFlVMgm/GsAv/wkXhSTuZFkJ+JI7HK+wIkIlOaUXSXieIvJ0+OvGIqtREFoE+NHJtEq0gtEw==" + }, "abab": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz", diff --git a/app-cli/package.json b/app-cli/package.json index 4390862..01f0cac 100644 --- a/app-cli/package.json +++ b/app-cli/package.json @@ -42,6 +42,7 @@ }, "dependencies": { "@types/fs-extra": "^5.0.4", + "@types/request-promise": "^4.1.42", "chalk": "^2.4.1", "command-exists": "^1.2.8", "commander": "^2.19.0", diff --git a/app-cli/src/api/DeployApi.js b/app-cli/src/api/DeployApi.js deleted file mode 100644 index fa7c50c..0000000 --- a/app-cli/src/api/DeployApi.js +++ /dev/null @@ -1,124 +0,0 @@ -const MainApi = require("./MainApi") -const MachineHelper = require("../helpers/MachineHelper") -const { - DEFAULT_BRANCH_TO_PUSH, - DEFAULT_APP_NAME -} = require("../utils/constants") - -class DeployApi { - constructor() { - this.machineToDeploy = {} - - this.branchToPush = DEFAULT_BRANCH_TO_PUSH - - this.appName = DEFAULT_APP_NAME - - this.appUrl = "" - } - - setMachineToDeploy(machineToDeploy) { - this.machineToDeploy = machineToDeploy - } - - updateMachineToDeploy(machineToDeploy) { - let possibleMachine = {} - - // Look machine by host - if (machineToDeploy.startsWith("http")) { - possibleMachine = MachineHelper.machines.find( - machine => machine.baseUrl === machineToDeploy - ) - } else { - // Look machine by name - possibleMachine = MachineHelper.machines.find( - machine => machine.name === machineToDeploy - ) - } - - this.machineToDeploy = possibleMachine - } - - setBranchToPush(branchToPush) { - this.branchToPush = branchToPush - } - - setAppName(appName) { - this.appName = appName - - this.setAppUrl() - } - - setAppUrl() { - this.appUrl = this.machineToDeploy.baseUrl - .replace("//captain.", "//" + this.appName + ".") - .replace("https://", "http://") - } - - async fetchBuildLogs() { - try { - const { authToken, baseUrl } = this.machineToDeploy - const customOptions = { - headers: { - "x-captain-auth": authToken - } - } - const data = await MainApi.get( - `${baseUrl}/api/v1/user/appData/${this.appName}`, - customOptions - ) - - return data - } catch (e) { - throw e - } - } - - async sendFile(sourceFile, gitHash) { - try { - const { authToken, baseUrl } = this.machineToDeploy - const url = `${baseUrl}/api/v1/user/appData/${this.appName}/?detached=1` - const form = { - sourceFile, - gitHash - } - const options = { - headers: { - "x-captain-auth": authToken - } - } - const data = await MainApi.postWithFile(url, form, options) - - return data - } catch (e) { - throw e - } - } - - // This is not moved to LoginAPI since it's related only for machineToDeploy - async isAuthTokenValid() { - try { - if (!this.machineToDeploy) return false - - const url = `${this.machineToDeploy.baseUrl}/api/v1/user/appDefinitions/` - const currentToken = this.machineToDeploy.authToken - const options = { - headers: { - "x-captain-auth": currentToken - } - } - const response = await MainApi.get(url, options) - const data = JSON.parse(response) - - // Tolken is not valid - if (data.status === 1106 || data.status === 1105) { - return false - } - - return true - } catch (e) { - throw e - } - } -} - -module.exports = new DeployApi() diff --git a/app-cli/src/api/DeployApi.ts b/app-cli/src/api/DeployApi.ts new file mode 100644 index 0000000..890a7cc --- /dev/null +++ b/app-cli/src/api/DeployApi.ts @@ -0,0 +1,109 @@ +import { IMachine } from '../models/IModels'; +import MachineHelper from '../helpers/MachineHelper'; + +const MainApi = require('./MainApi'); +const { DEFAULT_BRANCH_TO_PUSH, DEFAULT_APP_NAME } = require('../utils/constants'); + +class DeployApi { + private machineToDeploy: IMachine | undefined; + private branchToPush = DEFAULT_BRANCH_TO_PUSH; + private appName = DEFAULT_APP_NAME; + private appUrl = ''; + + setMachineToDeploy(machineToDeploy: IMachine) { + this.machineToDeploy = machineToDeploy; + } + + updateMachineToDeploy(machineToDeploy: string) { + let possibleMachine = {}; + + // Look machine by host + if (machineToDeploy.startsWith('http')) { + this.machineToDeploy = MachineHelper.getMachines().find((machine) => machine.baseUrl === machineToDeploy)!; + } else { + // Look machine by name + this.machineToDeploy = MachineHelper.getMachines().find((machine) => machine.name === machineToDeploy)!; + } + } + + setBranchToPush(branchToPush: string) { + this.branchToPush = branchToPush; + } + + setAppName(appName: string) { + this.appName = appName; + + this.setAppUrl(); + } + + setAppUrl() { + this.appUrl = this.machineToDeploy!.baseUrl + .replace('//captain.', '//' + this.appName + '.') + .replace('https://', 'http://'); + } + + async fetchBuildLogs() { + try { + const { authToken, baseUrl } = this.machineToDeploy!; + const customOptions = { + headers: { + 'x-captain-auth': authToken + } + }; + const data = await MainApi.get(`${baseUrl}/api/v1/user/appData/${this.appName}`, customOptions); + + return data; + } catch (e) { + throw e; + } + } + + async sendFile(sourceFile: string, gitHash: string) { + try { + const { authToken, baseUrl } = this.machineToDeploy!; + const url = `${baseUrl}/api/v1/user/appData/${this.appName}/?detached=1`; + const form = { + sourceFile, + gitHash + }; + const options = { + headers: { + 'x-captain-auth': authToken + } + }; + const data = await MainApi.postWithFile(url, form, options); + + return data; + } catch (e) { + throw e; + } + } + + // This is not moved to LoginAPI since it's related only for machineToDeploy + async isAuthTokenValid() { + try { + if (!this.machineToDeploy) return false; + + const url = `${this.machineToDeploy.baseUrl}/api/v1/user/appDefinitions/`; + const currentToken = this.machineToDeploy.authToken; + const options = { + headers: { + 'x-captain-auth': currentToken + } + }; + const response = await MainApi.get(url, options); + const data = JSON.parse(response); + + // Tolken is not valid + if (data.status === 1106 || data.status === 1105) { + return false; + } + + return true; + } catch (e) { + throw e; + } + } +} + +export = new DeployApi(); diff --git a/app-cli/src/api/LoginApi.js b/app-cli/src/api/LoginApi.js deleted file mode 100644 index 0a4ec4a..0000000 --- a/app-cli/src/api/LoginApi.js +++ /dev/null @@ -1,63 +0,0 @@ -const MainApi = require("./MainApi") -const SystemApi = require("./SystemApi") -const { DEFAULT_PASSWORD } = require("../utils/constants") - -class LoginApi { - constructor() { - this.token = "" - - this.oldPassword = DEFAULT_PASSWORD - } - - setOldPassword(newPassword) { - this.oldPassword = newPassword - } - - setToken(newToken) { - this.token = newToken - } - - async loginMachine(baseUrl, password) { - try { - const data = await MainApi.post(`${baseUrl}/api/v1/login`, { password }) - const dataAsObject = JSON.parse(data) - - if (dataAsObject) { - this.setToken(dataAsObject.token) - } - - return data - } catch (e) { - throw e - } - } - - async changePass(baseUrl, newPassword) { - try { - const customOptions = { - headers: { - "x-captain-auth": LoginApi.token - } - } - const form = { - oldPassword: this.oldPassword, - newPassword - } - const data = await MainApi.post( - `${baseUrl}/api/v1/user/changepassword/`, - form, - customOptions - ) - - this.setToken(data.token) - - SystemApi.setIpAddressOfServer(baseUrl) - - return data - } catch (e) { - throw e - } - } -} - -module.exports = new LoginApi() diff --git a/app-cli/src/api/LoginApi.ts b/app-cli/src/api/LoginApi.ts new file mode 100644 index 0000000..0ac8d97 --- /dev/null +++ b/app-cli/src/api/LoginApi.ts @@ -0,0 +1,56 @@ +const MainApi = require('./MainApi'); +const SystemApi = require('./SystemApi'); +const { DEFAULT_PASSWORD } = require('../utils/constants'); + +class LoginApi { + private token = ''; + private oldPassword = DEFAULT_PASSWORD; + + setOldPassword(newPassword: string) { + this.oldPassword = newPassword; + } + + setToken(newToken: string) { + this.token = newToken; + } + + async loginMachine(baseUrl: string, password: string) { + try { + const data = await MainApi.post(`${baseUrl}/api/v1/login`, { password }); + const dataAsObject = JSON.parse(data); + + if (dataAsObject) { + this.setToken(dataAsObject.token); + } + + return data; + } catch (e) { + throw e; + } + } + + async changePass(baseUrl: string, newPassword: string) { + try { + const customOptions = { + headers: { + 'x-captain-auth': this.token + } + }; + const form = { + oldPassword: this.oldPassword, + newPassword + }; + const data = await MainApi.post(`${baseUrl}/api/v1/user/changepassword/`, form, customOptions); + + this.setToken(data.token); + + SystemApi.setIpAddressOfServer(baseUrl); + + return data; + } catch (e) { + throw e; + } + } +} + +export = new LoginApi(); diff --git a/app-cli/src/api/MainApi.js b/app-cli/src/api/MainApi.js deleted file mode 100644 index 7cacc75..0000000 --- a/app-cli/src/api/MainApi.js +++ /dev/null @@ -1,97 +0,0 @@ -const Request = require("request-promise") - -class MainApi { - constructor() { - this.sharedOptions = { - headers: { - "x-namespace": "captain" - } - } - } - - _buildOptions(options) { - if (!options) return this.sharedOptions - - if (options.headers) { - options.headers = Object.assign( - {}, - this.sharedOptions.headers, - options.headers - ) - } - - return Object.assign({}, this.sharedOptions, options) - } - - get(url, options) { - const overrideOptions = this._buildOptions(options) - const optionsToSend = { - ...overrideOptions, - url, - method: "GET" - } - - return Request(optionsToSend) - } - - post(url, form, options) { - const overrideOptions = this._buildOptions(options) - const optionsToSend = { - ...overrideOptions, - url, - method: "POST", - form - } - - return Request(optionsToSend) - } - - postWithFile(url, formData, options) { - const overrideOptions = this._buildOptions(options) - const optionsToSend = { - ...overrideOptions, - url, - method: "POST", - formData - } - - return Request(optionsToSend) - } - - put(url, form, options) { - const overrideOptions = this._buildOptions(options) - const optionsToSend = { - ...overrideOptions, - url, - method: "PUT", - form - } - - return Request(optionsToSend) - } - - patch(url, form, options) { - const overrideOptions = this._buildOptions(options) - const optionsToSend = { - ...overrideOptions, - url, - method: "PATCH", - form - } - - return Request(optionsToSend) - } - - delete(url, options) { - const overrideOptions = this._buildOptions(options) - const optionsToSend = { - ...overrideOptions, - url, - method: "DELETE" - } - - return Request(optionsToSend) - } -} - -module.exports = new MainApi() diff --git a/app-cli/src/api/MainApi.ts b/app-cli/src/api/MainApi.ts new file mode 100644 index 0000000..fd0486a --- /dev/null +++ b/app-cli/src/api/MainApi.ts @@ -0,0 +1,99 @@ +import * as Request from 'request-promise'; + +interface IOptions { + headers: any; +} + +class MainApi { + private sharedOptions: any; + constructor() { + this.sharedOptions = { + headers: { + 'x-namespace': 'captain' + } + }; + } + + _buildOptions(options: IOptions) { + if (!options) return this.sharedOptions; + + if (options.headers) { + options.headers = Object.assign({}, this.sharedOptions.headers, options.headers); + } + + return Object.assign({}, this.sharedOptions, options); + } + + get(url: string, options: IOptions) { + const overrideOptions = this._buildOptions(options); + const optionsToSend = { + ...overrideOptions, + url, + method: 'GET' + }; + + return Request(optionsToSend); + } + + post(url: string, form: any, options: IOptions) { + const overrideOptions = this._buildOptions(options); + const optionsToSend = { + ...overrideOptions, + url, + method: 'POST', + form + }; + + return Request(optionsToSend); + } + + postWithFile(url: string, formData: any, options: IOptions) { + const overrideOptions = this._buildOptions(options); + const optionsToSend = { + ...overrideOptions, + url, + method: 'POST', + formData + }; + + return Request(optionsToSend); + } + + put(url: string, form: any, options: IOptions) { + const overrideOptions = this._buildOptions(options); + const optionsToSend = { + ...overrideOptions, + url, + method: 'PUT', + form + }; + + return Request(optionsToSend); + } + + patch(url: string, form: any, options: IOptions) { + const overrideOptions = this._buildOptions(options); + const optionsToSend = { + ...overrideOptions, + url, + method: 'PATCH', + form + }; + + return Request(optionsToSend); + } + + delete(url: string, options: IOptions) { + const overrideOptions = this._buildOptions(options); + const optionsToSend = { + ...overrideOptions, + url, + method: 'DELETE' + }; + + return Request(optionsToSend); + } +} + +const instance = new MainApi(); +export = instance; diff --git a/app-cli/src/api/SystemApi.js b/app-cli/src/api/SystemApi.js deleted file mode 100644 index 5eed530..0000000 --- a/app-cli/src/api/SystemApi.js +++ /dev/null @@ -1,87 +0,0 @@ -const MainApi = require("./MainApi") -const LoginApi = require("./LoginApi") -// const spinnerUtil = require("../../utils/spinner") - -class SystemApi { - constructor() { - this.ipAddressOfServer = "" - - this.customDomainFromUser = "" - - this.newPasswordFirstTry = "" - } - - setCustomDomainFromUser(newCustomDomainFromUser) { - this.customDomainFromUser = newCustomDomainFromUser - } - - setIpAddressOfServer(newIpAddress) { - this.ipAddressOfServer = newIpAddress.trim() - } - - async setCustomDomain(baseUrl, rootDomain) { - try { - const customOptions = { - headers: { - "x-captain-auth": LoginApi.token - } - } - const data = await MainApi.post( - `${baseUrl}/api/v1/user/system/changerootdomain/`, - { - rootDomain - }, - customOptions - ) - - return data - } catch (e) { - throw e - } - } - - async enableHttps(baseUrl, emailAddress) { - const customOptions = { - headers: { - "x-captain-auth": LoginApi.token - } - } - - try { - const data = await MainApi.post( - `${baseUrl}/api/v1/user/system/enablessl/`, - { - emailAddress - }, - customOptions - ) - - return data - } catch (e) { - throw e - } - } - - async forceHttps(baseUrl, isEnabled = true) { - try { - const customOptions = { - headers: { - "x-captain-auth": LoginApi.token - } - } - const data = await MainApi.post( - `${baseUrl}/api/v1/user/system/forcessl/`, - { - isEnabled - }, - customOptions - ) - - return data - } catch (e) { - throw e - } - } -} - -module.exports = new SystemApi() diff --git a/app-cli/src/api/SystemApi.ts b/app-cli/src/api/SystemApi.ts new file mode 100644 index 0000000..457e008 --- /dev/null +++ b/app-cli/src/api/SystemApi.ts @@ -0,0 +1,83 @@ +const MainApi = require('./MainApi'); +const LoginApi = require('./LoginApi'); +// const spinnerUtil = require("../../utils/spinner") + +class SystemApi { + private ipAddressOfServer = ''; + private customDomainFromUser = ''; + private newPasswordFirstTry = ''; + + setCustomDomainFromUser(newCustomDomainFromUser: string) { + this.customDomainFromUser = newCustomDomainFromUser; + } + + setIpAddressOfServer(newIpAddress: string) { + this.ipAddressOfServer = newIpAddress.trim(); + } + + async setCustomDomain(baseUrl: string, rootDomain: string) { + try { + const customOptions = { + headers: { + 'x-captain-auth': LoginApi.token + } + }; + const data = await MainApi.post( + `${baseUrl}/api/v1/user/system/changerootdomain/`, + { + rootDomain + }, + customOptions + ); + + return data; + } catch (e) { + throw e; + } + } + + async enableHttps(baseUrl: string, emailAddress: string) { + const customOptions = { + headers: { + 'x-captain-auth': LoginApi.token + } + }; + + try { + const data = await MainApi.post( + `${baseUrl}/api/v1/user/system/enablessl/`, + { + emailAddress + }, + customOptions + ); + + return data; + } catch (e) { + throw e; + } + } + + async forceHttps(baseUrl:string, isEnabled = true) { + try { + const customOptions = { + headers: { + 'x-captain-auth': LoginApi.token + } + }; + const data = await MainApi.post( + `${baseUrl}/api/v1/user/system/forcessl/`, + { + isEnabled + }, + customOptions + ); + + return data; + } catch (e) { + throw e; + } + } +} + +export = new SystemApi(); From 23e19ddbe913cba0bdcd602e56bf5a5bb37e3d99 Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Fri, 4 Jan 2019 00:04:08 -0800 Subject: [PATCH 34/44] fixed conversion bugs --- app-cli/built/commands/logout.js | 6 +++--- app-cli/built/commands/logout.js.map | 2 +- app-cli/built/helpers/MachineHelper.js | 3 +++ app-cli/built/helpers/MachineHelper.js.map | 2 +- app-cli/built/utils/machineUtils.js | 10 +++++----- app-cli/built/utils/machineUtils.js.map | 2 +- app-cli/src/commands/logout.ts | 2 +- app-cli/src/helpers/MachineHelper.ts | 4 ++++ app-cli/src/utils/machineUtils.ts | 6 +++--- 9 files changed, 22 insertions(+), 15 deletions(-) diff --git a/app-cli/built/commands/logout.js b/app-cli/built/commands/logout.js index 2693deb..db37de5 100755 --- a/app-cli/built/commands/logout.js +++ b/app-cli/built/commands/logout.js @@ -8,11 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -const MachineHelper = require('../helpers/MachineHelper'); +const MachineHelper_1 = require("../helpers/MachineHelper"); const { printMessage } = require('../utils/messageHandler'); const inquirer = require('inquirer'); function generateQuestions() { - const listOfMachines = MachineHelper.getMachinesAsOptions(); + const listOfMachines = MachineHelper_1.default.getMachinesAsOptions(); return [ { type: 'list', @@ -38,7 +38,7 @@ function logout() { if (!captainNameToLogout) { printMessage('\nOperation cancelled by the user...\n', true); } - MachineHelper.logoutMachine(captainNameToLogout); + MachineHelper_1.default.logoutMachine(captainNameToLogout); }); } module.exports = logout; diff --git a/app-cli/built/commands/logout.js.map b/app-cli/built/commands/logout.js.map index 26dfc25..fbe09bd 100755 --- a/app-cli/built/commands/logout.js.map +++ b/app-cli/built/commands/logout.js.map @@ -1 +1 @@ -{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../src/commands/logout.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAC1D,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAC5D,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAErC,SAAS,iBAAiB;IACzB,MAAM,cAAc,GAAG,aAAa,CAAC,oBAAoB,EAAE,CAAC;IAE5D,OAAO;QACN;YACC,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,qBAAqB;YAC3B,OAAO,EAAE,qDAAqD;YAC9D,OAAO,EAAE,cAAc;SACvB;QACD;YACC,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,4DAA4D;YACrE,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,CAAC,OAAY,EAAE,EAAE,CAAC,OAAO,CAAC,mBAAmB;SACnD;KACD,CAAC;AACH,CAAC;AAED,SAAe,MAAM;;QACpB,MAAM,SAAS,GAAG,iBAAiB,EAAE,CAAC;QAEtC,YAAY,CAAC,mDAAmD,CAAC,CAAC;QAElE,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACjD,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC;QAExC,IAAI,CAAC,mBAAmB,EAAE;YACzB,YAAY,CAAC,wCAAwC,EAAE,IAAI,CAAC,CAAC;SAC7D;QAED,aAAa,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC;IAClD,CAAC;CAAA;AAED,iBAAS,MAAM,CAAC"} \ No newline at end of file +{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../src/commands/logout.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,4DAAqD;AACrD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAC5D,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAErC,SAAS,iBAAiB;IACzB,MAAM,cAAc,GAAG,uBAAa,CAAC,oBAAoB,EAAE,CAAC;IAE5D,OAAO;QACN;YACC,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,qBAAqB;YAC3B,OAAO,EAAE,qDAAqD;YAC9D,OAAO,EAAE,cAAc;SACvB;QACD;YACC,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,4DAA4D;YACrE,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,CAAC,OAAY,EAAE,EAAE,CAAC,OAAO,CAAC,mBAAmB;SACnD;KACD,CAAC;AACH,CAAC;AAED,SAAe,MAAM;;QACpB,MAAM,SAAS,GAAG,iBAAiB,EAAE,CAAC;QAEtC,YAAY,CAAC,mDAAmD,CAAC,CAAC;QAElE,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACjD,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC;QAExC,IAAI,CAAC,mBAAmB,EAAE;YACzB,YAAY,CAAC,wCAAwC,EAAE,IAAI,CAAC,CAAC;SAC7D;QAED,uBAAa,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC;IAClD,CAAC;CAAA;AAED,iBAAS,MAAM,CAAC"} \ No newline at end of file diff --git a/app-cli/built/helpers/MachineHelper.js b/app-cli/built/helpers/MachineHelper.js index 89b2ff3..da08680 100755 --- a/app-cli/built/helpers/MachineHelper.js +++ b/app-cli/built/helpers/MachineHelper.js @@ -31,6 +31,9 @@ class MachineHelper { getMachines() { return this.machines; } + getApps() { + return this.apps; + } setMachines(newMachines) { this.machines = newMachines; configs.set('captainMachines', newMachines); diff --git a/app-cli/built/helpers/MachineHelper.js.map b/app-cli/built/helpers/MachineHelper.js.map index 789e74b..773ad9f 100755 --- a/app-cli/built/helpers/MachineHelper.js.map +++ b/app-cli/built/helpers/MachineHelper.js.map @@ -1 +1 @@ -{"version":3,"file":"MachineHelper.js","sourceRoot":"","sources":["../../src/helpers/MachineHelper.ts"],"names":[],"mappings":";;AAEA,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAC5D,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAC3C,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAClD,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE;IACjD,eAAe,EAAE,EAAE;CACnB,CAAC,CAAC;AAEH,MAAM,aAAa;IAGlB;QACC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAE/C,IAAI,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C,+BAA+B,cAAc,CAAC,IAAI,OAAO,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC;IACtG,CAAC;CACD;AAED,MAAM,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;AAErC,kBAAe,QAAQ,CAAC"} \ No newline at end of file +{"version":3,"file":"MachineHelper.js","sourceRoot":"","sources":["../../src/helpers/MachineHelper.ts"],"names":[],"mappings":";;AAEA,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAC5D,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAC3C,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAClD,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE;IACjD,eAAe,EAAE,EAAE;CACnB,CAAC,CAAC;AAEH,MAAM,aAAa;IAGlB;QACC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAE/C,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAED,oBAAoB;QACnB,MAAM,iBAAiB,GAAG;YACzB;gBACC,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE,EAAE;gBACT,KAAK,EAAE,EAAE;aACT;SACD,CAAC;QACF,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;YACpD,OAAO;gBACN,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,OAAO,OAAO,CAAC,OAAO,EAAE;gBAC7C,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE;gBACxB,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,OAAO,OAAO,CAAC,OAAO,EAAE;aAC9C,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,CAAE,GAAG,iBAAiB,EAAE,GAA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AC,CAAC;IAC9B,CAAC;IAED,UAAU,CAAC,UAAoB;QAC9B,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;QACnC,MAAM,WAAW,GAAG,CAAE,GAAG,YAAY,EAAE,UAAU,CAAE,CAAC;QAEpD,uBAAuB;QACvB,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC;QAE5C,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAClD,CAAC;IAED,aAAa,CAAC,WAAmB;QAChC,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1F,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC;QAEpF,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAE9B,YAAY,CAAC,+BAA+B,cAAc,CAAC,IAAI,OAAO,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC;IACtG,CAAC;CACD;AAED,MAAM,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;AAErC,kBAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/app-cli/built/utils/machineUtils.js b/app-cli/built/utils/machineUtils.js index a955848..85ebd35 100755 --- a/app-cli/built/utils/machineUtils.js +++ b/app-cli/built/utils/machineUtils.js @@ -1,8 +1,8 @@ "use strict"; const DeployApi = require('../api/DeployApi'); -const MachineHelper = require('../helpers/MachineHelper'); +const MachineHelper_1 = require("../helpers/MachineHelper"); function initMachineFromLocalStorage() { - const possibleApp = MachineHelper.apps.find((app) => app.cwd === process.cwd()); + const possibleApp = MachineHelper_1.default.getApps().find((app) => app.cwd === process.cwd()); if (possibleApp) { DeployApi.setMachineToDeploy(possibleApp.machineToDeploy); DeployApi.setAppName(possibleApp.appName); @@ -11,7 +11,7 @@ function initMachineFromLocalStorage() { } // Saves the app directory into local storage function saveMachineToLocalStorage() { - const apps = MachineHelper.apps; + const apps = MachineHelper_1.default.getApps(); const currentDirectory = process.cwd(); let appExists = false; // Update app @@ -27,7 +27,7 @@ function saveMachineToLocalStorage() { } return app; }); - MachineHelper.setApps(updatedApps); + MachineHelper_1.default.setApps(updatedApps); if (!appExists) { const newApp = { cwd: process.cwd(), @@ -36,7 +36,7 @@ function saveMachineToLocalStorage() { machineToDeploy: DeployApi.machineToDeploy }; updatedApps.push(newApp); - MachineHelper.setApps(apps); + MachineHelper_1.default.setApps(apps); } } module.exports = { diff --git a/app-cli/built/utils/machineUtils.js.map b/app-cli/built/utils/machineUtils.js.map index 906656f..0b31fed 100755 --- a/app-cli/built/utils/machineUtils.js.map +++ b/app-cli/built/utils/machineUtils.js.map @@ -1 +1 @@ -{"version":3,"file":"machineUtils.js","sourceRoot":"","sources":["../../src/utils/machineUtils.ts"],"names":[],"mappings":";AAEA,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC9C,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAE1D,SAAS,2BAA2B;IACnC,MAAM,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAS,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAEtF,IAAI,WAAW,EAAE;QAChB,SAAS,CAAC,kBAAkB,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;QAE1D,SAAS,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAE1C,SAAS,CAAC,eAAe,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;KACpD;AACF,CAAC;AAED,6CAA6C;AAC7C,SAAS,yBAAyB;IACjC,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC;IAChC,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IACvC,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,aAAa;IACb,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAS,EAAE,EAAE;QAC1C,IAAI,GAAG,CAAC,GAAG,KAAK,gBAAgB,EAAE;YACjC,SAAS,GAAG,IAAI,CAAC;YAEjB,OAAO;gBACN,GAAG,EAAE,GAAG,CAAC,GAAG;gBACZ,OAAO,EAAE,SAAS,CAAC,OAAO;gBAC1B,YAAY,EAAE,SAAS,CAAC,YAAY;gBACpC,eAAe,EAAE,SAAS,CAAC,eAAe;aAC1C,CAAC;SACF;QAED,OAAO,GAAG,CAAC;IACZ,CAAC,CAAC,CAAC;IAEH,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAEnC,IAAI,CAAC,SAAS,EAAE;QACf,MAAM,MAAM,GAAG;YACd,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;YAClB,OAAO,EAAE,SAAS,CAAC,OAAO;YAC1B,YAAY,EAAE,SAAS,CAAC,YAAY;YACpC,eAAe,EAAE,SAAS,CAAC,eAAe;SAC1C,CAAC;QAEF,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAEzB,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KAC5B;AACF,CAAC;AAED,iBAAS;IACR,2BAA2B;IAC3B,yBAAyB;CACzB,CAAC"} \ No newline at end of file +{"version":3,"file":"machineUtils.js","sourceRoot":"","sources":["../../src/utils/machineUtils.ts"],"names":[],"mappings":";AAEA,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC9C,4DAAqD;AAErD,SAAS,2BAA2B;IACnC,MAAM,WAAW,GAAG,uBAAa,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,GAAS,EAAE,EAAE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AC;KAC5B;AACF,CAAC;AAED,iBAAS;IACR,2BAA2B;IAC3B,yBAAyB;CACzB,CAAC"} \ No newline at end of file diff --git a/app-cli/src/commands/logout.ts b/app-cli/src/commands/logout.ts index 27547a7..a9ee590 100644 --- a/app-cli/src/commands/logout.ts +++ b/app-cli/src/commands/logout.ts @@ -1,6 +1,6 @@ #!/usr/bin/env node -const MachineHelper = require('../helpers/MachineHelper'); +import MachineHelper from '../helpers/MachineHelper'; const { printMessage } = require('../utils/messageHandler'); const inquirer = require('inquirer'); diff --git a/app-cli/src/helpers/MachineHelper.ts b/app-cli/src/helpers/MachineHelper.ts index ac3509b..8d26b1d 100644 --- a/app-cli/src/helpers/MachineHelper.ts +++ b/app-cli/src/helpers/MachineHelper.ts @@ -39,6 +39,10 @@ class MachineHelper { return this.machines; } + getApps() { + return this.apps; + } + setMachines(newMachines: IMachine[]) { this.machines = newMachines; diff --git a/app-cli/src/utils/machineUtils.ts b/app-cli/src/utils/machineUtils.ts index 88b2c23..f85691b 100644 --- a/app-cli/src/utils/machineUtils.ts +++ b/app-cli/src/utils/machineUtils.ts @@ -1,10 +1,10 @@ import { IApp } from '../models/IModels'; const DeployApi = require('../api/DeployApi'); -const MachineHelper = require('../helpers/MachineHelper'); +import MachineHelper from '../helpers/MachineHelper'; function initMachineFromLocalStorage() { - const possibleApp = MachineHelper.apps.find((app: IApp) => app.cwd === process.cwd()); + const possibleApp = MachineHelper.getApps().find((app: IApp) => app.cwd === process.cwd()); if (possibleApp) { DeployApi.setMachineToDeploy(possibleApp.machineToDeploy); @@ -17,7 +17,7 @@ function initMachineFromLocalStorage() { // Saves the app directory into local storage function saveMachineToLocalStorage() { - const apps = MachineHelper.apps; + const apps = MachineHelper.getApps(); const currentDirectory = process.cwd(); let appExists = false; // Update app From d01b9f3f2b0dafd4a281ae2e834282d7ee25f126 Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Sat, 5 Jan 2019 13:08:16 -0800 Subject: [PATCH 35/44] Login working --- app-cli/built/api/ApiManager.js | 279 + app-cli/built/api/ApiManager.js.map | 1 + app-cli/built/api/CliApiManager.js | 30 + app-cli/built/api/CliApiManager.js.map | 1 + app-cli/built/api/DeployApi.js | 112 - app-cli/built/api/DeployApi.js.map | 1 - app-cli/built/api/HttpClient.js | 122 + app-cli/built/api/HttpClient.js.map | 1 + app-cli/built/api/LoginApi.js | 63 - app-cli/built/api/LoginApi.js.map | 1 - app-cli/built/api/MainApi.js | 52 - app-cli/built/api/MainApi.js.map | 1 - app-cli/built/api/SystemApi.js | 81 - app-cli/built/api/SystemApi.js.map | 1 - app-cli/built/commands/captainduckduck.js | 72 +- app-cli/built/commands/captainduckduck.js.map | 2 +- app-cli/built/commands/deploy.js | 186 - app-cli/built/commands/deploy.js.map | 1 - app-cli/built/commands/list.js | 17 - app-cli/built/commands/list.js.map | 1 - app-cli/built/commands/login.js | 107 +- app-cli/built/commands/login.js.map | 2 +- app-cli/built/commands/logout.js | 45 - app-cli/built/commands/logout.js.map | 1 - app-cli/built/commands/serversetup.js | 185 - app-cli/built/commands/serversetup.js.map | 1 - app-cli/built/helpers/MachineHelper.js | 84 - app-cli/built/helpers/MachineHelper.js.map | 1 - .../built/models/{IModels.js => AppDef.js} | 2 +- app-cli/built/models/AppDef.js.map | 1 + app-cli/built/models/ICaptainDefinition.js | 3 + .../built/models/ICaptainDefinition.js.map | 1 + app-cli/built/models/IHashMapGeneric.js | 3 + app-cli/built/models/IHashMapGeneric.js.map | 1 + app-cli/built/models/IModels.js.map | 1 - app-cli/built/models/IOneClickAppModels.js | 3 + .../built/models/IOneClickAppModels.js.map | 1 + app-cli/built/models/IRegistryInfo.js | 8 + app-cli/built/models/IRegistryInfo.js.map | 1 + app-cli/built/models/IVersionInfo.js | 3 + app-cli/built/models/IVersionInfo.js.map | 1 + app-cli/built/models/storage/StoredObjects.js | 3 + .../built/models/storage/StoredObjects.js.map | 1 + app-cli/built/utils/CliHelper.js | 34 + app-cli/built/utils/CliHelper.js.map | 1 + .../utils/{constants.js => Constants.js} | 5 +- app-cli/built/utils/Constants.js.map | 1 + app-cli/built/utils/ErrorFactory.js | 31 + app-cli/built/utils/ErrorFactory.js.map | 1 + app-cli/built/utils/Logger.js | 17 + app-cli/built/utils/Logger.js.map | 1 + .../built/{helpers => utils}/SpinnerHelper.js | 4 +- .../{helpers => utils}/SpinnerHelper.js.map | 2 +- app-cli/built/utils/StdOutUtil.js | 34 + app-cli/built/utils/StdOutUtil.js.map | 1 + app-cli/built/utils/StorageHelper.js | 57 + app-cli/built/utils/StorageHelper.js.map | 1 + app-cli/built/utils/Utils.js | 35 + app-cli/built/utils/Utils.js.map | 1 + .../utils/__tests__/loginHelpers.test.js | 37 - .../utils/__tests__/loginHelpers.test.js.map | 1 - .../utils/__tests__/machineUtils.test.js | 60 - .../utils/__tests__/machineUtils.test.js.map | 1 - .../__tests__/validationsHandler.test.js | 75 - .../__tests__/validationsHandler.test.js.map | 1 - app-cli/built/utils/constants.js.map | 1 - app-cli/built/utils/fileHelper.js | 146 - app-cli/built/utils/fileHelper.js.map | 1 - app-cli/built/utils/loginHelpers.js | 34 - app-cli/built/utils/loginHelpers.js.map | 1 - app-cli/built/utils/machineUtils.js | 46 - app-cli/built/utils/machineUtils.js.map | 1 - app-cli/built/utils/messageHandler.js | 38 - app-cli/built/utils/messageHandler.js.map | 1 - app-cli/built/utils/validationsHandler.js | 84 - app-cli/built/utils/validationsHandler.js.map | 1 - app-cli/package-lock.json | 6415 ----------------- app-cli/package.json | 7 +- app-cli/src/api/ApiManager.ts | 390 + app-cli/src/api/CliApiManager.ts | 33 + app-cli/src/api/DeployApi.ts | 109 - app-cli/src/api/HttpClient.ts | 124 + app-cli/src/api/LoginApi.ts | 56 - app-cli/src/api/MainApi.ts | 99 - app-cli/src/api/SystemApi.ts | 83 - app-cli/src/commands/captainduckduck.ts | 76 +- app-cli/src/commands/deploy.ts | 200 - app-cli/src/commands/list.ts | 22 - app-cli/src/commands/login.ts | 109 +- app-cli/src/commands/logout.ts | 42 - app-cli/src/commands/serversetup.ts | 218 - app-cli/src/helpers/MachineHelper.ts | 117 - app-cli/src/models/AppDef.ts | 93 + app-cli/src/models/ICaptainDefinition.ts | 6 + app-cli/src/models/IHashMapGeneric.ts | 3 + app-cli/src/models/IOneClickAppModels.ts | 36 + app-cli/src/models/IRegistryInfo.ts | 20 + app-cli/src/models/IVersionInfo.ts | 5 + .../{IModels.ts => storage/StoredObjects.ts} | 17 +- app-cli/src/utils/CliHelper.ts | 40 + .../src/utils/{constants.ts => Constants.ts} | 2 +- app-cli/src/utils/ErrorFactory.ts | 34 + app-cli/src/utils/Logger.ts | 15 + .../src/{helpers => utils}/SpinnerHelper.ts | 2 +- app-cli/src/utils/StdOutUtil.ts | 39 + app-cli/src/utils/StorageHelper.ts | 68 + app-cli/src/utils/Utils.ts | 41 + .../src/utils/__tests__/loginHelpers.test.js | 47 - .../src/utils/__tests__/machineUtils.test.js | 71 - .../__tests__/validationsHandler.test.js | 92 - app-cli/src/utils/fileHelper.ts | 169 - app-cli/src/utils/loginHelpers.ts | 44 - app-cli/src/utils/machineUtils.ts | 58 - app-cli/src/utils/messageHandler.ts | 46 - app-cli/src/utils/validationsHandler.ts | 94 - app-cli/yarn.lock | 5865 +++++++++++++++ 116 files changed, 7700 insertions(+), 9546 deletions(-) create mode 100755 app-cli/built/api/ApiManager.js create mode 100755 app-cli/built/api/ApiManager.js.map create mode 100755 app-cli/built/api/CliApiManager.js create mode 100755 app-cli/built/api/CliApiManager.js.map delete mode 100755 app-cli/built/api/DeployApi.js delete mode 100755 app-cli/built/api/DeployApi.js.map create mode 100755 app-cli/built/api/HttpClient.js create mode 100755 app-cli/built/api/HttpClient.js.map delete mode 100755 app-cli/built/api/LoginApi.js delete mode 100755 app-cli/built/api/LoginApi.js.map delete mode 100755 app-cli/built/api/MainApi.js delete mode 100755 app-cli/built/api/MainApi.js.map delete mode 100755 app-cli/built/api/SystemApi.js delete mode 100755 app-cli/built/api/SystemApi.js.map delete mode 100755 app-cli/built/commands/deploy.js delete mode 100755 app-cli/built/commands/deploy.js.map delete mode 100755 app-cli/built/commands/list.js delete mode 100755 app-cli/built/commands/list.js.map delete mode 100755 app-cli/built/commands/logout.js delete mode 100755 app-cli/built/commands/logout.js.map delete mode 100755 app-cli/built/commands/serversetup.js delete mode 100755 app-cli/built/commands/serversetup.js.map delete mode 100755 app-cli/built/helpers/MachineHelper.js delete mode 100755 app-cli/built/helpers/MachineHelper.js.map rename app-cli/built/models/{IModels.js => AppDef.js} (68%) create mode 100755 app-cli/built/models/AppDef.js.map create mode 100755 app-cli/built/models/ICaptainDefinition.js create mode 100755 app-cli/built/models/ICaptainDefinition.js.map create mode 100755 app-cli/built/models/IHashMapGeneric.js create mode 100755 app-cli/built/models/IHashMapGeneric.js.map delete mode 100755 app-cli/built/models/IModels.js.map create mode 100755 app-cli/built/models/IOneClickAppModels.js create mode 100755 app-cli/built/models/IOneClickAppModels.js.map create mode 100755 app-cli/built/models/IRegistryInfo.js create mode 100755 app-cli/built/models/IRegistryInfo.js.map create mode 100755 app-cli/built/models/IVersionInfo.js create mode 100755 app-cli/built/models/IVersionInfo.js.map create mode 100755 app-cli/built/models/storage/StoredObjects.js create mode 100755 app-cli/built/models/storage/StoredObjects.js.map create mode 100755 app-cli/built/utils/CliHelper.js create mode 100755 app-cli/built/utils/CliHelper.js.map rename app-cli/built/utils/{constants.js => Constants.js} (76%) create mode 100755 app-cli/built/utils/Constants.js.map create mode 100755 app-cli/built/utils/ErrorFactory.js create mode 100755 app-cli/built/utils/ErrorFactory.js.map create mode 100755 app-cli/built/utils/Logger.js create mode 100755 app-cli/built/utils/Logger.js.map rename app-cli/built/{helpers => utils}/SpinnerHelper.js (77%) rename app-cli/built/{helpers => utils}/SpinnerHelper.js.map (75%) create mode 100755 app-cli/built/utils/StdOutUtil.js create mode 100755 app-cli/built/utils/StdOutUtil.js.map create mode 100755 app-cli/built/utils/StorageHelper.js create mode 100755 app-cli/built/utils/StorageHelper.js.map create mode 100755 app-cli/built/utils/Utils.js create mode 100755 app-cli/built/utils/Utils.js.map delete mode 100755 app-cli/built/utils/__tests__/loginHelpers.test.js delete mode 100755 app-cli/built/utils/__tests__/loginHelpers.test.js.map delete mode 100755 app-cli/built/utils/__tests__/machineUtils.test.js delete mode 100755 app-cli/built/utils/__tests__/machineUtils.test.js.map delete mode 100755 app-cli/built/utils/__tests__/validationsHandler.test.js delete mode 100755 app-cli/built/utils/__tests__/validationsHandler.test.js.map delete mode 100755 app-cli/built/utils/constants.js.map delete mode 100755 app-cli/built/utils/fileHelper.js delete mode 100755 app-cli/built/utils/fileHelper.js.map delete mode 100755 app-cli/built/utils/loginHelpers.js delete mode 100755 app-cli/built/utils/loginHelpers.js.map delete mode 100755 app-cli/built/utils/machineUtils.js delete mode 100755 app-cli/built/utils/machineUtils.js.map delete mode 100755 app-cli/built/utils/messageHandler.js delete mode 100755 app-cli/built/utils/messageHandler.js.map delete mode 100755 app-cli/built/utils/validationsHandler.js delete mode 100755 app-cli/built/utils/validationsHandler.js.map delete mode 100644 app-cli/package-lock.json create mode 100644 app-cli/src/api/ApiManager.ts create mode 100644 app-cli/src/api/CliApiManager.ts delete mode 100644 app-cli/src/api/DeployApi.ts create mode 100644 app-cli/src/api/HttpClient.ts delete mode 100644 app-cli/src/api/LoginApi.ts delete mode 100644 app-cli/src/api/MainApi.ts delete mode 100644 app-cli/src/api/SystemApi.ts delete mode 100644 app-cli/src/commands/deploy.ts delete mode 100644 app-cli/src/commands/list.ts delete mode 100644 app-cli/src/commands/logout.ts delete mode 100644 app-cli/src/commands/serversetup.ts delete mode 100644 app-cli/src/helpers/MachineHelper.ts create mode 100644 app-cli/src/models/AppDef.ts create mode 100644 app-cli/src/models/ICaptainDefinition.ts create mode 100644 app-cli/src/models/IHashMapGeneric.ts create mode 100644 app-cli/src/models/IOneClickAppModels.ts create mode 100644 app-cli/src/models/IRegistryInfo.ts create mode 100644 app-cli/src/models/IVersionInfo.ts rename app-cli/src/models/{IModels.ts => storage/StoredObjects.ts} (51%) create mode 100644 app-cli/src/utils/CliHelper.ts rename app-cli/src/utils/{constants.ts => Constants.ts} (95%) create mode 100644 app-cli/src/utils/ErrorFactory.ts create mode 100644 app-cli/src/utils/Logger.ts rename app-cli/src/{helpers => utils}/SpinnerHelper.ts (89%) create mode 100644 app-cli/src/utils/StdOutUtil.ts create mode 100644 app-cli/src/utils/StorageHelper.ts create mode 100644 app-cli/src/utils/Utils.ts delete mode 100644 app-cli/src/utils/__tests__/loginHelpers.test.js delete mode 100644 app-cli/src/utils/__tests__/machineUtils.test.js delete mode 100644 app-cli/src/utils/__tests__/validationsHandler.test.js delete mode 100644 app-cli/src/utils/fileHelper.ts delete mode 100644 app-cli/src/utils/loginHelpers.ts delete mode 100644 app-cli/src/utils/machineUtils.ts delete mode 100644 app-cli/src/utils/messageHandler.ts delete mode 100644 app-cli/src/utils/validationsHandler.ts create mode 100644 app-cli/yarn.lock diff --git a/app-cli/built/api/ApiManager.js b/app-cli/built/api/ApiManager.js new file mode 100755 index 0000000..f21679f --- /dev/null +++ b/app-cli/built/api/ApiManager.js @@ -0,0 +1,279 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const HttpClient_1 = require("./HttpClient"); +class ApiManager { + constructor(baseUrl, authTokenSaver) { + this.authTokenSaver = authTokenSaver; + const self = this; + this.http = new HttpClient_1.default(baseUrl, ApiManager.authToken, function () { + return self.getAuthToken(ApiManager.lastKnownPassword); + }); + } + destroy() { + this.http.destroy(); + } + setAuthToken(authToken) { + ApiManager.authToken = authToken; + this.http.setAuthToken(authToken); + } + static isLoggedIn() { + return !!ApiManager.authToken; + } + getAuthToken(password) { + const http = this.http; + ApiManager.lastKnownPassword = password; + let authTokenFetched = ''; + const self = this; + return Promise.resolve() // + .then(http.fetch(http.POST, '/login', { password })) + .then(function (data) { + authTokenFetched = data.token; + self.setAuthToken(authTokenFetched); + return authTokenFetched; + }) + .then(self.authTokenSaver) + .then(function () { + return authTokenFetched; + }); + } + getCaptainInfo() { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.GET, '/user/system/info', {})); + } + updateRootDomain(rootDomain) { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/system/changerootdomain', { rootDomain })); + } + enableRootSsl(emailAddress) { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/system/enablessl', { emailAddress })); + } + forceSsl(isEnabled) { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/system/forcessl', { isEnabled })); + } + getAllApps() { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.GET, '/user/apps/appDefinitions', {})); + } + fetchBuildLogs(appName) { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.GET, '/user/apps/appData/' + appName, {})); + } + uploadAppData(appName, file) { + const http = this.http; + var formData = new FormData(); + formData.append('sourceFile', file); + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/apps/appData/' + appName + '?detached=1', formData)); + } + uploadCaptainDefinitionContent(appName, captainDefinition, gitHash, detached) { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/apps/appData/' + appName + (detached ? '?detached=1' : ''), { + captainDefinitionContent: JSON.stringify(captainDefinition), + gitHash + })); + } + updateConfigAndSave(appName, appDefinition) { + var instanceCount = appDefinition.instanceCount; + var envVars = appDefinition.envVars; + var notExposeAsWebApp = appDefinition.notExposeAsWebApp; + var forceSsl = appDefinition.forceSsl; + var volumes = appDefinition.volumes; + var ports = appDefinition.ports; + var nodeId = appDefinition.nodeId; + var appPushWebhook = appDefinition.appPushWebhook; + var customNginxConfig = appDefinition.customNginxConfig; + var preDeployFunction = appDefinition.preDeployFunction; + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/apps/appDefinitions/update', { + appName: appName, + instanceCount: instanceCount, + notExposeAsWebApp: notExposeAsWebApp, + forceSsl: forceSsl, + volumes: volumes, + ports: ports, + customNginxConfig: customNginxConfig, + appPushWebhook: appPushWebhook, + nodeId: nodeId, + preDeployFunction: preDeployFunction, + envVars: envVars + })); + } + registerNewApp(appName, hasPersistentData) { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/apps/appDefinitions/register', { + appName, + hasPersistentData + })); + } + deleteApp(appName) { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/apps/appDefinitions/delete', { + appName + })); + } + enableSslForBaseDomain(appName) { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/apps/appDefinitions/enablebasedomainssl', { + appName + })); + } + attachNewCustomDomainToApp(appName, customDomain) { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/apps/appDefinitions/customdomain', { + appName, + customDomain + })); + } + enableSslForCustomDomain(appName, customDomain) { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/apps/appDefinitions/enablecustomdomainssl', { + appName, + customDomain + })); + } + removeCustomDomain(appName, customDomain) { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/apps/appDefinitions/removecustomdomain', { + appName, + customDomain + })); + } + getLoadBalancerInfo() { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.GET, '/user/system/loadbalancerinfo', {})); + } + getNetDataInfo() { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.GET, '/user/system/netdata', {})); + } + updateNetDataInfo(netDataInfo) { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/system/netdata', { netDataInfo })); + } + changePass(oldPassword, newPassword) { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/changepassword', { + oldPassword, + newPassword + })); + } + getVersionInfo() { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.GET, '/user/system/versioninfo', {})); + } + performUpdate(latestVersion) { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/system/versioninfo', { latestVersion })); + } + getNginxConfig() { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.GET, '/user/system/nginxconfig', {})); + } + setNginxConfig(customBase, customCaptain) { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/system/nginxconfig', { + baseConfig: { customValue: customBase }, + captainConfig: { customValue: customCaptain } + })); + } + getUnusedImages(mostRecentLimit) { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.GET, '/user/apps/appDefinitions/unusedImages', { + mostRecentLimit: mostRecentLimit + '' + })); + } + deleteImages(imageIds) { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/apps/appDefinitions/deleteImages', { + imageIds + })); + } + getDockerRegistries() { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.GET, '/user/registries', {})); + } + enableSelfHostedDockerRegistry() { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/system/selfhostregistry/enableregistry', {})); + } + disableSelfHostedDockerRegistry() { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/system/selfhostregistry/disableregistry', {})); + } + addDockerRegistry(dockerRegistry) { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/registries/insert', Object.assign({}, dockerRegistry))); + } + updateDockerRegistry(dockerRegistry) { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/registries/update', Object.assign({}, dockerRegistry))); + } + deleteDockerRegistry(registryId) { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/registries/delete', { + registryId + })); + } + setDefaultPushDockerRegistry(registryId) { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/registries/setpush', { + registryId + })); + } + getAllNodes() { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.GET, '/user/system/nodes', {})); + } + addDockerNode(nodeType, privateKey, remoteNodeIpAddress, captainIpAddress) { + const http = this.http; + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/system/nodes', { + nodeType, + privateKey, + remoteNodeIpAddress, + captainIpAddress + })); + } +} +ApiManager.lastKnownPassword = process.env.REACT_APP_DEFAULT_PASSWORD + ? process.env.REACT_APP_DEFAULT_PASSWORD + '' + : 'captain42'; +ApiManager.authToken = !!process.env.REACT_APP_IS_DEBUG + ? 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7Im5hbWVzcGFjZSI6ImNhcHRhaW4iLCJ0b2tlblZlcnNpb24iOiI5NmRjM2U1MC00ZDk3LTRkNmItYTIzMS04MmNiZjY0ZTA2NTYifSwiaWF0IjoxNTQ1OTg0MDQwLCJleHAiOjE1ODE5ODQwNDB9.uGJyhb2JYsdw9toyMKX28bLVuB0PhnS2POwEjKpchww' + : ''; +exports.default = ApiManager; +//# sourceMappingURL=ApiManager.js.map \ No newline at end of file diff --git a/app-cli/built/api/ApiManager.js.map b/app-cli/built/api/ApiManager.js.map new file mode 100755 index 0000000..19fbda7 --- /dev/null +++ b/app-cli/built/api/ApiManager.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ApiManager.js","sourceRoot":"","sources":["../../src/api/ApiManager.ts"],"names":[],"mappings":";;AAAA,6CAAsC;AAOtC,MAAqB,UAAU;IAU9B,YAAY,OAAe,EAAU,cAAoD;QAApD,mBAAc,GAAd,cAAc,CAAsC;QACxF,MAAM,IAAI,GAAG,IAAI,CAAC;QAElB,IAAI,CAAC,IAAI,GAAG,IAAI,oBAAU,CAAC,OAAO,EAAE,UAAU,CAAC,SAAS,EAAE;YACzD,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,OAAO;QACN,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;IACrB,CAAC;IAED,YAAY,CAAC,SAAiB;QAC7B,UAAU,CAAC,SAAS,GAAG,SAAS,CAAC;QACjC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,UAAU;QAChB,OAAO,CAAC,CAAC,UAA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IAAI,CAAC;QAEvB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE;aACzB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,oBAAoB,EAAE,EAAE,CAAC,CAAC,CAAC;IACxD,CAAC;IAED,aAAa,CAAC,QAAgB,EAAE,UAAkB,EAAE,mBAA2B,EAAE,gBAAwB;QACxG,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAEvB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE;aACzB,IAAI,CACJ,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,oBAAoB,EAAE;YAC3C,QAAQ;YACR,UAAU;YACV,mBAAmB;YACnB,gBAAgB;SAChB,CAAC,CACF,CAAC;IACJ,CAAC;;AA5Xc,4BAAiB,GAAW,OAAO,CAAC,GAAG,CAAC,0BAA0B;IAChF,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,GAAG,EAAE;IAC7C,CAAC,CAAC,WAAW,CAAC;AACA,oBAAS,GAAW,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB;IAClE,CAAC,CAAC,mPAAmP;IACrP,CAAC,CAAC,EAAE,CAAC;AANP,6BA8XC"} \ No newline at end of file diff --git a/app-cli/built/api/CliApiManager.js b/app-cli/built/api/CliApiManager.js new file mode 100755 index 0000000..0b9f171 --- /dev/null +++ b/app-cli/built/api/CliApiManager.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const ApiManager_1 = require("./ApiManager"); +const StorageHelper_1 = require("../utils/StorageHelper"); +function hashCode(str) { + var hash = 0, i, chr; + if (str.length === 0) + return hash; + for (i = 0; i < str.length; i++) { + chr = str.charCodeAt(i); + hash = (hash << 5) - hash + chr; + hash |= 0; // Convert to 32bit integer + } + return hash; +} +class CliApiManager { + static get(capMachine) { + const hashKey = 'v' + hashCode(capMachine.baseUrl); + if (!CliApiManager.instances[hashKey]) + CliApiManager.instances[hashKey] = new ApiManager_1.default(capMachine.baseUrl + '/api/v1', function (token) { + capMachine.authToken = token; + StorageHelper_1.default.get().saveMachine(capMachine); + return Promise.resolve(); + }); + return CliApiManager.instances[hashKey]; + } +} +CliApiManager.instances = {}; +exports.default = CliApiManager; +//# sourceMappingURL=CliApiManager.js.map \ No newline at end of file diff --git a/app-cli/built/api/CliApiManager.js.map b/app-cli/built/api/CliApiManager.js.map new file mode 100755 index 0000000..b00d910 --- /dev/null +++ b/app-cli/built/api/CliApiManager.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CliApiManager.js","sourceRoot":"","sources":["../../src/api/CliApiManager.ts"],"names":[],"mappings":";;AAAA,6CAAsC;AAEtC,0DAAmD;AAGnD,SAAS,QAAQ,CAAC,GAAW;IAC5B,IAAI,IAAI,GAAG,CAAC,EACX,CAAC,EACD,GAAG,CAAC;IACL,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAClC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAChC,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,GAAG,GAAG,CAAC;QAChC,IAAI,IAAI,CAAC,CAAC,CAAC,2BAA2B;KACtC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAED,MAAqB,aAAa;IAGjC,MAAM,CAAC,GAAG,CAAC,UAAoB;QAC9B,MAAM,OAAO,GAAG,GAAG,GAAG,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACnD,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC;YACpC,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,oBAAU,CAAC,UAAU,CAAC,OAAO,GAAG,SAAS,EAAE,UAAS,KAAK;gBAC/F,UAAU,CAAC,SAAS,GAAG,KAAK,CAAC;gBAC7B,uBAAa,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;gBAC5C,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;YAC1B,CAAC,CAAC,CAAC;QAEJ,OAAO,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;;AAZM,uBAAS,GAAgC,EAAE,CAAC;AADpD,gCAcC"} \ No newline at end of file diff --git a/app-cli/built/api/DeployApi.js b/app-cli/built/api/DeployApi.js deleted file mode 100755 index 6d0221a..0000000 --- a/app-cli/built/api/DeployApi.js +++ /dev/null @@ -1,112 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -const MachineHelper_1 = require("../helpers/MachineHelper"); -const MainApi = require('./MainApi'); -const { DEFAULT_BRANCH_TO_PUSH, DEFAULT_APP_NAME } = require('../utils/constants'); -class DeployApi { - constructor() { - this.branchToPush = DEFAULT_BRANCH_TO_PUSH; - this.appName = DEFAULT_APP_NAME; - this.appUrl = ''; - } - setMachineToDeploy(machineToDeploy) { - this.machineToDeploy = machineToDeploy; - } - updateMachineToDeploy(machineToDeploy) { - let possibleMachine = {}; - // Look machine by host - if (machineToDeploy.startsWith('http')) { - this.machineToDeploy = MachineHelper_1.default.getMachines().find((machine) => machine.baseUrl === machineToDeploy); - } - else { - // Look machine by name - this.machineToDeploy = MachineHelper_1.default.getMachines().find((machine) => machine.name === machineToDeploy); - } - } - setBranchToPush(branchToPush) { - this.branchToPush = branchToPush; - } - setAppName(appName) { - this.appName = appName; - this.setAppUrl(); - } - setAppUrl() { - this.appUrl = this.machineToDeploy.baseUrl - .replace('//captain.', '//' + this.appName + '.') - .replace('https://', 'http://'); - } - fetchBuildLogs() { - return __awaiter(this, void 0, void 0, function* () { - try { - const { authToken, baseUrl } = this.machineToDeploy; - const customOptions = { - headers: { - 'x-captain-auth': authToken - } - }; - const data = yield MainApi.get(`${baseUrl}/api/v1/user/appData/${this.appName}`, customOptions); - return data; - } - catch (e) { - throw e; - } - }); - } - sendFile(sourceFile, gitHash) { - return __awaiter(this, void 0, void 0, function* () { - try { - const { authToken, baseUrl } = this.machineToDeploy; - const url = `${baseUrl}/api/v1/user/appData/${this.appName}/?detached=1`; - const form = { - sourceFile, - gitHash - }; - const options = { - headers: { - 'x-captain-auth': authToken - } - }; - const data = yield MainApi.postWithFile(url, form, options); - return data; - } - catch (e) { - throw e; - } - }); - } - // This is not moved to LoginAPI since it's related only for machineToDeploy - isAuthTokenValid() { - return __awaiter(this, void 0, void 0, function* () { - try { - if (!this.machineToDeploy) - return false; - const url = `${this.machineToDeploy.baseUrl}/api/v1/user/appDefinitions/`; - const currentToken = this.machineToDeploy.authToken; - const options = { - headers: { - 'x-captain-auth': currentToken - } - }; - const response = yield MainApi.get(url, options); - const data = JSON.parse(response); - // Tolken is not valid - if (data.status === 1106 || data.status === 1105) { - return false; - } - return true; - } - catch (e) { - throw e; - } - }); - } -} -module.exports = new DeployApi(); -//# sourceMappingURL=DeployApi.js.map \ No newline at end of file diff --git a/app-cli/built/api/DeployApi.js.map b/app-cli/built/api/DeployApi.js.map deleted file mode 100755 index e1eeb18..0000000 --- a/app-cli/built/api/DeployApi.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DeployApi.js","sourceRoot":"","sources":["../../src/api/DeployApi.ts"],"names":[],"mappings":";;;;;;;;;AACA,4DAAqD;AAErD,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACrC,MAAM,EA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MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;gBACjD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;gBAElC,sBAAsB;gBACtB,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,EAAE;oBACjD,OAAO,KAAK,CAAC;iBACb;gBAED,OAAO,IAAI,CAAC;aACZ;YAAC,OAAO,CAAC,EAAE;gBACX,MAAM,CAAC,CAAC;aACR;QACF,CAAC;KAAA;CACD;AAED,iBAAS,IAAI,SAAS,EAAE,CAAC"} \ No newline at end of file diff --git a/app-cli/built/api/HttpClient.js b/app-cli/built/api/HttpClient.js new file mode 100755 index 0000000..b2bcbb8 --- /dev/null +++ b/app-cli/built/api/HttpClient.js @@ -0,0 +1,122 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const axios_1 = require("axios"); +const ErrorFactory_1 = require("../utils/ErrorFactory"); +const Logger_1 = require("../utils/Logger"); +var TOKEN_HEADER = 'x-captain-auth'; +var NAMESPACE = 'x-namespace'; +var CAPTAIN = 'captain'; +class HttpClient { + constructor(baseUrl, authToken, onAuthFailure) { + this.baseUrl = baseUrl; + this.authToken = authToken; + this.onAuthFailure = onAuthFailure; + this.GET = 'GET'; + this.POST = 'POST'; + this.isDestroyed = false; + // + } + createHeaders() { + let headers = {}; + if (this.authToken) + headers[TOKEN_HEADER] = this.authToken; + headers[NAMESPACE] = CAPTAIN; + // check user/appData or apiManager.uploadAppData before changing this signature. + return headers; + } + setAuthToken(authToken) { + this.authToken = authToken; + } + destroy() { + this.isDestroyed = true; + } + fetch(method, endpoint, variables) { + const self = this; + return function () { + return Promise.resolve() // + .then(function () { + if (!process.env.REACT_APP_IS_DEBUG) + return Promise.resolve(); + return new Promise(function (res) { + setTimeout(res, 500); + }); + }) + .then(function () { + return self.fetchInternal(method, endpoint, variables); // + }) + .then(function (axiosResponse) { + const data = axiosResponse.data; // this is an axios thing! + if (data.status === ErrorFactory_1.default.STATUS_AUTH_TOKEN_INVALID) { + return self + .onAuthFailure() // + .then(function () { + return self.fetchInternal(method, endpoint, variables).then(function (newAxiosResponse) { + return newAxiosResponse.data; + }); + }); + } + else { + return data; + } + }) + .then(function (data) { + if (data.status !== ErrorFactory_1.default.OKAY && data.status !== ErrorFactory_1.default.OKAY_BUILD_STARTED) { + throw ErrorFactory_1.default.createError(data.status || ErrorFactory_1.default.UNKNOWN_ERROR, data.description || ''); + } + return data; + }) + .then(function (data) { + // These two blocks are clearly memory leaks! But I don't have time to fix them now... I need to CANCEL the promise, but since I don't + // have CANCEL method on the native Promise, I return a promise that will never RETURN if the HttpClient is destroyed. + // Will fix them later... but it shouldn't be a big deal anyways as it's only a problem when user navigates away from a page before the + // network request returns back. + return new Promise(function (resolve, reject) { + // data.data here is the "data" field inside the API response! {status: 100, description: "Login succeeded", data: {…}} + if (!self.isDestroyed) + return resolve(data.data || { token: data.token }); // TODO remove || for API V2 + Logger_1.default.dev('Destroyed then not called'); + }); + }) + .catch(function (error) { + Logger_1.default.error(error.message || error); + return new Promise(function (resolve, reject) { + if (!self.isDestroyed) + return reject(error); + Logger_1.default.dev('Destroyed catch not called'); + }); + }); + }; + } + fetchInternal(method, endpoint, variables) { + if (method === this.GET) + return this.getReq(endpoint, variables); + if (method === this.POST) + return this.postReq(endpoint, variables); + throw new Error('Unknown method: ' + method); + } + getReq(endpoint, variables) { + const self = this; + return axios_1.default + .get(this.baseUrl + endpoint, { + params: variables, + headers: self.createHeaders() + }) // + .then(function (data) { + //console.log(data); + return data; + }); + } + postReq(endpoint, variables) { + const self = this; + return axios_1.default + .post(this.baseUrl + endpoint, variables, { + headers: self.createHeaders() + }) // + .then(function (data) { + //console.log(data); + return data; + }); + } +} +exports.default = HttpClient; +//# sourceMappingURL=HttpClient.js.map \ No newline at end of file diff --git a/app-cli/built/api/HttpClient.js.map b/app-cli/built/api/HttpClient.js.map new file mode 100755 index 0000000..bda4233 --- /dev/null +++ b/app-cli/built/api/HttpClient.js.map @@ -0,0 +1 @@ +{"version":3,"file":"HttpClient.js","sourceRoot":"","sources":["../../src/api/HttpClient.ts"],"names":[],"mappings":";;AAAA,iCAA0B;AAC1B,wDAAiD;AACjD,4CAAqC;AAErC,IAAI,YAAY,GAAG,gBAAgB,CAAC;AACpC,IAAI,SAAS,GAAG,aAAa,CAAC;AAC9B,IAAI,OAAO,GAAG,SAAS,CAAC;AAExB,MAAqB,UAAU;IAK9B,YAAoB,OAAe,EAAU,SAAiB,EAAU,aAAiC;QAArF,YAAO,GAAP,OAAO,CAAQ;QAAU,cAAS,GAAT,SAAS,CAAQ;QAAU,kBAAa,GAAb,aAAa,CAAoB;QAJzF,QAAG,GAAG,KAAK,CAAC;QACZ,SAAI,GAAG,MAAM,CAAC;QACvB,gBAAW,GAAG,KAAK,CAAC;QAG1B,EAAE;IACH,CAAC;IAED,aAAa;QACZ,IAAI,OAAO,GAAQ,EAAE,CAAC;QACtB,IAAI,IAAI,CAAC,SAAS;YAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;QAC3D,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC;QAE7B,iFAAiF;QACjF,OAAO,OAAO,CAAC;IAChB,CAAC;IAED,YAAY,CAAC,SAAiB;QAC7B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC5B,CAAC;IAED,OAAO;QACN,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,MAAsB,EAAE,QAAgB,EAAE,SAAc;QAC7D,MAAM,IAAI,GAAG,IAAI,CAAC;QAClB,OAAO;YACN,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE;iBACzB,IAAI,CAAC;gBACL,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB;oBAAE,OAAO,OAAO,CAAC,OAAO,EAAE,CA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AAI,CAAC,UAAS,IAAI;YAClB,oBAAoB;YACpB,OAAO,IAAI,CAAC;QACb,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,CAAC,QAAgB,EAAE,SAAc;QACvC,MAAM,IAAI,GAAG,IAAI,CAAC;QAClB,OAAO,eAAK;aACV,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,QAAQ,EAAE,SAAS,EAAE;YACzC,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE;SAC7B,CAAC,CAAC,EAAE;aACJ,IAAI,CAAC,UAAS,IAAI;YAClB,oBAAoB;YACpB,OAAO,IAAI,CAAC;QACb,CAAC,CAAC,CAAC;IACL,CAAC;CACD;AAnHD,6BAmHC"} \ No newline at end of file diff --git a/app-cli/built/api/LoginApi.js b/app-cli/built/api/LoginApi.js deleted file mode 100755 index 9d659da..0000000 --- a/app-cli/built/api/LoginApi.js +++ /dev/null @@ -1,63 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -const MainApi = require('./MainApi'); -const SystemApi = require('./SystemApi'); -const { DEFAULT_PASSWORD } = require('../utils/constants'); -class LoginApi { - constructor() { - this.token = ''; - this.oldPassword = DEFAULT_PASSWORD; - } - setOldPassword(newPassword) { - this.oldPassword = newPassword; - } - setToken(newToken) { - this.token = newToken; - } - loginMachine(baseUrl, password) { - return __awaiter(this, void 0, void 0, function* () { - try { - const data = yield MainApi.post(`${baseUrl}/api/v1/login`, { password }); - const dataAsObject = JSON.parse(data); - if (dataAsObject) { - this.setToken(dataAsObject.token); - } - return data; - } - catch (e) { - throw e; - } - }); - } - changePass(baseUrl, newPassword) { - return __awaiter(this, void 0, void 0, function* () { - try { - const customOptions = { - headers: { - 'x-captain-auth': this.token - } - }; - const form = { - oldPassword: this.oldPassword, - newPassword - }; - const data = yield MainApi.post(`${baseUrl}/api/v1/user/changepassword/`, form, customOptions); - this.setToken(data.token); - SystemApi.setIpAddressOfServer(baseUrl); - return data; - } - catch (e) { - throw e; - } - }); - } -} -module.exports = new LoginApi(); -//# sourceMappingURL=LoginApi.js.map \ No newline at end of file diff --git a/app-cli/built/api/LoginApi.js.map b/app-cli/built/api/LoginApi.js.map deleted file mode 100755 index 6ba869d..0000000 --- a/app-cli/built/api/LoginApi.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"LoginApi.js","sourceRoot":"","sources":["../../src/api/LoginApi.ts"],"names":[],"mappings":";;;;;;;;;AAAA,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACrC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AACzC,MAAM,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAE3D,MAAM,QAAQ;IAAd;QACS,UAAK,GAAG,EAAE,CAAC;QACX,gBAAW,GAAG,gBAAgB,CAAC;IA+CxC,CAAC;IA7CA,cAAc,CAAC,WAAmB;QACjC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IAChC,CAAC;IAED,QAAQ,CAAC,QAAgB;QACxB,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC;IACvB,CAAC;IAEK,YAAY,CAAC,OAAe,EAAE,QAAgB;;YACnD,IAAI;gBACH,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,eAAe,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;gBACzE,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAEtC,IAAI,YAAY,EAAE;oBACjB,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;iBAClC;gBAED,OAAO,IAAI,CAAC;aACZ;YAAC,OAAO,CAAC,EAAE;gBACX,MAAM,CAAC,CAAC;aACR;QACF,CAAC;KAAA;IAEK,UAAU,CAAC,OAAe,EAAE,WAAmB;;YACpD,IAAI;gBACH,MAAM,aAAa,GAAG;oBACrB,OAAO,EAAE;wBACR,gBAAgB,EAAE,IAAI,CAAC,KAAK;qBAC5B;iBACD,CAAC;gBACF,MAAM,IAAI,GAAG;oBACZ,WAAW,EAAE,IAAI,CAAC,WAAW;oBAC7B,WAAW;iBACX,CAAC;gBACF,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,8BAA8B,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;gBAE/F,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAE1B,SAAS,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;gBAExC,OAAO,IAAI,CAAC;aACZ;YAAC,OAAO,CAAC,EAAE;gBACX,MAAM,CAAC,CAAC;aACR;QACF,CAAC;KAAA;CACD;AAED,iBAAS,IAAI,QAAQ,EAAE,CAAC"} \ No newline at end of file diff --git a/app-cli/built/api/MainApi.js b/app-cli/built/api/MainApi.js deleted file mode 100755 index a82a13a..0000000 --- a/app-cli/built/api/MainApi.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -const Request = require("request-promise"); -class MainApi { - constructor() { - this.sharedOptions = { - headers: { - 'x-namespace': 'captain' - } - }; - } - _buildOptions(options) { - if (!options) - return this.sharedOptions; - if (options.headers) { - options.headers = Object.assign({}, this.sharedOptions.headers, options.headers); - } - return Object.assign({}, this.sharedOptions, options); - } - get(url, options) { - const overrideOptions = this._buildOptions(options); - const optionsToSend = Object.assign({}, overrideOptions, { url, method: 'GET' }); - return Request(optionsToSend); - } - post(url, form, options) { - const overrideOptions = this._buildOptions(options); - const optionsToSend = Object.assign({}, overrideOptions, { url, method: 'POST', form }); - return Request(optionsToSend); - } - postWithFile(url, formData, options) { - const overrideOptions = this._buildOptions(options); - const optionsToSend = Object.assign({}, overrideOptions, { url, method: 'POST', formData }); - return Request(optionsToSend); - } - put(url, form, options) { - const overrideOptions = this._buildOptions(options); - const optionsToSend = Object.assign({}, overrideOptions, { url, method: 'PUT', form }); - return Request(optionsToSend); - } - patch(url, form, options) { - const overrideOptions = this._buildOptions(options); - const optionsToSend = Object.assign({}, overrideOptions, { url, method: 'PATCH', form }); - return Request(optionsToSend); - } - delete(url, options) { - const overrideOptions = this._buildOptions(options); - const optionsToSend = Object.assign({}, overrideOptions, { url, method: 'DELETE' }); - return Request(optionsToSend); - } -} -const instance = new MainApi(); -module.exports = instance; -//# sourceMappingURL=MainApi.js.map \ No newline at end of file diff --git a/app-cli/built/api/MainApi.js.map b/app-cli/built/api/MainApi.js.map deleted file mode 100755 index db32412..0000000 --- a/app-cli/built/api/MainApi.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MainApi.js","sourceRoot":"","sources":["../../src/api/MainApi.ts"],"names":[],"mappings":";AAAA,2CAA2C;AAM3C,MAAM,OAAO;IAEZ;QACC,IAAI,CAAC,aAAa,GAAG;YACpB,OAAO,EAAE;gBACR,aAAa,EAAE,SAAS;aACxB;SACD,CAAC;IACH,CAAC;IAED,aAAa,CAAC,OAAiB;QAC9B,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC,aAAa,CAAC;QAExC,IAAI,OAAO,CAAC,OAAO,EAAE;YACpB,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;SACjF;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;IAED,GAAG,CAAC,GAAW,EAAE,OAAiB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IAED,MAAM,CAAC,GAAW,EAAE,OAAiB;QACpC,MAAM,eAAe,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACpD,MAAM,aAAa,qBACf,eAAe,IAClB,GAAG,EACH,MAAM,EAAE,QAAQ,GAChB,CAAC;QAEF,OAAO,OAAO,CAAC,aAAa,CAAC,CAAC;IAC/B,CAAC;CACD;AAED,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAE,CAAC;AAC/B,iBAAS,QAAQ,CAAC"} \ No newline at end of file diff --git a/app-cli/built/api/SystemApi.js b/app-cli/built/api/SystemApi.js deleted file mode 100755 index ea342e0..0000000 --- a/app-cli/built/api/SystemApi.js +++ /dev/null @@ -1,81 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -const MainApi = require('./MainApi'); -const LoginApi = require('./LoginApi'); -// const spinnerUtil = require("../../utils/spinner") -class SystemApi { - constructor() { - this.ipAddressOfServer = ''; - this.customDomainFromUser = ''; - this.newPasswordFirstTry = ''; - } - setCustomDomainFromUser(newCustomDomainFromUser) { - this.customDomainFromUser = newCustomDomainFromUser; - } - setIpAddressOfServer(newIpAddress) { - this.ipAddressOfServer = newIpAddress.trim(); - } - setCustomDomain(baseUrl, rootDomain) { - return __awaiter(this, void 0, void 0, function* () { - try { - const customOptions = { - headers: { - 'x-captain-auth': LoginApi.token - } - }; - const data = yield MainApi.post(`${baseUrl}/api/v1/user/system/changerootdomain/`, { - rootDomain - }, customOptions); - return data; - } - catch (e) { - throw e; - } - }); - } - enableHttps(baseUrl, emailAddress) { - return __awaiter(this, void 0, void 0, function* () { - const customOptions = { - headers: { - 'x-captain-auth': LoginApi.token - } - }; - try { - const data = yield MainApi.post(`${baseUrl}/api/v1/user/system/enablessl/`, { - emailAddress - }, customOptions); - return data; - } - catch (e) { - throw e; - } - }); - } - forceHttps(baseUrl, isEnabled = true) { - return __awaiter(this, void 0, void 0, function* () { - try { - const customOptions = { - headers: { - 'x-captain-auth': LoginApi.token - } - }; - const data = yield MainApi.post(`${baseUrl}/api/v1/user/system/forcessl/`, { - isEnabled - }, customOptions); - return data; - } - catch (e) { - throw e; - } - }); - } -} -module.exports = new SystemApi(); -//# sourceMappingURL=SystemApi.js.map \ No newline at end of file diff --git a/app-cli/built/api/SystemApi.js.map b/app-cli/built/api/SystemApi.js.map deleted file mode 100755 index 2416dea..0000000 --- a/app-cli/built/api/SystemApi.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"SystemApi.js","sourceRoot":"","sources":["../../src/api/SystemApi.ts"],"names":[],"mappings":";;;;;;;;;AAAA,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACrC,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AACvC,qDAAqD;AAErD,MAAM,SAAS;IAAf;QACS,sBAAiB,GAAG,EAAE,CAAC;QACvB,yBAAoB,GAAG,EAAE,CAAC;QAC1B,wBAAmB,GAAG,EAAE,CAAC;IAyElC,CAAC;IAvEA,uBAAuB,CAAC,uBAA+B;QACtD,IAAI,CAAC,oBAAoB,GAAG,uBAAuB,CAAC;IACrD,CAAC;IAED,oBAAoB,CAAC,YAAoB;QACxC,IAAI,CAAC,iBAAiB,GAAG,YAAY,CAAC,IAAI,EAAE,CAAC;IAC9C,CAAC;IAEK,eAAe,CAAC,OAAe,EAAE,UAAkB;;YACxD,IAAI;gBACH,MAAM,aAAa,GAAG;oBACrB,OAAO,EAAE;wBACR,gBAAgB,EAAE,QAAQ,CAAC,KAAK;qBAChC;iBACD,CAAC;gBACF,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,CAC9B,GAAG,OAAO,uCAAuC,EACjD;oBACC,UAAU;iBACV,EACD,aAAa,CACb,CAAC;gBAEF,OAAO,IAAI,CAAC;aACZ;YAAC,OAAO,CAAC,EAAE;gBACX,MAAM,CAAC,CAAC;aACR;QACF,CAAC;KAAA;IAEK,WAAW,CAAC,OAAe,EAAE,YAAoB;;YACtD,MAAM,aAAa,GAAG;gBACrB,OAAO,EAAE;oBACR,gBAAgB,EAAE,QAAQ,CAAC,KAAK;iBAChC;aACD,CAAC;YAEF,IAAI;gBACH,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,CAC9B,GAAG,OAAO,gCAAgC,EAC1C;oBACC,YAAY;iBACZ,EACD,aAAa,CACb,CAAC;gBAEF,OAAO,IAAI,CAAC;aACZ;YAAC,OAAO,CAAC,EAAE;gBACX,MAAM,CAAC,CAAC;aACR;QACF,CAAC;KAAA;IAEK,UAAU,CAAC,OAAc,EAAE,SAAS,GAAG,IAAI;;YAChD,IAAI;gBACH,MAAM,aAAa,GAAG;oBACrB,OAAO,EAAE;wBACR,gBAAgB,EAAE,QAAQ,CAAC,KAAK;qBAChC;iBACD,CAAC;gBACF,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,CAC9B,GAAG,OAAO,+BAA+B,EACzC;oBACC,SAAS;iBACT,EACD,aAAa,CACb,CAAC;gBAEF,OAAO,IAAI,CAAC;aACZ;YAAC,OAAO,CAAC,EAAE;gBACX,MAAM,CAAC,CAAC;aACR;QACF,CAAC;KAAA;CACD;AAED,iBAAS,IAAI,SAAS,EAAE,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/captainduckduck.js b/app-cli/built/commands/captainduckduck.js index ec2b943..5808263 100755 --- a/app-cli/built/commands/captainduckduck.js +++ b/app-cli/built/commands/captainduckduck.js @@ -1,55 +1,57 @@ #!/usr/bin/env node "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const logout = require("./logout"); -const { printError } = require('../utils/messageHandler'); const packagejson = require('../../package.json'); -const updateNotifier = require('update-notifier'); -const program = require('commander'); +const updateNotifier = require("update-notifier"); updateNotifier({ pkg: packagejson }).notify({ isGlobal: true }); +const StdOutUtil_1 = require("../utils/StdOutUtil"); +const program = require("commander"); // Command actions -const serversetup = require('./serversetup'); -const { login } = require('./login'); -const list = require('./list'); -const deploy = require('./deploy'); +const login_1 = require("./login"); +// import serversetup = require('./serversetup'); +// import list = require('./list'); +// import deploy = require('./deploy'); +// import logout = require('./logout'); // Setup program.version(packagejson.version).description(packagejson.description); // Commands -program - .command('serversetup') - .description('Performs necessary actions and prepares your Captain server.') - .action(() => { - serversetup(); -}); program .command('login') .description('Login to a CaptainDuckDuck machine. You can be logged in to multiple machines simultaneously.') .action(() => { - login(); -}); -program.command('logout').description('Logout from a specific Captain machine.').action(() => { - logout(); -}); -program.command('list').alias('ls').description('List all Captain machines currently logged in.').action(() => { - list(); -}); -program - .command('deploy') - .description("Deploy your app (current directory) to a specific Captain machine. You'll be prompted to choose your Captain machine.") - .option('-t, --tarFile ', 'Specify file to be uploaded (rather than using git archive)') - .option('-d, --default', 'Run with default options') - .option('-s, --stateless', 'Run deploy stateless') - .option('-h, --host ', 'Only for stateless mode: Host of the captain machine') - .option('-a, --appName ', 'Only for stateless mode: Name of the app') - .option('-p, --pass ', 'Only for stateless mode: Password for Captain') - .option('-b, --branch ', 'Only for stateless mode: Branch name (default master)') - .action((options) => { - deploy(options); + login_1.default(); }); +// program +// .command('serversetup') +// .description('Performs necessary actions and prepares your Captain server.') +// .action(() => { +// serversetup(); +// }); +// program.command('logout').description('Logout from a specific Captain machine.').action(() => { +// logout(); +// }); +// program.command('list').alias('ls').description('List all Captain machines currently logged in.').action(() => { +// list(); +// }); +// program +// .command('deploy') +// .description( +// "Deploy your app (current directory) to a specific Captain machine. You'll be prompted to choose your Captain machine." +// ) +// .option('-t, --tarFile ', 'Specify file to be uploaded (rather than using git archive)') +// .option('-d, --default', 'Run with default options') +// .option('-s, --stateless', 'Run deploy stateless') +// .option('-h, --host ', 'Only for stateless mode: Host of the captain machine') +// .option('-a, --appName ', 'Only for stateless mode: Name of the app') +// .option('-p, --pass ', 'Only for stateless mode: Password for Captain') +// .option('-b, --branch ', 'Only for stateless mode: Branch name (default master)') +// .action((options: any) => { +// deploy(options); +// }); // Error on unknown commands program.on('command:*', () => { const wrongCommands = program.args.join(' '); - printError(`\nInvalid command: ${wrongCommands}\nSee --help for a list of available commands.`, true); + StdOutUtil_1.default.printError(`\nInvalid command: ${wrongCommands}\nSee --help for a list of available commands.`, true); }); program.parse(process.argv); //# sourceMappingURL=captainduckduck.js.map \ No newline at end of file diff --git a/app-cli/built/commands/captainduckduck.js.map b/app-cli/built/commands/captainduckduck.js.map index d55a2d8..6ace441 100755 --- a/app-cli/built/commands/captainduckduck.js.map +++ b/app-cli/built/commands/captainduckduck.js.map @@ -1 +1 @@ -{"version":3,"file":"captainduckduck.js","sourceRoot":"","sources":["../../src/commands/captainduckduck.ts"],"names":[],"mappings":";;;AAEA,mCAAoC;AAEpC,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAC1D,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAClD,MAAM,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAClD,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAErC,cAAc,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAEhE,kBAAkB;AAClB,MAAM,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAC7C,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACrC,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC/B,MAAM,MAAM,GAAG,OAAO,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EAAE;IACxB,MAAM,CAAC,OAAO,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC;AAEJ,4BAA4B;AAC5B,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;IAC5B,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE7C,UAAU,CAAC,sBAAsB,aAAa,gDAAgD,EAAE,IAAI,CAAC,CAAC;AACvG,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"captainduckduck.js","sourceRoot":"","sources":["../../src/commands/captainduckduck.ts"],"names":[],"mappings":";;;AAEA,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAClD,kDAAkD;AAClD,cAAc,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAEhE,oDAA6C;AAC7C,qCAAqC;AAErC,kBAAkB;AAClB,mCAA4B;AAC5B,iDAAiD;AACjD,mCAAmC;AACnC,uCAAuC;AACvC,uCAAuC;AAEvC,QAAQ;AACR,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;AAE1E,WAAW;AAEX,OAAO;KACL,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,+FAA+F,CAAC;KAC5G,MAAM,CAAC,GAAG,EAAE;IACZ,eAAK,EAAE,CAAC;AACT,CAAC,CAAC,CAAC;AAEJ,UAAU;AACV,2BAA2B;AAC3B,gFAAgF;AAChF,mBAAmB;AACnB,mBAAmB;AACnB,OAAO;AAEP,kGAAkG;AAClG,aAAa;AACb,MAAM;AAEN,mHAAmH;AACnH,WAAW;AACX,MAAM;AAEN,UAAU;AACV,sBAAsB;AACtB,iBAAiB;AACjB,4HAA4H;AAC5H,KAAK;AACL,mGAAmG;AACnG,wDAAwD;AACxD,sDAAsD;AACtD,yFAAyF;AACzF,gFAAgF;AAChF,kFAAkF;AAClF,4FAA4F;AAC5F,+BAA+B;AAC/B,qBAAqB;AACrB,OAAO;AAEP,4BAA4B;AAC5B,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;IAC5B,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE7C,oBAAU,CAAC,UAAU,CAAC,sBAAsB,aAAa,gDAAgD,EAAE,IAAI,CAAC,CAAC;AAClH,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/deploy.js b/app-cli/built/commands/deploy.js deleted file mode 100755 index 9407893..0000000 --- a/app-cli/built/commands/deploy.js +++ /dev/null @@ -1,186 +0,0 @@ -#!/usr/bin/env node -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -const MachineHelper_1 = require("../helpers/MachineHelper"); -const inquirer = require('inquirer'); -const DeployApi = require('../api/DeployApi'); -const LoginApi = require('../api/LoginApi'); -const { printError, printMessage } = require('../utils/messageHandler'); -const { validateIsGitRepository, validateDefinitionFile, optionIsNotGiven, validateAuthentication } = require('../utils/validationsHandler'); -const { uploadFile } = require('../utils/fileHelper'); -const { gitArchiveFile } = require('../utils/fileHelper'); -const fs = require('fs-extra'); -const path = require('path'); -const commandExistsSync = require('command-exists').sync; -const { initMachineFromLocalStorage } = require('../utils/machineUtils'); -function deployAsDefaultValues() { - return __awaiter(this, void 0, void 0, function* () { - try { - const isValidAuthentication = yield validateAuthentication(); - if (isValidAuthentication) { - const { appName, branchToPush, machineToDeploy } = DeployApi; - if (!appName || !branchToPush || !machineToDeploy) { - printError('Default deploy failed. There are no default options selected.', true); - } - printMessage(`Deploying to ${machineToDeploy.name}`); - deployFromGitProject(); - } - else { - printError('Incorrect login details', true); - } - } - catch (e) { - printError(e.message, true); - } - }); -} -function deployAsStateless(host, appName, branch, pass) { - return __awaiter(this, void 0, void 0, function* () { - const isStateless = host && appName && branch && pass; - if (isStateless) { - // login first - printMessage(`Trying to login to ${host}\n`); - const { name } = DeployApi.machineToDeploy; - const response = yield LoginApi.loginMachine(host, pass); - const data = JSON.parse(response); - const newToken = data.token; - // Update the token to the machine that corresponds (if needed) - MachineHelper_1.default.updateMachineAuthToken(name, newToken); - if (data) { - printMessage(`Starting stateless deploy to\n${host}\n${branch}\n${appName}`); - deployFromGitProject(); - } - } - else { - printError('You are missing parameters for deploying on stateless. '); - } - }); -} -function deployFromTarFile(tarFile) { - return __awaiter(this, void 0, void 0, function* () { - try { - const isValidAuthentication = yield validateAuthentication(); - if (isValidAuthentication) { - // Send from tar file - const filePath = tarFile; - const gitHash = 'sendviatarfile'; - yield uploadFile(filePath, gitHash); - } - else { - printError('Incorrect login details', true); - } - } - catch (e) { - printError(e.message, true); - } - }); -} -function deployFromGitProject() { - if (!commandExistsSync('git')) { - printError("'git' command not found..."); - printError("Captain needs 'git' to create tar file of your source files...", true); - } - const zipFileNameToDeploy = 'temporary-captain-to-deploy.tar'; - const zipFileFullPath = path.join(process.cwd(), zipFileNameToDeploy); - printMessage(`Saving tar file to:\n${zipFileFullPath}\n`); - // Removes the temporarly file created - try { - const tempFileExists = fs.pathExistsSync(zipFileFullPath); - if (tempFileExists) { - fs.removeSync(zipFileFullPath); - } - } - catch (e) { - // IgnoreError - } - gitArchiveFile(zipFileFullPath, DeployApi.branchToPush); -} -function deploy(options) { - return __awaiter(this, void 0, void 0, function* () { - // Reads local storage and sets the machine if found - initMachineFromLocalStorage(); - if (!options.tarFile || !options.stateless) { - validateIsGitRepository(); - validateDefinitionFile(); - } - printMessage('Preparing deployment to Captain...\n'); - if (options.default) { - deployAsDefaultValues(); - } - else if (options.stateless) { - deployAsStateless(options.host, options.appName, options.branch, options.pass); - } - else if (options.tarFile) { - deployFromTarFile(options.tarFile); - } - else { - const questions = [ - { - type: 'list', - name: 'captainNameToDeploy', - default: DeployApi.machineToDeploy.name || '', - message: 'Select the Captain Machine you want to deploy to:', - choices: MachineHelper_1.default.getMachinesAsOptions(), - when: () => optionIsNotGiven(options, 'host') - }, - { - type: 'input', - default: DeployApi.branchToPush || 'master', - name: 'branchToPush', - message: "Enter the 'git' branch you would like to deploy:", - when: () => optionIsNotGiven(options, 'branch') - }, - { - type: 'input', - default: DeployApi.appName, - name: 'appName', - message: 'Enter the Captain app name this directory will be deployed to:', - when: () => optionIsNotGiven(options, 'appName') - }, - { - type: 'confirm', - name: 'confirmedToDeploy', - message: 'Note that uncommitted files and files in gitignore (if any) will not be pushed to server. Please confirm so that deployment process can start.', - default: true, - when: () => optionIsNotGiven(options, 'stateless') - } - ]; - const answers = yield inquirer.prompt(questions); - if (!answers.confirmedToDeploy && !options.stateless) { - printMessage('\nOperation cancelled by the user...\n'); - process.exit(0); - } - const captainNameToDeploy = answers.captainNameToDeploy; - const branchToPush = answers.branchToPush || options.branch; - const appName = answers.appName || options.appName; - DeployApi.updateMachineToDeploy(captainNameToDeploy || options.host); - DeployApi.setBranchToPush(branchToPush); - DeployApi.setAppName(appName); - printMessage(`Deploying to ${DeployApi.machineToDeploy.name}`); - // Normal deploy - if (answers.confirmedToDeploy) { - try { - const isValidAuthentication = yield validateAuthentication(); - if (isValidAuthentication) { - deployFromGitProject(); - } - else { - printError('Incorrect login details', true); - } - } - catch (e) { - printError(e.message, true); - } - } - } - }); -} -module.exports = deploy; -//# sourceMappingURL=deploy.js.map \ No newline at end of file diff --git a/app-cli/built/commands/deploy.js.map b/app-cli/built/commands/deploy.js.map deleted file mode 100755 index 6d3f638..0000000 --- a/app-cli/built/commands/deploy.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,4DAAqD;AACrD,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACrC,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC9C,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAC5C,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AACxE,MAAM,EACL,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC3C,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AACtD,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAC1D,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAC/B,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7B,MAAM,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC;AACzD,MAAM,EAAE,2BAA2B,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAEzE,SAAe,qBAAqB;;QACnC,IAAI;YACH,MAAM,qBAAqB,GAAG,MAAM,sBAAsB,EAAE,CAAC;YAE7D,IAAI,qBAAqB,EAAE;gBAC1B,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,GAAG,SAAS,CAAC;gBAE7D,IAAI,CAAC,OAAO,IAAI,CAAC,YAAY,IAA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C,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC;iBAClD;aACD,CAAC;YACF,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAEjD,IAAI,CAAC,OAAO,CAAC,iBAAiB,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE;gBACrD,YAAY,CAAC,wCAAwC,CAAC,CAAC;gBAEvD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aAChB;YAED,MAAM,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC;YACxD,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC;YAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;YAEnD,SAAS,CAAC,qBAAqB,CAAC,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;YAErE,SAAS,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;YAExC,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YAE9B,YAAY,CAAC,gBAAgB,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC;YAE/D,gBAAgB;YAChB,IAAI,OAAO,CAAC,iBAAiB,EAAE;gBAC9B,IAAI;oBACH,MAAM,qBAAqB,GAAG,MAAM,sBAAsB,EAAE,CAAC;oBAE7D,IAAI,qBAAqB,EAAE;wBAC1B,oBAAoB,EAAE,CAAC;qBACvB;yBAAM;wBACN,UAAU,CAAC,yBAAyB,EAAE,IAAI,CAAC,CAAC;qBAC5C;iBACD;gBAAC,OAAO,CAAC,EAAE;oBACX,UAAU,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;iBAC5B;aACD;SACD;IACF,CAAC;CAAA;AAED,iBAAS,MAAM,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/list.js b/app-cli/built/commands/list.js deleted file mode 100755 index 275e811..0000000 --- a/app-cli/built/commands/list.js +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env node -"use strict"; -const chalk = require('chalk'); -const MachineHelper_1 = require("../helpers/MachineHelper"); -const { printMessage } = require('../utils/messageHandler'); -function _displayMachine(machine) { - console.log('>> ' + chalk.greenBright(machine.name) + ' at ' + chalk.cyan(machine.baseUrl)); -} -function list() { - printMessage('\nLogged in Captain Machines:\n'); - MachineHelper_1.default.getMachines().map((machine) => { - _displayMachine(machine); - }); - printMessage(''); -} -module.exports = list; -//# sourceMappingURL=list.js.map \ No newline at end of file diff --git a/app-cli/built/commands/list.js.map b/app-cli/built/commands/list.js.map deleted file mode 100755 index 6ffd08b..0000000 --- a/app-cli/built/commands/list.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":";;AAEA,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/B,4DAAqD;AAErD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAE5D,SAAS,eAAe,CAAC,OAAiB;IACzC,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7F,CAAC;AAED,SAAS,IAAI;IACZ,YAAY,CAAC,iCAAiC,CAAC,CAAC;IAEhD,uBAAa,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QAC3C,eAAe,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,YAAY,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC;AAED,iBAAS,IAAI,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/login.js b/app-cli/built/commands/login.js index d86e6f6..d0e21a2 100755 --- a/app-cli/built/commands/login.js +++ b/app-cli/built/commands/login.js @@ -8,46 +8,50 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -const MachineHelper_1 = require("../helpers/MachineHelper"); -const { printMessage, printGreenMessage, printError } = require('../utils/messageHandler'); -const inquirer = require('inquirer'); -const DeployApi = require('../api/DeployApi'); -const { cleanUpUrl, findDefaultCaptainName } = require('../utils/loginHelpers'); -const { SAMPLE_DOMAIN } = require('../utils/constants'); -const LoginApi = require('../api/LoginApi'); +Object.defineProperty(exports, "__esModule", { value: true }); +const inquirer = require("inquirer"); +const StdOutUtil_1 = require("../utils/StdOutUtil"); +const StorageHelper_1 = require("../utils/StorageHelper"); +const Constants_1 = require("../utils/Constants"); +const Utils_1 = require("../utils/Utils"); +const CliHelper_1 = require("../utils/CliHelper"); +const CliApiManager_1 = require("../api/CliApiManager"); +const SAMPLE_DOMAIN = Constants_1.default.SAMPLE_DOMAIN; +const cleanUpUrl = Utils_1.default.cleanUpUrl; +// const DeployApi = require('../api/DeployApi'); +// const { cleanUpUrl, findDefaultCaptainName } = require('../utils/loginHelpers'); +// const { SAMPLE_DOMAIN } = require('../utils/constants'); +// const LoginApi = require('../api/LoginApi'); // In case the token is expired -function requestLogin() { - return __awaiter(this, void 0, void 0, function* () { - const { baseUrl, name } = DeployApi.machineToDeploy; - printMessage('Your auth token is not valid anymore. Try to login again.'); - const questions = [ - { - type: 'password', - name: 'captainPassword', - message: 'Please enter your password for ' + baseUrl, - validate: (value) => { - if (value && value.trim()) { - return true; - } - return 'Please enter your password for ' + baseUrl; - } - } - ]; - const loginPassword = yield inquirer.prompt(questions); - const password = loginPassword.captainPassword; - const response = yield LoginApi.loginMachine(baseUrl, password); - const data = JSON.parse(response); - const newToken = data.token; - if (!newToken) - return false; - // Update the token to the machine that corresponds - MachineHelper_1.default.updateMachineAuthToken(name, newToken); - return true; - }); -} +// async function requestLogin() { +// const { baseUrl, name } = DeployApi.machineToDeploy; +// printMessage('Your auth token is not valid anymore. Try to login again.'); +// const questions = [ +// { +// type: 'password', +// name: 'captainPassword', +// message: 'Please enter your password for ' + baseUrl, +// validate: (value: string) => { +// if (value && value.trim()) { +// return true; +// } +// return 'Please enter your password for ' + baseUrl; +// } +// } +// ]; +// const loginPassword = await inquirer.prompt(questions); +// const password = loginPassword.captainPassword; +// const response = await LoginApi.loginMachine(baseUrl, password); +// const data = JSON.parse(response); +// const newToken = data.token; +// if (!newToken) return false; +// // Update the token to the machine that corresponds +// MachineHelper.updateMachineAuthToken(name, newToken); +// return true; +// } function login() { return __awaiter(this, void 0, void 0, function* () { - printMessage('Login to a Captain Machine'); + StdOutUtil_1.default.printMessage('Login to a Captain Machine'); const questions = [ { type: 'input', @@ -60,7 +64,7 @@ function login() { } if (!cleanUpUrl(value)) return 'This is an invalid URL: ' + value; - MachineHelper_1.default.getMachines().map((machine) => { + StorageHelper_1.default.get().getMachines().map((machine) => { if (cleanUpUrl(machine.baseUrl) === cleanUpUrl(value)) { return `${value} already exist as ${machine.name}. If you want to replace the existing entry, you have to first use command, and then re-login.`; } @@ -92,9 +96,9 @@ function login() { type: 'input', name: 'captainName', message: 'Enter a name for this Captain machine:', - default: findDefaultCaptainName(), + default: CliHelper_1.default.get().findDefaultCaptainName(), validate: (value) => { - MachineHelper_1.default.getMachines().map((machine) => { + StorageHelper_1.default.get().getMachines().map((machine) => { if (machine.name === value) { return `${value} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.`; } @@ -106,31 +110,24 @@ function login() { } } ]; - const answers = yield inquirer.prompt(questions); + const answers = (yield inquirer.prompt(questions)); const { captainHasRootSsl, captainPassword, captainAddress, captainName } = answers; const handleHttp = captainHasRootSsl ? 'https://' : 'http://'; const baseUrl = `${handleHttp}${cleanUpUrl(captainAddress)}`; try { - const data = yield LoginApi.loginMachine(baseUrl, captainPassword); - const response = JSON.parse(data); - // TODO - This status should be 200 maybe? - if (response.status !== 100) { - throw new Error(JSON.stringify(response, null, 2)); - } - const newMachine = { - authToken: response.token, + const tokenToIgnore = yield CliApiManager_1.default.get({ + authToken: '', baseUrl, name: captainName - }; - MachineHelper_1.default.addMachine(newMachine); - printGreenMessage(`Logged in successfully to ${baseUrl}`); - printGreenMessage(`Authorization token is now saved as ${captainName} \n`); + }).getAuthToken(captainPassword); + StdOutUtil_1.default.printGreenMessage(`Logged in successfully to ${baseUrl}`); + StdOutUtil_1.default.printGreenMessage(`Authorization token is now saved as ${captainName} \n`); } catch (error) { const errorMessage = error.message ? error.message : error; - printError(`Something bad happened. Cannot save "${captainName}" \n${errorMessage}`); + StdOutUtil_1.default.printError(`Something bad happened. Cannot save "${captainName}" \n${errorMessage}`); } }); } -module.exports = { login, requestLogin }; +exports.default = login; //# sourceMappingURL=login.js.map \ No newline at end of file diff --git a/app-cli/built/commands/login.js.map b/app-cli/built/commands/login.js.map index d63e0f1..3af487b 100755 --- a/app-cli/built/commands/login.js.map +++ b/app-cli/built/commands/login.js.map @@ -1 +1 @@ -{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,4DAAqD;AAErD,MAAM,EAAE,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAC3F,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACrC,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC9C,MAAM,EAAE,UAAU,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAChF,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AACxD,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE5C,+BAA+B;AAC/B,SAAe,YAAY;;QAC1B,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,SAAS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,CAAC;CAAA;AAED,iBAAS,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,qCAAqC;AACrC,oDAA6C;AAC7C,0DAAmD;AACnD,kDAA2C;AAC3C,0CAAmC;AACnC,kDAA2C;AAE3C,wDAAiD;AAEjD,MAAM,aAAa,GAAG,mBAAS,CAAC,aAAa,CAAC;AAC9C,MAAM,UAAU,GAAG,eAAK,CAAC,UAAU,CAAC;AAEpC,iDAAiD;AACjD,mFAAmF;AACnF,2DAA2D;AAC3D,+CAA+C;AAE/C,+BAA+B;AAC/B,kCAAkC;AAClC,wDAAwD;AAExD,8EAA8E;AAE9E,uBAAuB;AACvB,MAAM;AACN,uBAAuB;AACvB,8BAA8B;AAC9B,2DAA2D;AAC3D,oCAAoC;AACpC,mCAAmC;AACnC,oBAAoB;AACpB,QAAQ;AAER,0DAA0D;AAC1D,OAAO;AACP,MAAM;AACN,MAAM;AACN,2DAA2D;AAC3D,mDAAmD;AACnD,oEAAoE;AACpE,sCAAsC;AACtC,gCAAgC;AAEhC,gCAAgC;AAEhC,uDAAuD;AACvD,yDAAyD;AAEzD,gBAAgB;AAChB,IAAI;AAEJ,SAAe,KAAK;;QACnB,oBAAU,CAAC,YAAY,CAAC,4BAA4B,CAAC,CAAC;QAEtD,MAAM,SAAS,GAAG;YACjB;gBACC,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,aAAa;gBACtB,IAAI,EAAE,gBAAgB;gBACtB,OAAO,EAAE,sFAAsF;gBAC/F,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE;oBAC3B,IAAI,KAAK,KAAK,aAAa,EAAE;wBAC5B,OAAO,mBAAmB,CAAC;qBAC3B;oBAED,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;wBAAE,OAAO,0BAA0B,GAAG,KAAK,CAAC;oBAElE,uBAAa,CAAC,GAAG,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AAO,IAAI,CAAC;qBACZ;oBAED,OAAO,8BAA8B,CAAC;gBACvC,CAAC;aACD;SACD,CAAC;QACF,MAAM,OAAO,GAAG,CAAC,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAA4B,CAAC;QAC9E,MAAM,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;QACpF,MAAM,UAAU,GAAG,iBAAiB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;QAC9D,MAAM,OAAO,GAAG,GAAG,UAAU,GAAG,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;QAE7D,IAAI;YACH,MAAM,aAAa,GAAG,MAAM,uBAAa,CAAC,GAAG,CAAC;gBAC7C,SAAS,EAAE,EAAE;gBACb,OAAO;gBACP,IAAI,EAAE,WAAW;aACjB,CAAC,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;YAEjC,oBAAU,CAAC,iBAAiB,CAAC,6BAA6B,OAAO,EAAE,CAAC,CAAC;YACrE,oBAAU,CAAC,iBAAiB,CAAC,uCAAuC,WAAW,KAAK,CAAC,CAAC;SACtF;QAAC,OAAO,KAAK,EAAE;YACf,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;YAE3D,oBAAU,CAAC,UAAU,CAAC,wCAAwC,WAAW,OAAO,YAAY,EAAE,CAAC,CAAC;SAChG;IACF,CAAC;CAAA;AAED,kBAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/logout.js b/app-cli/built/commands/logout.js deleted file mode 100755 index db37de5..0000000 --- a/app-cli/built/commands/logout.js +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env node -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -const MachineHelper_1 = require("../helpers/MachineHelper"); -const { printMessage } = require('../utils/messageHandler'); -const inquirer = require('inquirer'); -function generateQuestions() { - const listOfMachines = MachineHelper_1.default.getMachinesAsOptions(); - return [ - { - type: 'list', - name: 'captainNameToLogout', - message: 'Select the Captain Machine you want to logout from:', - choices: listOfMachines - }, - { - type: 'confirm', - name: 'confirmedToLogout', - message: 'Are you sure you want to logout from this Captain machine?', - default: false, - when: (answers) => answers.captainNameToLogout - } - ]; -} -function logout() { - return __awaiter(this, void 0, void 0, function* () { - const questions = generateQuestions(); - printMessage('Logout from a Captain Machine and clear auth info'); - const answers = yield inquirer.prompt(questions); - const { captainNameToLogout } = answers; - if (!captainNameToLogout) { - printMessage('\nOperation cancelled by the user...\n', true); - } - MachineHelper_1.default.logoutMachine(captainNameToLogout); - }); -} -module.exports = logout; -//# sourceMappingURL=logout.js.map \ No newline at end of file diff --git a/app-cli/built/commands/logout.js.map b/app-cli/built/commands/logout.js.map deleted file mode 100755 index fbe09bd..0000000 --- a/app-cli/built/commands/logout.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../src/commands/logout.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,4DAAqD;AACrD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAC5D,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAErC,SAAS,iBAAiB;IACzB,MAAM,cAAc,GAAG,uBAAa,CAAC,oBAAoB,EAAE,CAAC;IAE5D,OAAO;QACN;YACC,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,qBAAqB;YAC3B,OAAO,EAAE,qDAAqD;YAC9D,OAAO,EAAE,cAAc;SACvB;QACD;YACC,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,4DAA4D;YACrE,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,CAAC,OAAY,EAAE,EAAE,CAAC,OAAO,CAAC,mBAAmB;SACnD;KACD,CAAC;AACH,CAAC;AAED,SAAe,MAAM;;QACpB,MAAM,SAAS,GAAG,iBAAiB,EAAE,CAAC;QAEtC,YAAY,CAAC,mDAAmD,CAAC,CAAC;QAElE,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACjD,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC;QAExC,IAAI,CAAC,mBAAmB,EAAE;YACzB,YAAY,CAAC,wCAAwC,EAAE,IAAI,CAAC,CAAC;SAC7D;QAED,uBAAa,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC;IAClD,CAAC;CAAA;AAED,iBAAS,MAAM,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/serversetup.js b/app-cli/built/commands/serversetup.js deleted file mode 100755 index 6e9e3a2..0000000 --- a/app-cli/built/commands/serversetup.js +++ /dev/null @@ -1,185 +0,0 @@ -#!/usr/bin/env node -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -const validationsHandler_1 = require("../utils/validationsHandler"); -const SystemApi = require('../api/SystemApi'); -const LoginApi = require('../api/LoginApi'); -const inquirer = require('inquirer'); -const { findDefaultCaptainName } = require('../utils/loginHelpers'); -const { SAMPLE_IP, DEFAULT_PASSWORD } = require('../utils/constants'); -const { printMessage, printError, printMessageAndExit, errorHandler } = require('../utils/messageHandler'); -const MachineHelper_1 = require("../helpers/MachineHelper"); -let newPasswordFirstTry = undefined; -const questions = [ - { - type: 'list', - name: 'hasInstalledCaptain', - message: 'Have you already installed Captain on your server by running the following line:' + - '\nmkdir /captain && docker run -p 80:80 -p 443:443 -p 3000:3000 -v /var/run/docker.sock:/var/run/docker.sock dockersaturn/captainduckduck ?', - default: 'Yes', - choices: ['Yes', 'No'], - filter: (value) => { - const answerFromUser = value.trim(); - if (answerFromUser === 'Yes') - return answerFromUser; - printMessage('\n\nCannot start the setup process if Captain is not installed.'); - printMessageAndExit('Please read tutorial on CaptainDuckDuck.com to learn how to install CaptainDuckDuck on a server.'); - } - }, - { - type: 'input', - default: SAMPLE_IP, - name: 'captainAddress', - message: 'Enter IP address of your captain server:', - filter: (value) => __awaiter(this, void 0, void 0, function* () { - const ipFromUser = value.trim(); - if (ipFromUser === SAMPLE_IP || !validationsHandler_1.isIpAddress(ipFromUser)) { - printError(`\nThis is an invalid IP Address: ${ipFromUser}`, true); - } - try { - // login using captain42. and set the ipAddressToServer - const data = yield LoginApi.loginMachine(`http://${ipFromUser}:3000`, DEFAULT_PASSWORD); - SystemApi.setIpAddressOfServer(ipFromUser); - // All went well - if (data) - return ipFromUser; - } - catch (e) { - errorHandler(e); - } - }) - }, - { - type: 'password', - name: 'captainOriginalPassword', - message: 'Enter your current password:', - when: () => !LoginApi.token, - filter: (value) => __awaiter(this, void 0, void 0, function* () { - try { - const captainPasswordFromUser = value.trim(); - const data = yield LoginApi.loginMachine(`http://${SystemApi.ipAddressOfServer}:3000`, captainPasswordFromUser); - if (data) { - SystemApi.setIpAddressOfServer(captainPasswordFromUser); - LoginApi.setOldPassword(captainPasswordFromUser); - } - } - catch (e) { - errorHandler(e); - } - }) - }, - { - type: 'input', - name: 'captainRootDomain', - message: 'Enter a root domain for this Captain server. For example, enter test.yourdomain.com if you' + - ' setup your DNS to point *.test.yourdomain.com to ip address of your server' + - ': ', - filter: (value) => __awaiter(this, void 0, void 0, function* () { - try { - const captainRootDomainFromUser = value.trim(); - const data = yield SystemApi.setCustomDomain(`http://${SystemApi.ipAddressOfServer}:3000`, captainRootDomainFromUser); - if (data) { - const newCustomDomainFromUser = `captain.${captainRootDomainFromUser}`; - SystemApi.setCustomDomainFromUser(newCustomDomainFromUser); - return captainRootDomainFromUser; - } - } - catch (e) { - errorHandler(e); - } - }) - }, - { - type: 'input', - name: 'emailAddress', - message: "Enter your 'valid' email address to enable HTTPS: ", - filter: (value) => __awaiter(this, void 0, void 0, function* () { - try { - const emailAddressFromUser = value.trim(); - const { customDomainFromUser } = SystemApi; - yield SystemApi.enableHttps(`http://${customDomainFromUser}`, emailAddressFromUser); - const data = yield SystemApi.forceHttps(`https://${customDomainFromUser}`); - if (data) - return emailAddressFromUser; - } - catch (e) { - errorHandler(e); - } - }) - }, - { - type: 'password', - name: 'newPasswordFirstTry', - message: 'Enter a new password:', - filter: (value) => { - newPasswordFirstTry = value; - return value; - } - }, - { - type: 'password', - name: 'newPassword', - message: 'Enter a new password:', - filter: (value) => __awaiter(this, void 0, void 0, function* () { - const { customDomainFromUser } = SystemApi; - try { - const confirmPasswordValueFromUser = value; - const machineUrl = `https://${customDomainFromUser}`; - if (newPasswordFirstTry !== confirmPasswordValueFromUser) { - printError('Passwords do not match', true); - } - const changePassData = yield LoginApi.changePass(machineUrl, confirmPasswordValueFromUser); - if (changePassData) { - const loginData = yield LoginApi.login(machineUrl, confirmPasswordValueFromUser); - if (loginData) - return; - } - } - catch (e) { - printError('\nIMPORTANT!! Server setup is completed by password is not changed.'); - printError('\nYou CANNOT use serversetup anymore. To continue:'); - printError(`\n- Go to https://${customDomainFromUser} login with default password and change the password in settings.`); - printError(`\n- In terminal (here), type captainduckduck login and enter this as your root domain: ${customDomainFromUser}`, true); - } - }) - }, - { - type: 'input', - name: 'captainName', - message: 'Enter a name for this Captain machine:', - default: findDefaultCaptainName(), - validate: (value) => { - const newMachineName = value.trim(); - MachineHelper_1.default.getMachines().map((machine) => machine.name === newMachineName && - `${newMachineName} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.`); - if (value.match(/^[-\d\w]+$/i)) { - return true; - } - return 'Please enter a Captain Name.'; - } - } -]; -function serversetup() { - return __awaiter(this, void 0, void 0, function* () { - printMessage('\nSetup your Captain server\n'); - const answers = yield inquirer.prompt(questions); - const captainAddress = `https://${SystemApi.customDomainFromUser}`; - const newMachine = { - authToken: LoginApi.token, - baseUrl: captainAddress, - name: answers.captainName - }; - MachineHelper_1.default.addMachine(newMachine); - printMessage(`\n\nCaptain is available at ${captainAddress}`); - printMessage('\nFor more details and docs see http://www.captainduckduck.com\n\n'); - }); -} -module.exports = serversetup; -//# sourceMappingURL=serversetup.js.map \ No newline at end of file diff --git a/app-cli/built/commands/serversetup.js.map b/app-cli/built/commands/serversetup.js.map deleted file mode 100755 index 4f526c7..0000000 --- a/app-cli/built/commands/serversetup.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"serversetup.js","sourceRoot":"","sources":["../../src/commands/serversetup.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,oEAA0D;AAE1D,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC9C,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACrC,MAAM,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AACpE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AACtE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,mBAAmB,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAC3G,4DAAqD;AAErD,IAAI,mBAAmB,GAAuB,SAAS,CA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AAC;IACpF,CAAC;CAAA;AAED,iBAAS,WAAW,CAAC"} \ No newline at end of file diff --git a/app-cli/built/helpers/MachineHelper.js b/app-cli/built/helpers/MachineHelper.js deleted file mode 100755 index da08680..0000000 --- a/app-cli/built/helpers/MachineHelper.js +++ /dev/null @@ -1,84 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const { printMessage } = require('../utils/messageHandler'); -const configstore = require('configstore'); -const packagejson = require('../../package.json'); -const configs = new configstore(packagejson.name, { - captainMachines: [] -}); -class MachineHelper { - constructor() { - this.machines = configs.get('captainMachines'); - this.apps = configs.get('apps'); - } - getMachinesAsOptions() { - const firstItemInOption = [ - { - name: '-- CANCEL --', - value: '', - short: '' - } - ]; - const listOfMachines = this.machines.map((machine) => { - return { - name: `${machine.name} at ${machine.baseUrl}`, - value: `${machine.name}`, - short: `${machine.name} at ${machine.baseUrl}` - }; - }); - return [...firstItemInOption, ...listOfMachines]; - } - getMachines() { - return this.machines; - } - getApps() { - return this.apps; - } - setMachines(newMachines) { - this.machines = newMachines; - configs.set('captainMachines', newMachines); - } - updateMachineAuthToken(machineName, authToken) { - let updatedMachine; - const newMachines = this.machines.map((machine) => { - if (machine.name === machineName) { - updatedMachine = Object.assign({}, machine, { authToken }); - return updatedMachine; - } - return machine; - }); - this.setMachines(newMachines); - this.updateAppsAuthToken(updatedMachine); - } - updateAppsAuthToken(updatedMachine) { - if (!updatedMachine) - return; - const newApps = this.apps.map((app) => { - if (app.machineToDeploy.name === updatedMachine.name) { - return Object.assign({}, app, { machineToDeploy: updatedMachine }); - } - return app; - }); - this.setApps(newApps); - } - setApps(newApps) { - this.apps = newApps; - configs.set('apps', newApps); - } - addMachine(newMachine) { - const tempMachines = this.machines; - const newMachines = [...tempMachines, newMachine]; - // Add to local storage - configs.set('captainMachines', newMachines); - this.setMachines(configs.get('captainMachines')); - } - logoutMachine(machineName) { - const removedMachine = this.machines.filter((machine) => machine.name === machineName)[0]; - const newMachines = this.machines.filter((machine) => machine.name !== machineName); - this.setMachines(newMachines); - printMessage(`You are now logged out from ${removedMachine.name} at ${removedMachine.baseUrl}...\n`); - } -} -const instance = new MachineHelper(); -exports.default = instance; -//# sourceMappingURL=MachineHelper.js.map \ No newline at end of file diff --git a/app-cli/built/helpers/MachineHelper.js.map b/app-cli/built/helpers/MachineHelper.js.map deleted file mode 100755 index 773ad9f..0000000 --- a/app-cli/built/helpers/MachineHelper.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MachineHelper.js","sourceRoot":"","sources":["../../src/helpers/MachineHelper.ts"],"names":[],"mappings":";;AAEA,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAC5D,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAC3C,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAClD,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE;IACjD,eAAe,EAAE,EAAE;CACnB,CAAC,CAAC;AAEH,MAAM,aAAa;IAGlB;QACC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAE/C,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAED,oBAAoB;QACnB,MAAM,iBAAiB,GAAG;YACzB;gBACC,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE,EAAE;gBACT,KAAK,EAAE,EAAE;aACT;SACD,CAAC;QACF,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;YACpD,OAAO;gBACN,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,OAAO,OAAO,CAAC,OAAO,EAAE;gBAC7C,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE;gBACxB,KAAK,EAAE,GAAG,OA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,CAAC;IAED,OAAO,CAAC,OAAe;QACtB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;QAEpB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED,UAAU,CAAC,UAAoB;QAC9B,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC;QACnC,MAAM,WAAW,GAAG,CAAE,GAAG,YAAY,EAAE,UAAU,CAAE,CAAC;QAEpD,uBAAuB;QACvB,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC;QAE5C,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAClD,CAAC;IAED,aAAa,CAAC,WAAmB;QAChC,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1F,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC;QAEpF,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAE9B,YAAY,CAAC,+BAA+B,cAAc,CAAC,IAAI,OAAO,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC;IACtG,CAAC;CACD;AAED,MAAM,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;AAErC,kBAAe,QAAQ,CAAC"} \ No newline at end of file diff --git a/app-cli/built/models/IModels.js b/app-cli/built/models/AppDef.js similarity index 68% rename from app-cli/built/models/IModels.js rename to app-cli/built/models/AppDef.js index 8f4cd75..503e464 100755 --- a/app-cli/built/models/IModels.js +++ b/app-cli/built/models/AppDef.js @@ -1,3 +1,3 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=IModels.js.map \ No newline at end of file +//# sourceMappingURL=AppDef.js.map \ No newline at end of file diff --git a/app-cli/built/models/AppDef.js.map b/app-cli/built/models/AppDef.js.map new file mode 100755 index 0000000..ba4b60f --- /dev/null +++ b/app-cli/built/models/AppDef.js.map @@ -0,0 +1 @@ +{"version":3,"file":"AppDef.js","sourceRoot":"","sources":["../../src/models/AppDef.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/app-cli/built/models/ICaptainDefinition.js b/app-cli/built/models/ICaptainDefinition.js new file mode 100755 index 0000000..24e1c86 --- /dev/null +++ b/app-cli/built/models/ICaptainDefinition.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=ICaptainDefinition.js.map \ No newline at end of file diff --git a/app-cli/built/models/ICaptainDefinition.js.map b/app-cli/built/models/ICaptainDefinition.js.map new file mode 100755 index 0000000..a319862 --- /dev/null +++ b/app-cli/built/models/ICaptainDefinition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ICaptainDefinition.js","sourceRoot":"","sources":["../../src/models/ICaptainDefinition.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/app-cli/built/models/IHashMapGeneric.js b/app-cli/built/models/IHashMapGeneric.js new file mode 100755 index 0000000..0de620b --- /dev/null +++ b/app-cli/built/models/IHashMapGeneric.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=IHashMapGeneric.js.map \ No newline at end of file diff --git a/app-cli/built/models/IHashMapGeneric.js.map b/app-cli/built/models/IHashMapGeneric.js.map new file mode 100755 index 0000000..b41b8b0 --- /dev/null +++ b/app-cli/built/models/IHashMapGeneric.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IHashMapGeneric.js","sourceRoot":"","sources":["../../src/models/IHashMapGeneric.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/app-cli/built/models/IModels.js.map b/app-cli/built/models/IModels.js.map deleted file mode 100755 index 1821df8..0000000 --- a/app-cli/built/models/IModels.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"IModels.js","sourceRoot":"","sources":["../../src/models/IModels.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/app-cli/built/models/IOneClickAppModels.js b/app-cli/built/models/IOneClickAppModels.js new file mode 100755 index 0000000..1ae9fb2 --- /dev/null +++ b/app-cli/built/models/IOneClickAppModels.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=IOneClickAppModels.js.map \ No newline at end of file diff --git a/app-cli/built/models/IOneClickAppModels.js.map b/app-cli/built/models/IOneClickAppModels.js.map new file mode 100755 index 0000000..c2efbba --- /dev/null +++ b/app-cli/built/models/IOneClickAppModels.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IOneClickAppModels.js","sourceRoot":"","sources":["../../src/models/IOneClickAppModels.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/app-cli/built/models/IRegistryInfo.js b/app-cli/built/models/IRegistryInfo.js new file mode 100755 index 0000000..5d22d7c --- /dev/null +++ b/app-cli/built/models/IRegistryInfo.js @@ -0,0 +1,8 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class IRegistryTypes { +} +IRegistryTypes.LOCAL_REG = "LOCAL_REG"; +IRegistryTypes.REMOTE_REG = "REMOTE_REG"; +exports.IRegistryTypes = IRegistryTypes; +//# sourceMappingURL=IRegistryInfo.js.map \ No newline at end of file diff --git a/app-cli/built/models/IRegistryInfo.js.map b/app-cli/built/models/IRegistryInfo.js.map new file mode 100755 index 0000000..25bee6f --- /dev/null +++ b/app-cli/built/models/IRegistryInfo.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IRegistryInfo.js","sourceRoot":"","sources":["../../src/models/IRegistryInfo.ts"],"names":[],"mappings":";;AAKA,MAAa,cAAc;;AACT,wBAAS,GAAG,WAAW,CAAC;AACxB,yBAAU,GAAG,YAAY,CAAC;AAF5C,wCAGC"} \ No newline at end of file diff --git a/app-cli/built/models/IVersionInfo.js b/app-cli/built/models/IVersionInfo.js new file mode 100755 index 0000000..95c27dd --- /dev/null +++ b/app-cli/built/models/IVersionInfo.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=IVersionInfo.js.map \ No newline at end of file diff --git a/app-cli/built/models/IVersionInfo.js.map b/app-cli/built/models/IVersionInfo.js.map new file mode 100755 index 0000000..9a459ce --- /dev/null +++ b/app-cli/built/models/IVersionInfo.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IVersionInfo.js","sourceRoot":"","sources":["../../src/models/IVersionInfo.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/app-cli/built/models/storage/StoredObjects.js b/app-cli/built/models/storage/StoredObjects.js new file mode 100755 index 0000000..cbae211 --- /dev/null +++ b/app-cli/built/models/storage/StoredObjects.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=StoredObjects.js.map \ No newline at end of file diff --git a/app-cli/built/models/storage/StoredObjects.js.map b/app-cli/built/models/storage/StoredObjects.js.map new file mode 100755 index 0000000..f00d4ad --- /dev/null +++ b/app-cli/built/models/storage/StoredObjects.js.map @@ -0,0 +1 @@ +{"version":3,"file":"StoredObjects.js","sourceRoot":"","sources":["../../../src/models/storage/StoredObjects.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/app-cli/built/utils/CliHelper.js b/app-cli/built/utils/CliHelper.js new file mode 100755 index 0000000..e0269e7 --- /dev/null +++ b/app-cli/built/utils/CliHelper.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const StorageHelper_1 = require("./StorageHelper"); +class CliHelper { + static get() { + if (!CliHelper.instance) + CliHelper.instance = new CliHelper(); + return CliHelper.instance; + } + findDefaultCaptainName() { + let currentSuffix = StorageHelper_1.default.get().getMachines().length + 1; + const self = this; + while (!self.isSuffixValid(currentSuffix)) { + currentSuffix++; + } + return self.getCaptainFullName(currentSuffix); + } + getCaptainFullName(suffix) { + const formatSuffix = suffix < 10 ? `0${suffix}` : suffix; + return `captain-${formatSuffix}`; + } + isSuffixValid(suffixNumber) { + const self = this; + let valid = true; + StorageHelper_1.default.get().getMachines().map((machine) => { + if (machine.name === self.getCaptainFullName(suffixNumber)) { + valid = false; + } + }); + return valid; + } +} +exports.default = CliHelper; +//# sourceMappingURL=CliHelper.js.map \ No newline at end of file diff --git a/app-cli/built/utils/CliHelper.js.map b/app-cli/built/utils/CliHelper.js.map new file mode 100755 index 0000000..8a8a684 --- /dev/null +++ b/app-cli/built/utils/CliHelper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CliHelper.js","sourceRoot":"","sources":["../../src/utils/CliHelper.ts"],"names":[],"mappings":";;AAAA,mDAA4C;AAG5C,MAAqB,SAAS;IAG7B,MAAM,CAAC,GAAG;QACT,IAAI,CAAC,SAAS,CAAC,QAAQ;YAAE,SAAS,CAAC,QAAQ,GAAG,IAAI,SAAS,EAAE,CAAC;QAC9D,OAAO,SAAS,CAAC,QAAQ,CAAC;IAC3B,CAAC;IAED,sBAAsB;QACrB,IAAI,aAAa,GAAG,uBAAa,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;QACjE,MAAM,IAAI,GAAG,IAAI,CAAC;QAElB,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE;YAC1C,aAAa,EAAE,CAAC;SAChB;QAED,OAAO,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAC/C,CAAC;IAED,kBAAkB,CAAC,MAAc;QAChC,MAAM,YAAY,GAAG,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;QAEzD,OAAO,WAAW,YAAY,EAAE,CAAC;IAClC,CAAC;IAED,aAAa,CAAC,YAAoB;QACjC,MAAM,IAAI,GAAG,IAAI,CAAC;QAClB,IAAI,KAAK,GAAG,IAAI,CAAC;QACjB,uBAAa,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,CAAC,OAAiB,EAAE,EAAE;YAC3D,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,EAAE;gBAC3D,KAAK,GAAG,KAAK,CAAC;aACd;QACF,CAAC,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACd,CAAC;CACD;AApCD,4BAoCC"} \ No newline at end of file diff --git a/app-cli/built/utils/constants.js b/app-cli/built/utils/Constants.js similarity index 76% rename from app-cli/built/utils/constants.js rename to app-cli/built/utils/Constants.js index d18cc08..83b25ef 100755 --- a/app-cli/built/utils/constants.js +++ b/app-cli/built/utils/Constants.js @@ -1,11 +1,12 @@ "use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); const SAMPLE_DOMAIN = "captain.captainroot.yourdomain.com"; const SAMPLE_IP = "123.123.123.123"; const DEFAULT_PASSWORD = "captain42"; const DEFAULT_BRANCH_TO_PUSH = "branchToPush"; const DEFAULT_APP_NAME = "appName"; const EMPTY_STRING = ""; -module.exports = { +exports.default = { SAMPLE_DOMAIN, SAMPLE_IP, DEFAULT_PASSWORD, @@ -13,4 +14,4 @@ module.exports = { DEFAULT_APP_NAME, EMPTY_STRING }; -//# sourceMappingURL=constants.js.map \ No newline at end of file +//# sourceMappingURL=Constants.js.map \ No newline at end of file diff --git a/app-cli/built/utils/Constants.js.map b/app-cli/built/utils/Constants.js.map new file mode 100755 index 0000000..eb7b854 --- /dev/null +++ b/app-cli/built/utils/Constants.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../src/utils/Constants.ts"],"names":[],"mappings":";;AAAA,MAAM,aAAa,GAAG,oCAAoC,CAAA;AAC1D,MAAM,SAAS,GAAG,iBAAiB,CAAA;AACnC,MAAM,gBAAgB,GAAG,WAAW,CAAA;AACpC,MAAM,sBAAsB,GAAG,cAAc,CAAA;AAC7C,MAAM,gBAAgB,GAAG,SAAS,CAAA;AAClC,MAAM,YAAY,GAAG,EAAE,CAAA;AAEvB,kBAAe;IACb,aAAa;IACb,SAAS;IACT,gBAAgB;IAChB,sBAAsB;IACtB,gBAAgB;IAChB,YAAY;CACb,CAAA"} \ No newline at end of file diff --git a/app-cli/built/utils/ErrorFactory.js b/app-cli/built/utils/ErrorFactory.js new file mode 100755 index 0000000..84c62ab --- /dev/null +++ b/app-cli/built/utils/ErrorFactory.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class ErrorFactory { + constructor() { + this.OKAY = 100; + this.OKAY_BUILD_STARTED = 101; + this.STATUS_ERROR_GENERIC = 1000; + this.STATUS_ERROR_CAPTAIN_NOT_INITIALIZED = 1001; + this.STATUS_ERROR_USER_NOT_INITIALIZED = 1101; + this.STATUS_ERROR_NOT_AUTHORIZED = 1102; + this.STATUS_ERROR_ALREADY_EXIST = 1103; + this.STATUS_ERROR_BAD_NAME = 1104; + this.STATUS_WRONG_PASSWORD = 1105; + this.STATUS_AUTH_TOKEN_INVALID = 1106; + this.VERIFICATION_FAILED = 1107; + this.UNKNOWN_ERROR = 1999; + } + createError(status, message) { + let e = new Error(message); + e.captainStatus = status; + e.captainMessage = message; + return e; + } + eatUpPromiseRejection() { + return function (error) { + // nom nom + }; + } +} +exports.default = new ErrorFactory(); +//# sourceMappingURL=ErrorFactory.js.map \ No newline at end of file diff --git a/app-cli/built/utils/ErrorFactory.js.map b/app-cli/built/utils/ErrorFactory.js.map new file mode 100755 index 0000000..3c09d5e --- /dev/null +++ b/app-cli/built/utils/ErrorFactory.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ErrorFactory.js","sourceRoot":"","sources":["../../src/utils/ErrorFactory.ts"],"names":[],"mappings":";;AACA,MAAM,YAAY;IAgBhB;QAfgB,SAAI,GAAG,GAAG,CAAC;QACX,uBAAkB,GAAG,GAAG,CAAC;QAEzB,yBAAoB,GAAG,IAAI,CAAC;QAC5B,yCAAoC,GAAG,IAAI,CAAC;QAC5C,sCAAiC,GAAG,IAAI,CAAC;QACzC,gCAA2B,GAAG,IAAI,CAAC;QACnC,+BAA0B,GAAG,IAAI,CAAC;QAClC,0BAAqB,GAAG,IAAI,CAAC;QAC7B,0BAAqB,GAAG,IAAI,CAAC;QAC7B,8BAAyB,GAAG,IAAI,CAAC;QACjC,wBAAmB,GAAG,IAAI,CAAC;QAE3B,kBAAa,GAAG,IAAI,CAAC;IAEtB,CAAC;IAEhB,WAAW,CAAC,MAAc,EAAE,OAAe;QACzC,IAAI,CAAC,GAAG,IAAI,KAAK,CAAC,OAAO,CAAQ,CAAC;QAClC,CAAC,CAAC,aAAa,GAAG,MAAM,CAAC;QACzB,CAAC,CAAC,cAAc,GAAG,OAAO,CAAC;QAC3B,OAAO,CAAC,CAAC;IACX,CAAC;IAED,qBAAqB;QACnB,OAAO,UAAS,KAAU;YACxB,UAAU;QACZ,CAAC,CAAC;IACJ,CAAC;CACF;AAED,kBAAe,IAAI,YAAY,EAAE,CAAC"} \ No newline at end of file diff --git a/app-cli/built/utils/Logger.js b/app-cli/built/utils/Logger.js new file mode 100755 index 0000000..3b782c5 --- /dev/null +++ b/app-cli/built/utils/Logger.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class Logger { + static log(s) { + console.log(s); + } + static error(s) { + console.error(s); + } + static dev(s) { + if (process.env.CLI_IS_DEBUG) { + console.log(">>> ", s); + } + } +} +exports.default = Logger; +//# sourceMappingURL=Logger.js.map \ No newline at end of file diff --git a/app-cli/built/utils/Logger.js.map b/app-cli/built/utils/Logger.js.map new file mode 100755 index 0000000..d200ceb --- /dev/null +++ b/app-cli/built/utils/Logger.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../src/utils/Logger.ts"],"names":[],"mappings":";;AAAA,MAAqB,MAAM;IACzB,MAAM,CAAC,GAAG,CAAC,CAAS;QAClB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,CAAM;QACjB,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,CAAS;QAClB,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE;YAC5B,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;SACxB;IACH,CAAC;CACF;AAdD,yBAcC"} \ No newline at end of file diff --git a/app-cli/built/helpers/SpinnerHelper.js b/app-cli/built/utils/SpinnerHelper.js similarity index 77% rename from app-cli/built/helpers/SpinnerHelper.js rename to app-cli/built/utils/SpinnerHelper.js index 4aecc4d..b0d8568 100755 --- a/app-cli/built/helpers/SpinnerHelper.js +++ b/app-cli/built/utils/SpinnerHelper.js @@ -1,3 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); const ora = require('ora'); class SpinnerHelper { start(message) { @@ -16,5 +18,5 @@ class SpinnerHelper { this.spinner.fail(); } } -module.exports = new SpinnerHelper(); +exports.default = SpinnerHelper; //# sourceMappingURL=SpinnerHelper.js.map \ No newline at end of file diff --git a/app-cli/built/helpers/SpinnerHelper.js.map b/app-cli/built/utils/SpinnerHelper.js.map similarity index 75% rename from app-cli/built/helpers/SpinnerHelper.js.map rename to app-cli/built/utils/SpinnerHelper.js.map index f62b4db..af82a33 100755 --- a/app-cli/built/helpers/SpinnerHelper.js.map +++ b/app-cli/built/utils/SpinnerHelper.js.map @@ -1 +1 @@ -{"version":3,"file":"SpinnerHelper.js","sourceRoot":"","sources":["../../src/helpers/SpinnerHelper.ts"],"names":[],"mappings":"AAAA,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAE3B,MAAM,aAAa;IAGlB,KAAK,CAAC,OAAe;QACpB,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC;IACrC,CAAC;IAED,QAAQ,CAAC,KAAa;QACrB,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IAC5B,CAAC;IAED,IAAI;QACH,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;IAED,OAAO;QACN,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,IAAI;QACH,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;CACD;AAED,MAAM,CAAC,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"SpinnerHelper.js","sourceRoot":"","sources":["../../src/utils/SpinnerHelper.ts"],"names":[],"mappings":";;AAAA,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAE3B,MAAM,aAAa;IAGlB,KAAK,CAAC,OAAe;QACpB,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC;IACrC,CAAC;IAED,QAAQ,CAAC,KAAa;QACrB,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IAC5B,CAAC;IAED,IAAI;QACH,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;IAED,OAAO;QACN,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,IAAI;QACH,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;CACD;AAED,kBAAe,aAAa,CAAC"} \ No newline at end of file diff --git a/app-cli/built/utils/StdOutUtil.js b/app-cli/built/utils/StdOutUtil.js new file mode 100755 index 0000000..a916a22 --- /dev/null +++ b/app-cli/built/utils/StdOutUtil.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const chalk = require('chalk'); +class StdOutUtils { + printMessage(message) { + console.log(message); + } + printMessageAndExit(message) { + console.log(message); + process.exit(0); + } + printGreenMessage(message, exit = false) { + console.log(`${chalk.green(message)}`); + exit && process.exit(0); + } + printMagentaMessage(message, exit = false) { + console.log(`${chalk.magenta(message)}`); + exit && process.exit(0); + } + printError(error, exit = false) { + console.log(`${chalk.bold.red(error)}`); + exit && process.exit(0); + } + errorHandler(error) { + if (error.status) { + this.printError(`\nError: ${error.status}\nError: ${error.description}`, true); + } + else { + this.printError(`\nError: ${error}`, true); + } + } +} +exports.default = new StdOutUtils(); +//# sourceMappingURL=StdOutUtil.js.map \ No newline at end of file diff --git a/app-cli/built/utils/StdOutUtil.js.map b/app-cli/built/utils/StdOutUtil.js.map new file mode 100755 index 0000000..bc1f5d2 --- /dev/null +++ b/app-cli/built/utils/StdOutUtil.js.map @@ -0,0 +1 @@ +{"version":3,"file":"StdOutUtil.js","sourceRoot":"","sources":["../../src/utils/StdOutUtil.ts"],"names":[],"mappings":";;AAAA,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/B,MAAM,WAAW;IAChB,YAAY,CAAC,OAAe;QAC3B,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC;IAED,mBAAmB,CAAC,OAAe;QAClC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAErB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IAED,iBAAiB,CAAC,OAAe,EAAE,IAAI,GAAG,KAAK;QAC9C,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAEvC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IAED,mBAAmB,CAAC,OAAe,EAAE,IAAI,GAAG,KAAK;QAChD,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAEzC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IAED,UAAU,CAAC,KAAa,EAAE,IAAI,GAAG,KAAK;QACrC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAExC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IAED,YAAY,CAAC,KAAU;QACtB,IAAI,KAAK,CAAC,MAAM,EAAE;YACjB,IAAI,CAAC,UAAU,CAAC,YAAY,KAAK,CAAC,MAAM,YAAY,KAAK,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,CAAC;SAC/E;aAAM;YACN,IAAI,CAAC,UAAU,CAAC,YAAY,KAAK,EAAE,EAAE,IAAI,CAAC,CAAC;SAC3C;IACF,CAAC;CACD;AACD,kBAAe,IAAI,WAAW,EAAE,CAAC"} \ No newline at end of file diff --git a/app-cli/built/utils/StorageHelper.js b/app-cli/built/utils/StorageHelper.js new file mode 100755 index 0000000..d0338a2 --- /dev/null +++ b/app-cli/built/utils/StorageHelper.js @@ -0,0 +1,57 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const ConfigStore = require("configstore"); +const Utils_1 = require("./Utils"); +const CAP_MACHINES = 'CapMachines'; +const DEPLOYED_DIRS = 'DeployedDirs'; +class StorageHelper { + static get() { + if (!StorageHelper.instance) + StorageHelper.instance = new StorageHelper(); + return StorageHelper.instance; + } + constructor() { + this.data = new ConfigStore('new-captainduckduck'); + // migrate data! TODO + } + getMachines() { + return Utils_1.default.copyObject(this.data.get(CAP_MACHINES) || []); + } + saveMachine(machineToSaveOrUpdate) { + const currMachines = this.getMachines(); + let updatedMachine = false; + for (let index = 0; index < currMachines.length; index++) { + const element = currMachines[index]; + if (element.name === machineToSaveOrUpdate.name) { + updatedMachine = true; + currMachines[index] = machineToSaveOrUpdate; + break; + } + } + if (!updatedMachine) { + currMachines.push(machineToSaveOrUpdate); + } + this.data.set(CAP_MACHINES, currMachines); + } + getDeployedDirectories() { + return Utils_1.default.copyObject(this.data.get(DEPLOYED_DIRS) || []); + } + saveDeployedDirectory(directoryToSaveOrUpdate) { + const currDirs = this.getDeployedDirectories(); + let updatedDir = false; + for (let index = 0; index < currDirs.length; index++) { + const element = currDirs[index]; + if (element.cwd === directoryToSaveOrUpdate.cwd) { + updatedDir = true; + currDirs[index] = directoryToSaveOrUpdate; + break; + } + } + if (!updatedDir) { + currDirs.push(directoryToSaveOrUpdate); + } + this.data.set(DEPLOYED_DIRS, currDirs); + } +} +exports.default = StorageHelper; +//# sourceMappingURL=StorageHelper.js.map \ No newline at end of file diff --git a/app-cli/built/utils/StorageHelper.js.map b/app-cli/built/utils/StorageHelper.js.map new file mode 100755 index 0000000..888a4db --- /dev/null +++ b/app-cli/built/utils/StorageHelper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"StorageHelper.js","sourceRoot":"","sources":["../../src/utils/StorageHelper.ts"],"names":[],"mappings":";;AACA,2CAA2C;AAC3C,mCAA4B;AAE5B,MAAM,YAAY,GAAG,aAAa,CAAC;AACnC,MAAM,aAAa,GAAG,cAAc,CAAC;AAErC,MAAqB,aAAa;IAGjC,MAAM,CAAC,GAAG;QACT,IAAI,CAAC,aAAa,CAAC,QAAQ;YAAE,aAAa,CAAC,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;QAC1E,OAAO,aAAa,CAAC,QAAQ,CAAC;IAC/B,CAAC;IAID;QACC,IAAI,CAAC,IAAI,GAAG,IAAI,WAAW,CAAC,qBAAqB,CAAC,CAAC;QACnD,qBAAqB;IACtB,CAAC;IAED,WAAW;QACV,OAAO,eAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC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EAAE;YAChB,QAAQ,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;SACvC;QAED,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC;CACD;AA5DD,gCA4DC"} \ No newline at end of file diff --git a/app-cli/built/utils/Utils.js b/app-cli/built/utils/Utils.js new file mode 100755 index 0000000..1d974c6 --- /dev/null +++ b/app-cli/built/utils/Utils.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = { + copyObject(obj) { + return JSON.parse(JSON.stringify(obj)); + }, + generateUuidV4() { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { + var r = (Math.random() * 16) | 0, v = c === 'x' ? r : (r & 0x3) | 0x8; + return v.toString(16); + }); + }, + getAnsiColorRegex() { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + return new RegExp(pattern, 'g'); + }, + cleanUpUrl(urlInput) { + if (!urlInput || !urlInput.length) + return null; + let cleanedUrl = urlInput; + if (cleanedUrl.indexOf('#') >= 0) + cleanedUrl = cleanedUrl.substr(0, cleanedUrl.indexOf('#')); + const hasSlashAtTheEnd = cleanedUrl.substr(cleanedUrl.length - 1, 1) === '/'; + if (hasSlashAtTheEnd) { + // Remove the slash at the end + cleanedUrl = cleanedUrl.substr(0, cleanedUrl.length - 1); + } + cleanedUrl = cleanedUrl.replace('http://', '').replace('https://', '').trim(); + return cleanedUrl; + } +}; +//# sourceMappingURL=Utils.js.map \ No newline at end of file diff --git a/app-cli/built/utils/Utils.js.map b/app-cli/built/utils/Utils.js.map new file mode 100755 index 0000000..923a634 --- /dev/null +++ b/app-cli/built/utils/Utils.js.map @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rB,8BAA8B;YAC9B,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;SACzD;QAED,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QAE9E,OAAO,UAAU,CAAC;IACnB,CAAC;CACD,CAAC"} \ No newline at end of file diff --git a/app-cli/built/utils/__tests__/loginHelpers.test.js b/app-cli/built/utils/__tests__/loginHelpers.test.js deleted file mode 100755 index ca3a4cf..0000000 --- a/app-cli/built/utils/__tests__/loginHelpers.test.js +++ /dev/null @@ -1,37 +0,0 @@ -const { cleanUpUrl, findDefaultCaptainName, getCaptainFullName } = require("../loginHelpers"); -jest.mock("../../helpers/MachineHelper", () => { - return { - machines: [ - { - baseUrl: "https://captain.myfirstmachine.com", - name: "machine-01", - authToken: "token1" - }, - { - baseUrl: "https://captain.mysecondmachine.com", - name: "machine-02", - authToken: "token2" - } - ] - }; -}); -describe("Login helpers", () => { - it("should clean a url", () => { - const mockUrl = "https://www.google.com"; - const expectedResult = "www.google.com"; - const result = cleanUpUrl(mockUrl); - expect(result).toBe(expectedResult); - }); - it("should get a captain machine name", () => { - const result = getCaptainFullName(1); - const expectedResult = "captain-01"; - expect(result).toBe(expectedResult); - }); - it("should find an unused name for a possible new captain machine", () => { - // If machines are 2, then it should be with suffix 03 - const result = findDefaultCaptainName(); - const expectedResult = "captain-03"; - expect(result).toBe(expectedResult); - }); -}); -//# sourceMappingURL=loginHelpers.test.js.map \ No newline at end of file diff --git a/app-cli/built/utils/__tests__/loginHelpers.test.js.map b/app-cli/built/utils/__tests__/loginHelpers.test.js.map deleted file mode 100755 index 670d8a1..0000000 --- a/app-cli/built/utils/__tests__/loginHelpers.test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"loginHelpers.test.js","sourceRoot":"","sources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C,CAAC,CAAA"} \ No newline at end of file diff --git a/app-cli/built/utils/__tests__/machineUtils.test.js b/app-cli/built/utils/__tests__/machineUtils.test.js deleted file mode 100755 index 4d605b4..0000000 --- a/app-cli/built/utils/__tests__/machineUtils.test.js +++ /dev/null @@ -1,60 +0,0 @@ -const { initMachineFromLocalStorage, saveMachineToLocalStorage } = require("../machineUtils"); -const DeployApi = require("../../api/DeployApi"); -const MachineHelper = require("../../helpers/MachineHelper"); -const mockUpdatedApps = [ - { - cwd: process.cwd(), - appName: "captain-node-app-new-name", - branchToPush: "master", - machineToDeploy: { - baseUrl: "https://int-test.captainduckduck.com", - name: "int-test", - authToken: "token1" - } - } -]; -jest.mock("../../helpers/MachineHelper", () => { - return { - apps: [ - { - cwd: process.cwd(), - appName: "captain-node-app", - branchToPush: "master", - machineToDeploy: { - baseUrl: "https://int-test.captainduckduck.com", - name: "int-test", - authToken: "token1" - } - } - ], - setApps: jest.fn() - }; -}); -jest.mock("../../api/DeployApi", () => { - return { - setMachineToDeploy: jest.fn(), - setAppName: jest.fn(), - setBranchToPush: jest.fn(), - appName: "captain-node-app-new-name", - branchToPush: "master", - machineToDeploy: { - baseUrl: "https://int-test.captainduckduck.com", - name: "int-test", - authToken: "token1" - } - }; -}); -describe("Machine utils", () => { - it("should init machine from localStorage", () => { - initMachineFromLocalStorage(); - expect(DeployApi.setMachineToDeploy).toHaveBeenCalledTimes(1); - expect(DeployApi.setAppName).toHaveBeenCalledTimes(1); - expect(DeployApi.setBranchToPush).toHaveBeenCalledTimes(1); - }); - it("should update an app from localstorage", () => { - saveMachineToLocalStorage(); - const updatedApps = mockUpdatedApps; - expect(MachineHelper.setApps).toBeCalledWith(updatedApps); - }); -}); -//# sourceMappingURL=machineUtils.test.js.map \ No newline at end of file diff --git a/app-cli/built/utils/__tests__/machineUtils.test.js.map b/app-cli/built/utils/__tests__/machineUtils.test.js.map deleted file mode 100755 index 00bccb8..0000000 --- a/app-cli/built/utils/__tests__/machineUtils.test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"machineUtils.test.js","sourceRoot":"","sources":["../../../src/utils/__tests__/machineUtils.test.js"],"names":[],"mappings":"AAAA,MAAM,EACJ,2BAA2B,EAC3B,yBAAyB,EAC1B,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;AAC9B,MAAM,SAAS,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAChD,MAAM,aAAa,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAA;AAC5D,MAAM,eAAe,GAAG;IACtB;QACE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,OAAO,EAAE,2BAA2B;QACpC,YAAY,EAAE,QAAQ;QACtB,eAAe,EAAE;YACf,OAAO,EAAE,sCAAsC;YAC/C,IAAI,EAAE,UAAU;YAChB,SAAS,EAAE,QAAQ;SACpB;KACF;CACF,CAAA;AAED,IAAI,CAAC,IAAI,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC5C,OAAO;QACL,IAAI,EAAE;YACJ;gBACE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;gBAClB,OAAO,EAAE,kBAAkB;gBAC3B,YAAY,EAAE,QAAQ;gBACtB,eAAe,EAAE;oBACf,OAAO,EAAE,sCAAsC;oBAC/C,IAAI,EAAE,UAAU;oBAChB,SAAS,EAAE,QAAQ;iBACpB;aACF;SACF;QACD,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE;KACnB,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACpC,OAAO;QACL,kBAAkB,EAAE,IAAI,CAAC,EAAE,EAAE;QAC7B,UAAU,EAAE,IAAI,CAAC,EAAE,EAAE;QACrB,eAAe,EAAE,IAAI,CAAC,EAAE,EAAE;QAC1B,OAAO,EAAE,2BAA2B;QACpC,YAAY,EAAE,QAAQ;QACtB,eAAe,EAAE;YACf,OAAO,EAAE,sCAAsC;YAC/C,IAAI,EAAE,UAAU;YAChB,SAAS,EAAE,QAAQ;SACpB;KACF,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC/C,2BAA2B,EAAE,CAAA;QAE7B,MAAM,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;QAE7D,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;QAErD,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;IAC5D,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,yBAAyB,EAAE,CAAA;QAE3B,MAAM,WAAW,GAAG,eAAe,CAAA;QAEnC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,CAAA;IAC3D,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/app-cli/built/utils/__tests__/validationsHandler.test.js b/app-cli/built/utils/__tests__/validationsHandler.test.js deleted file mode 100755 index 7e01ae6..0000000 --- a/app-cli/built/utils/__tests__/validationsHandler.test.js +++ /dev/null @@ -1,75 +0,0 @@ -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -const { validateIsGitRepository, validateDefinitionFile, optionIsNotGiven, isIpAddress, validateAuthentication } = require("../validationsHandler"); -const { printError } = require("../messageHandler"); -const { requestLogin } = require("../../commands/login"); -const { initMachineFromLocalStorage } = require("../machineUtils"); -jest.mock("fs"); -jest.mock("../messageHandler", () => { - return { - printError: jest.fn() - }; -}); -jest.mock("../../api/DeployApi", () => { - return { - isAuthTokenValid: jest.fn(() => false) // Simulates it's not authenticated - }; -}); -jest.mock("../../commands/login", () => { - return { - requestLogin: jest.fn() - }; -}); -jest.mock("../machineUtils", () => { - return { - initMachineFromLocalStorage: jest.fn() - }; -}); -describe("Validations handler", () => { - it("should printError if not on a git repository", () => { - validateIsGitRepository(); - expect(printError).toHaveBeenCalledTimes(1); - }); - it("should printError if there is no captain definition file", () => { - validateDefinitionFile(); - // 2nd time because file was not found - // 3rd time because it tried to read from a file and was not valid json - expect(printError).toHaveBeenCalledTimes(3); - }); - it("should return false if the option is included", () => { - const options = { - branch: "master" - }; - const result = optionIsNotGiven(options, "branch"); - expect(result).toBe(false); - }); - it("should return true if the option is not given", () => { - const options = { - test: "something" - }; - const result = optionIsNotGiven(options, "branch"); - expect(result).toBe(true); - }); - it("should be a valid IP Address", () => { - const validIpAddress = "192.168.1.1"; - const result = isIpAddress(validIpAddress); - expect(result).toBe(true); - }); - it("should be an invalid IP Address", () => { - const validIpAddress = "192.168.1"; - const result = isIpAddress(validIpAddress); - expect(result).toBe(false); - }); - it("should promt the login option and initialize from the machine in localstorage", () => __awaiter(this, void 0, void 0, function* () { - yield validateAuthentication(); - expect(requestLogin).toBeCalledTimes(1); - expect(initMachineFromLocalStorage).toBeCalledTimes(1); - })); -}); -//# sourceMappingURL=validationsHandler.test.js.map \ No newline at end of file diff --git a/app-cli/built/utils/__tests__/validationsHandler.test.js.map b/app-cli/built/utils/__tests__/validationsHandler.test.js.map deleted file mode 100755 index af4dbec..0000000 --- a/app-cli/built/utils/__tests__/validationsHandler.test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"validationsHandler.test.js","sourceRoot":"","sources":["../../../src/utils/__tests__/validationsHandler.test.js"],"names":[],"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MAAM,sBAAsB,EAAE,CAAA;QAE9B,MAAM,CAAC,YAAY,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;QAEvC,MAAM,CAAC,2BAA2B,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;IACxD,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/app-cli/built/utils/constants.js.map b/app-cli/built/utils/constants.js.map deleted file mode 100755 index ea59067..0000000 --- a/app-cli/built/utils/constants.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":";AAAA,MAAM,aAAa,GAAG,oCAAoC,CAAA;AAC1D,MAAM,SAAS,GAAG,iBAAiB,CAAA;AACnC,MAAM,gBAAgB,GAAG,WAAW,CAAA;AACpC,MAAM,sBAAsB,GAAG,cAAc,CAAA;AAC7C,MAAM,gBAAgB,GAAG,SAAS,CAAA;AAClC,MAAM,YAAY,GAAG,EAAE,CAAA;AAEvB,iBAAS;IACP,aAAa;IACb,SAAS;IACT,gBAAgB;IAChB,sBAAsB;IACtB,gBAAgB;IAChB,YAAY;CACb,CAAA"} \ No newline at end of file diff --git a/app-cli/built/utils/fileHelper.js b/app-cli/built/utils/fileHelper.js deleted file mode 100755 index 8156914..0000000 --- a/app-cli/built/utils/fileHelper.js +++ /dev/null @@ -1,146 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -const { printMessage, printError, printGreenMessage, printMagentaMessage } = require('./messageHandler'); -const SpinnerHelper = require('../helpers/SpinnerHelper'); -const child_process_1 = require("child_process"); -const fs = require("fs-extra"); -const ProgressBar = require('progress'); -const DeployApi = require('../api/DeployApi'); -const { saveMachineToLocalStorage } = require('../utils/machineUtils'); -let lastLineNumberPrinted = -10000; // we want to show all lines to begin with! -function gitArchiveFile(zipFileFullPath, branchToPush) { - child_process_1.exec(`git archive --format tar --output "${zipFileFullPath}" ${branchToPush}`, (err, stdout, stderr) => { - if (err) { - printError(`TAR file failed\n${err}\n`); - fs.removeSync(zipFileFullPath); - return; - } - child_process_1.exec(`git rev-parse ${branchToPush}`, (err, stdout, stderr) => { - const gitHash = (stdout || '').trim(); - if (err || !/^[a-f0-9]{40}$/.test(gitHash)) { - printError(`Cannot find hash of last commit on this branch: ${branchToPush}\n${gitHash}\n${err}\n`); - return; - } - printMessage(`Pushing last commit on ${branchToPush}: ${gitHash}`); - uploadFile(zipFileFullPath, gitHash); - }); - }); -} -function onLogRetrieved(data) { - if (data) { - const lines = data.logs.lines; - const firstLineNumberOfLogs = data.logs.firstLineNumber; - let firstLinesToPrint = 0; - if (firstLineNumberOfLogs > lastLineNumberPrinted) { - if (firstLineNumberOfLogs < 0) { - // This is the very first fetch, probably firstLineNumberOfLogs is around -50 - firstLinesToPrint = -firstLineNumberOfLogs; - } - else { - printMessage('[[ TRUNCATED ]]'); - } - } - else { - firstLinesToPrint = lastLineNumberPrinted - firstLineNumberOfLogs; - } - lastLineNumberPrinted = firstLineNumberOfLogs + lines.length; - for (let i = firstLinesToPrint; i < lines.length; i++) { - printMessage((lines[i] || '').trim()); - } - } - const finishedBuilding = data && !data.isAppBuilding; - if (finishedBuilding) { - if (!data.isBuildFailed) { - printGreenMessage(`Deployed successfully: ${DeployApi.appName}`); - printMagentaMessage(`App is available at ${DeployApi.appUrl}\n`, true); - } - else { - printError(`\nSomething bad happened. Cannot deploy "${DeployApi.appName}"\n`, true); - } - } - setTimeout(() => { - startFetchingBuildLogs(); - }, 2000); -} -function startFetchingBuildLogs() { - return __awaiter(this, void 0, void 0, function* () { - try { - const data = yield DeployApi.fetchBuildLogs(); - const response = JSON.parse(data); - if (response.status !== 100) { - throw new Error(JSON.stringify(response, null, 2)); - } - onLogRetrieved(response.data); - } - catch (error) { - printError(`\nSomething while retrieving app build logs.. ${error}\n`); - // onLogRetrieved() // TODO - should this be here? - } - }); -} -function getFileStream(zipFileFullPath) { - const fileSize = fs.statSync(zipFileFullPath).size; - const fileStream = fs.createReadStream(zipFileFullPath); - const barOpts = { - width: 20, - total: fileSize, - clear: true - }; - const bar = new ProgressBar(' uploading [:bar] :percent (ETA :etas)', barOpts); - fileStream.on('data', (chunk) => { - bar.tick(chunk.length); - }); - fileStream.on('end', () => { - printMessage('This might take several minutes. PLEASE BE PATIENT...'); - SpinnerHelper.start('Building your source code...'); - SpinnerHelper.setColor('yellow'); - }); - return fileStream; -} -function uploadFile(filePath, gitHash) { - return __awaiter(this, void 0, void 0, function* () { - try { - printMessage(`Uploading file to ${DeployApi.machineToDeploy.baseUrl}`); - const fileStream = getFileStream(filePath); - const response = yield DeployApi.sendFile(fileStream, gitHash); - const data = JSON.parse(response); - const somethingWentWrong = data.status !== 100 && data.status !== 101; - const isDeployedAndBuilding = data.status === 101; - const isDeployedSuccessfully = data.status === 100; - if (somethingWentWrong) { - throw new Error(JSON.stringify(data, null, 2)); - } - deleteFileFromDisk(filePath); // Uncomment this - // Save app to local storage - saveMachineToLocalStorage(); - if (isDeployedAndBuilding) { - startFetchingBuildLogs(); - } - if (isDeployedSuccessfully) { - printGreenMessage(`Deployed successfully: ${DeployApi.appName}\n`, true); - } - } - catch (e) { - printError(e.message, true); - } - }); -} -function deleteFileFromDisk(filePath) { - if (fs.pathExistsSync(filePath)) { - fs.removeSync(filePath); - } -} -module.exports = { - gitArchiveFile, - getFileStream, - uploadFile, - startFetchingBuildLogs -}; -//# sourceMappingURL=fileHelper.js.map \ No newline at end of file diff --git a/app-cli/built/utils/fileHelper.js.map b/app-cli/built/utils/fileHelper.js.map deleted file mode 100755 index 216292f..0000000 --- a/app-cli/built/utils/fileHelper.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fileHelper.js","sourceRoot":"","sources":["../../src/utils/fileHelper.ts"],"names":[],"mappings":";;;;;;;;;AAAA,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AACzG,MAAM,aAAa,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAC1D,iDAAqC;AACrC,+BAA+B;AAC/B,MAAM,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACxC,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC9C,MAAM,EAAE,yBAAyB,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AACvE,IAAI,qBAAqB,GAAG,CAAC,KAAK,CAAC,CAAC,2CAA2C;AAW/E,SAAS,cAAc,CAAC,eAAuB,EAAE,YAAoB;IACpE,oBAAI,CAAC,sCAAsC,eAAe,KAAK,YAAY,EAAE,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;QACtG,IAAI,GAAG,EAAE;YACR,UAAU,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;YAExC,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;YAE/B,OAAO;SACP;QAED,oBAAI,CAAC,iBAAiB,YAAY,EAAE,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;YAC7D,MAAM,OAAO,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;YAEtC,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;gBAC3C,UAAU,CAAC,mDAAmD,YAAY,KAAK,OAAO,KAAK,GAAG,IAAI,CAAC,CAAC;gBAEpG,OAAO;aACP;YAED,YAAY,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AC;SAC5B;IACF,CAAC;CAAA;AAED,SAAS,kBAAkB,CAAC,QAAgB;IAC3C,IAAI,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;QAChC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;KACxB;AACF,CAAC;AACD,iBAAS;IACR,cAAc;IACd,aAAa;IACb,UAAU;IACV,sBAAsB;CACtB,CAAC"} \ No newline at end of file diff --git a/app-cli/built/utils/loginHelpers.js b/app-cli/built/utils/loginHelpers.js deleted file mode 100755 index 13a102e..0000000 --- a/app-cli/built/utils/loginHelpers.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -const MachineHelper_1 = require("../helpers/MachineHelper"); -function cleanUpUrl(url) { - if (!url || !url.length) - return null; - let cleanedUrl = url; - const hasSlashAtTheEnd = url.substr(url.length - 1, 1) === '/'; - if (hasSlashAtTheEnd) { - // Remove the slash at the end - cleanedUrl = url.substr(0, url.length - 1); - } - return cleanedUrl.replace('http://', '').replace('https://', '').trim(); -} -function findDefaultCaptainName() { - let currentSuffix = MachineHelper_1.default.getMachines().length + 1; - while (!isSuffixValid(currentSuffix)) { - currentSuffix++; - } - return getCaptainFullName(currentSuffix); -} -function getCaptainFullName(suffix) { - const formatSuffix = suffix < 10 ? `0${suffix}` : suffix; - return `captain-${formatSuffix}`; -} -const isSuffixValid = (suffixNumber) => MachineHelper_1.default.getMachines().map((machine) => { - machine.name !== getCaptainFullName(suffixNumber); -}); -module.exports = { - cleanUpUrl, - findDefaultCaptainName, - isSuffixValid, - getCaptainFullName -}; -//# sourceMappingURL=loginHelpers.js.map \ No newline at end of file diff --git a/app-cli/built/utils/loginHelpers.js.map b/app-cli/built/utils/loginHelpers.js.map deleted file mode 100755 index f624f74..0000000 --- a/app-cli/built/utils/loginHelpers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"loginHelpers.js","sourceRoot":"","sources":["../../src/utils/loginHelpers.ts"],"names":[],"mappings":";AACA,4DAAqD;A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ACb,kBAAkB;CAClB,CAAC"} \ No newline at end of file diff --git a/app-cli/built/utils/machineUtils.js b/app-cli/built/utils/machineUtils.js deleted file mode 100755 index 85ebd35..0000000 --- a/app-cli/built/utils/machineUtils.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; -const DeployApi = require('../api/DeployApi'); -const MachineHelper_1 = require("../helpers/MachineHelper"); -function initMachineFromLocalStorage() { - const possibleApp = MachineHelper_1.default.getApps().find((app) => app.cwd === process.cwd()); - if (possibleApp) { - DeployApi.setMachineToDeploy(possibleApp.machineToDeploy); - DeployApi.setAppName(possibleApp.appName); - DeployApi.setBranchToPush(possibleApp.branchToPush); - } -} -// Saves the app directory into local storage -function saveMachineToLocalStorage() { - const apps = MachineHelper_1.default.getApps(); - const currentDirectory = process.cwd(); - let appExists = false; - // Update app - const updatedApps = apps.map((app) => { - if (app.cwd === currentDirectory) { - appExists = true; - return { - cwd: app.cwd, - appName: DeployApi.appName, - branchToPush: DeployApi.branchToPush, - machineToDeploy: DeployApi.machineToDeploy - }; - } - return app; - }); - MachineHelper_1.default.setApps(updatedApps); - if (!appExists) { - const newApp = { - cwd: process.cwd(), - appName: DeployApi.appName, - branchToPush: DeployApi.branchToPush, - machineToDeploy: DeployApi.machineToDeploy - }; - updatedApps.push(newApp); - MachineHelper_1.default.setApps(apps); - } -} -module.exports = { - initMachineFromLocalStorage, - saveMachineToLocalStorage -}; -//# sourceMappingURL=machineUtils.js.map \ No newline at end of file diff --git a/app-cli/built/utils/machineUtils.js.map b/app-cli/built/utils/machineUtils.js.map deleted file mode 100755 index 0b31fed..0000000 --- a/app-cli/built/utils/machineUtils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"machineUtils.js","sourceRoot":"","sources":["../../src/utils/machineUtils.ts"],"names":[],"mappings":";AAEA,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC9C,4DAAqD;AAErD,SAAS,2BAA2B;IACnC,MAAM,WAAW,GAAG,u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MAAM,CAAC,CAAC;QAEzB,uBAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KAC5B;AACF,CAAC;AAED,iBAAS;IACR,2BAA2B;IAC3B,yBAAyB;CACzB,CAAC"} \ No newline at end of file diff --git a/app-cli/built/utils/messageHandler.js b/app-cli/built/utils/messageHandler.js deleted file mode 100755 index 22c9094..0000000 --- a/app-cli/built/utils/messageHandler.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -const chalk = require('chalk'); -function printMessage(message) { - console.log(message); -} -function printMessageAndExit(message) { - console.log(message); - process.exit(0); -} -function printGreenMessage(message, exit = false) { - console.log(`${chalk.green(message)}`); - exit && process.exit(0); -} -function printMagentaMessage(message, exit = false) { - console.log(`${chalk.magenta(message)}`); - exit && process.exit(0); -} -function printError(error, exit = false) { - console.log(`${chalk.bold.red(error)}`); - exit && process.exit(0); -} -function errorHandler(error) { - if (error.status) { - printError(`\nError: ${error.status}\nError: ${error.description}`, true); - } - else { - printError(`\nError: ${error}`, true); - } -} -module.exports = { - printMessage, - printMessageAndExit, - printError, - printGreenMessage, - printMagentaMessage, - errorHandler -}; -//# sourceMappingURL=messageHandler.js.map \ No newline at end of file diff --git a/app-cli/built/utils/messageHandler.js.map b/app-cli/built/utils/messageHandler.js.map deleted file mode 100755 index ce6d4d9..0000000 --- a/app-cli/built/utils/messageHandler.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"messageHandler.js","sourceRoot":"","sources":["../../src/utils/messageHandler.ts"],"names":[],"mappings":";AAAA,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAE/B,SAAS,YAAY,CAAC,OAAe;IACpC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACtB,CAAC;AAED,SAAS,mBAAmB,CAAC,OAAe;IAC3C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAErB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAe,EAAE,IAAI,GAAG,KAAK;IACvD,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAEvC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACzB,CAAC;AAED,SAAS,mBAAmB,CAAC,OAAe,EAAE,IAAI,GAAG,KAAK;IACzD,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAEzC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACzB,CAAC;AAED,SAAS,UAAU,CAAC,KAAa,EAAE,IAAI,GAAG,KAAK;IAC9C,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAExC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACzB,CAAC;AAED,SAAS,YAAY,CAAC,KAAU;IAC/B,IAAI,KAAK,CAAC,MAAM,EAAE;QACjB,UAAU,CAAC,YAAY,KAAK,CAAC,MAAM,YAAY,KAAK,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,CAAC;KAC1E;SAAM;QACN,UAAU,CAAC,YAAY,KAAK,EAAE,EAAE,IAAI,CAAC,CAAC;KACtC;AACF,CAAC;AAED,iBAAS;IACR,YAAY;IACZ,mBAAmB;IACnB,UAAU;IACV,iBAAiB;IACjB,mBAAmB;IACnB,YAAY;CACZ,CAAC"} \ No newline at end of file diff --git a/app-cli/built/utils/validationsHandler.js b/app-cli/built/utils/validationsHandler.js deleted file mode 100755 index fc1bd61..0000000 --- a/app-cli/built/utils/validationsHandler.js +++ /dev/null @@ -1,84 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const fs = require('fs-extra'); -const DeployApi = require('../api/DeployApi'); -const { printError } = require('./messageHandler'); -const { requestLogin } = require('../commands/login'); -const { initMachineFromLocalStorage } = require('../utils/machineUtils'); -function validateIsGitRepository() { - const gitFolderExists = fs.pathExistsSync('./.git'); - if (!gitFolderExists) { - printError('\n**** ERROR: You are not in a git root directory. This command will only deploys the current directory ****\n', true); - } -} -exports.validateIsGitRepository = validateIsGitRepository; -function validateDefinitionFile() { - const captainDefinitionExists = fs.pathExistsSync('./captain-definition'); - if (!captainDefinitionExists) { - printError('\n**** ERROR: captain-definition file cannot be found. Please see docs! ****\n', true); - } - const contents = fs.readFileSync('./captain-definition', 'utf8'); - let contentsJson = null; - try { - contentsJson = JSON.parse(contents); - } - catch (e) { - printError(`**** ERROR: captain-definition file is not a valid JSON! ****\n Error:${e}`, true); - } - if (contentsJson) { - if (!contentsJson.schemaVersion) { - printError('**** ERROR: captain-definition needs schemaVersion. Please see docs! ****', true); - } - if (!contentsJson.templateId && !contentsJson.dockerfileLines) { - printError('**** ERROR: captain-definition needs templateId or dockerfileLines. Please see docs! ****', true); - } - if (contentsJson.templateId && contentsJson.dockerfileLines) { - printError('**** ERROR: captain-definition needs templateId or dockerfileLines, NOT BOTH! Please see docs! ****', true); - } - } -} -exports.validateDefinitionFile = validateDefinitionFile; -// Only show that question if there is no option given as argument -function optionIsNotGiven(allOptions, option) { - // console.log(allOptions) - if (allOptions[option]) { - return false; - } - return true; -} -exports.optionIsNotGiven = optionIsNotGiven; -function isIpAddress(ipaddress) { - if (/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(ipaddress)) { - return true; - } - return false; -} -exports.isIpAddress = isIpAddress; -function validateAuthentication() { - return __awaiter(this, void 0, void 0, function* () { - // 1. Check if valid auth - const isAuthenticated = yield DeployApi.isAuthTokenValid(); - // 2. Request login - // 3. Login - // 4. Update token - if (!isAuthenticated) { - const loggedInStatus = yield requestLogin(); - // Refresh token in DeployApi - initMachineFromLocalStorage(); - return loggedInStatus; - } - else { - return Boolean(isAuthenticated); - } - }); -} -exports.validateAuthentication = validateAuthentication; -//# sourceMappingURL=validationsHandler.js.map \ No newline at end of file diff --git a/app-cli/built/utils/validationsHandler.js.map b/app-cli/built/utils/validationsHandler.js.map deleted file mode 100755 index d09000e..0000000 --- a/app-cli/built/utils/validationsHandler.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"validationsHandler.js","sourceRoot":"","sources":["../../src/utils/validationsHandler.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAC/B,MAAM,SAAS,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC9C,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AACnD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AACtD,MAAM,EAAE,2BAA2B,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAEzE,SAAgB,uBAAuB;IACtC,MAAM,eAAe,GAAG,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAEpD,IAAI,CAAC,eAAe,EAAE;QACrB,UAAU,CACT,gHAAgH,EAChH,IAAI,CACJ,CAAC;KACF;AACF,CAAC;AATD,0DASC;AAED,SAAgB,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AC3C,yBAAyB;QACzB,MAAM,eAAe,GAAG,MAAM,SAAS,CAAC,gBAAgB,EAAE,CAAC;QAE3D,mBAAmB;QACnB,WAAW;QACX,kBAAkB;QAClB,IAAI,CAAC,eAAe,EAAE;YACrB,MAAM,cAAc,GAAG,MAAM,YAAY,EAAE,CAAC;YAE5C,6BAA6B;YAC7B,2BAA2B,EAAE,CAAC;YAE9B,OAAO,cAAc,CAAC;SACtB;aAAM;YACN,OAAO,OAAO,CAAC,eAAe,CAAC,CAAC;SAChC;IACF,CAAC;CAAA;AAjBD,wDAiBC"} \ No newline at end of file diff --git a/app-cli/package-lock.json b/app-cli/package-lock.json deleted file mode 100644 index 24b8eb6..0000000 --- a/app-cli/package-lock.json +++ /dev/null @@ -1,6415 +0,0 @@ -{ - "name": "captainduckduck", - "version": "1.1.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@babel/code-frame": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", - "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", - "dev": true, - "requires": { - "@babel/highlight": "^7.0.0" - } - }, - "@babel/highlight": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", - "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - } - }, - "@types/bluebird": { - "version": "3.5.25", - "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.25.tgz", - "integrity": "sha512-yfhIBix+AIFTmYGtkC0Bi+XGjSkOINykqKvO/Wqdz/DuXlAKK7HmhLAXdPIGsV4xzKcL3ev/zYc4yLNo+OvGaw==" - }, - "@types/caseless": { - "version": "0.12.1", - "resolved": "https://registry.npmjs.org/@types/caseless/-/caseless-0.12.1.tgz", - "integrity": "sha512-FhlMa34NHp9K5MY1Uz8yb+ZvuX0pnvn3jScRSNAb75KHGB8d3rEU6hqMs3Z2vjuytcMfRg6c5CHMc3wtYyD2/A==" - }, - "@types/form-data": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-2.2.1.tgz", - "integrity": "sha512-JAMFhOaHIciYVh8fb5/83nmuO/AHwmto+Hq7a9y8FzLDcC1KCU344XDOMEmahnrTFlHjgh4L0WJFczNIX2GxnQ==", - "requires": { - "@types/node": "*" - } - }, - "@types/fs-extra": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-5.0.4.tgz", - "integrity": "sha512-DsknoBvD8s+RFfSGjmERJ7ZOP1HI0UZRA3FSI+Zakhrc/Gy26YQsLI+m5V5DHxroHRJqCDLKJp7Hixn8zyaF7g==", - "requires": { - "@types/node": "*" - } - }, - "@types/node": { - "version": "10.12.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz", - "integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==" - }, - "@types/request": { - "version": "2.48.1", - "resolved": "https://registry.npmjs.org/@types/request/-/request-2.48.1.tgz", - "integrity": "sha512-ZgEZ1TiD+KGA9LiAAPPJL68Id2UWfeSO62ijSXZjFJArVV+2pKcsVHmrcu+1oiE3q6eDGiFiSolRc4JHoerBBg==", - "requires": { - "@types/caseless": "*", - "@types/form-data": "*", - "@types/node": "*", - "@types/tough-cookie": "*" - } - }, - "@types/request-promise": { - "version": "4.1.42", - "resolved": "https://registry.npmjs.org/@types/request-promise/-/request-promise-4.1.42.tgz", - "integrity": "sha512-b8li55sEZ00BXZstZ3d8WOi48dnapTqB1VufEG9Qox0nVI2JVnTVT1Mw4JbBa1j+1sGVX/qJ0R4WDv4v2GjT0w==", - "requires": { - "@types/bluebird": "*", - "@types/request": "*" - } - }, - "@types/tough-cookie": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.4.tgz", - "integrity": "sha512-Set5ZdrAaKI/qHdFlVMgm/GsAv/wkXhSTuZFkJ+JI7HK+wIkIlOaUXSXieIvJ0+OvGIqtREFoE+NHJtEq0gtEw==" - }, - "abab": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz", - "integrity": "sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w==", - "dev": true - }, - "acorn": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.4.tgz", - "integrity": "sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg==", - "dev": true - }, - "acorn-globals": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.0.tgz", - "integrity": "sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw==", - "dev": true, - "requires": { - "acorn": "^6.0.1", - "acorn-walk": "^6.0.1" - } - }, - "acorn-jsx": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz", - "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==", - "dev": true - }, - "acorn-walk": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz", - "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", - "dev": true - }, - "ajv": { - "version": "6.6.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.6.2.tgz", - "integrity": "sha512-FBHEW6Jf5TB9MGBgUUA9XHkTbjXYfAUjY43ACMfmdMRHniyoMHjHjzD50OK8LGDWQwp4rWEsIq5kEqq7rvIM1g==", - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-align": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", - "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", - "requires": { - "string-width": "^2.0.0" - } - }, - "ansi-escapes": { - "version": "3.1.0", - "resolved": "http://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", - "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==" - }, - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "requires": { - "color-convert": "^1.9.0" - } - }, - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - }, - "dependencies": { - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "http://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "http://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - } - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "append-transform": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-0.4.0.tgz", - "integrity": "sha1-126/jKlNJ24keja61EpLdKthGZE=", - "dev": true, - "requires": { - "default-require-extensions": "^1.0.0" - } - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, - "requires": { - "arr-flatten": "^1.0.1" - } - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true - }, - "array-equal": { - "version": "1.0.0", - "resolved": "http://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", - "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", - "dev": true - }, - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true - }, - "astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", - "dev": true - }, - "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", - "dev": true, - "requires": { - "lodash": "^4.17.10" - } - }, - "async-limiter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", - "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" - }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", - "dev": true - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "http://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "babel-core": { - "version": "6.26.3", - "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", - "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", - "dev": true, - "requires": { - "babel-code-frame": "^6.26.0", - "babel-generator": "^6.26.0", - "babel-helpers": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-register": "^6.26.0", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "convert-source-map": "^1.5.1", - "debug": "^2.6.9", - "json5": "^0.5.1", - "lodash": "^4.17.4", - "minimatch": "^3.0.4", - "path-is-absolute": "^1.0.1", - "private": "^0.1.8", - "slash": "^1.0.0", - "source-map": "^0.5.7" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "babel-generator": { - "version": "6.26.1", - "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", - "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", - "dev": true, - "requires": { - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "detect-indent": "^4.0.0", - "jsesc": "^1.3.0", - "lodash": "^4.17.4", - "source-map": "^0.5.7", - "trim-right": "^1.0.1" - } - }, - "babel-helpers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", - "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-jest": { - "version": "23.6.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-23.6.0.tgz", - "integrity": "sha512-lqKGG6LYXYu+DQh/slrQ8nxXQkEkhugdXsU6St7GmhVS7Ilc/22ArwqXNJrf0QaOBjZB0360qZMwXqDYQHXaew==", - "dev": true, - "requires": { - "babel-plugin-istanbul": "^4.1.6", - "babel-preset-jest": "^23.2.0" - } - }, - "babel-messages": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", - "dev": true, - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-istanbul": { - "version": "4.1.6", - "resolved": "http://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz", - "integrity": "sha512-PWP9FQ1AhZhS01T/4qLSKoHGY/xvkZdVBGlKM/HuxxS3+sC66HhTNR7+MpbO/so/cz/wY94MeSWJuP1hXIPfwQ==", - "dev": true, - "requires": { - "babel-plugin-syntax-object-rest-spread": "^6.13.0", - "find-up": "^2.1.0", - "istanbul-lib-instrument": "^1.10.1", - "test-exclude": "^4.2.1" - } - }, - "babel-plugin-jest-hoist": { - "version": "23.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.2.0.tgz", - "integrity": "sha1-5h+uBaHKiAGq3uV6bWa4zvr0QWc=", - "dev": true - }, - "babel-plugin-syntax-object-rest-spread": { - "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", - "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", - "dev": true - }, - "babel-preset-jest": { - "version": "23.2.0", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-23.2.0.tgz", - "integrity": "sha1-jsegOhOPABoaj7HoETZSvxpV2kY=", - "dev": true, - "requires": { - "babel-plugin-jest-hoist": "^23.2.0", - "babel-plugin-syntax-object-rest-spread": "^6.13.0" - } - }, - "babel-register": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", - "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", - "dev": true, - "requires": { - "babel-core": "^6.26.0", - "babel-runtime": "^6.26.0", - "core-js": "^2.5.0", - "home-or-tmp": "^2.0.0", - "lodash": "^4.17.4", - "mkdirp": "^0.5.1", - "source-map-support": "^0.4.15" - } - }, - "babel-runtime": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", - "dev": true, - "requires": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - } - }, - "babel-template": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", - "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "lodash": "^4.17.4" - } - }, - "babel-traverse": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", - "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", - "dev": true, - "requires": { - "babel-code-frame": "^6.26.0", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "debug": "^2.6.8", - "globals": "^9.18.0", - "invariant": "^2.2.2", - "lodash": "^4.17.4" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "globals": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", - "dev": true - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "babel-types": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", - "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", - "dev": true, - "requires": { - "babel-runtime": "^6.26.0", - "esutils": "^2.0.2", - "lodash": "^4.17.4", - "to-fast-properties": "^1.0.3" - } - }, - "babylon": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "bluebird": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz", - "integrity": "sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw==" - }, - "boxen": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", - "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", - "requires": { - "ansi-align": "^2.0.0", - "camelcase": "^4.0.0", - "chalk": "^2.0.1", - "cli-boxes": "^1.0.0", - "string-width": "^2.0.0", - "term-size": "^1.2.0", - "widest-line": "^2.0.0" - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "dev": true, - "requires": { - "expand-range": "^1.8.1", - "preserve": "^0.2.0", - "repeat-element": "^1.1.2" - } - }, - "browser-process-hrtime": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", - "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==", - "dev": true - }, - "browser-resolve": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.3.tgz", - "integrity": "sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==", - "dev": true, - "requires": { - "resolve": "1.1.7" - } - }, - "bser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/bser/-/bser-2.0.0.tgz", - "integrity": "sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk=", - "dev": true, - "requires": { - "node-int64": "^0.4.0" - } - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", - "dev": true - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } - } - }, - "caller-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", - "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", - "dev": true, - "requires": { - "callsites": "^0.2.0" - } - }, - "callsites": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", - "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", - "dev": true - }, - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" - }, - "capture-exit": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-1.2.0.tgz", - "integrity": "sha1-HF/MSJ/QqwDU8ax64QcuMXP7q28=", - "dev": true, - "requires": { - "rsvp": "^3.3.3" - } - }, - "capture-stack-trace": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz", - "integrity": "sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw==" - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" - }, - "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" - }, - "ci-info": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz", - "integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==" - }, - "circular-json": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", - "dev": true - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } - } - }, - "cli-boxes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", - "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=" - }, - "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", - "requires": { - "restore-cursor": "^2.0.0" - } - }, - "cli-spinners": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-1.3.1.tgz", - "integrity": "sha512-1QL4544moEsDVH9T/l6Cemov/37iv1RtoKf7NJ04A60+4MREXNfx/QvavbH6QoGdsD4N4Mwy49cmaINR/o2mdg==" - }, - "cli-width": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=" - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=" - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" - }, - "combined-stream": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "command-exists": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.8.tgz", - "integrity": "sha512-PM54PkseWbiiD/mMsbvW351/u+dafwTJ0ye2qB60G1aGQP9j3xK2gmMDc+R34L3nDtx4qMCitXT75mkbkGJDLw==" - }, - "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==" - }, - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "configstore": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-4.0.0.tgz", - "integrity": "sha512-CmquAXFBocrzaSM8mtGPMM/HiWmyIpr4CcJl/rgY2uCObZ/S7cKU0silxslqJejl+t/T9HS8E0PUNQD81JGUEQ==", - "requires": { - "dot-prop": "^4.1.0", - "graceful-fs": "^4.1.2", - "make-dir": "^1.0.0", - "unique-string": "^1.0.0", - "write-file-atomic": "^2.0.0", - "xdg-basedir": "^3.0.0" - } - }, - "convert-source-map": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", - "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, - "core-js": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.1.tgz", - "integrity": "sha512-L72mmmEayPJBejKIWe2pYtGis5r0tQ5NaJekdhyXgeMQTpJoBsH0NL4ElY2LfSoV15xeQWKQ+XTTOZdyero5Xg==", - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "create-error-class": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", - "integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=", - "requires": { - "capture-stack-trace": "^1.0.0" - } - }, - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "crypto-random-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", - "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=" - }, - "cssom": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.4.tgz", - "integrity": "sha512-+7prCSORpXNeR4/fUP3rL+TzqtiFfhMvTd7uEqMdgPvLPt4+uzFUeufx5RHjGTACCargg/DiEt/moMQmvnfkog==", - "dev": true - }, - "cssstyle": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.1.1.tgz", - "integrity": "sha512-364AI1l/M5TYcFH83JnOH/pSqgaNnKmYgKrm0didZMGKWjQB60dymwWy1rKUgL3J1ffdq9xVi2yGLHdSjjSNog==", - "dev": true, - "requires": { - "cssom": "0.3.x" - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "requires": { - "assert-plus": "^1.0.0" - } - }, - "data-urls": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz", - "integrity": "sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ==", - "dev": true, - "requires": { - "abab": "^2.0.0", - "whatwg-mimetype": "^2.2.0", - "whatwg-url": "^7.0.0" - }, - "dependencies": { - "whatwg-url": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.0.0.tgz", - "integrity": "sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==", - "dev": true, - "requires": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" - } - } - } - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true - }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" - }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true - }, - "default-require-extensions": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-1.0.0.tgz", - "integrity": "sha1-836hXT4T/9m0N9M+GnW1+5eHTLg=", - "dev": true, - "requires": { - "strip-bom": "^2.0.0" - } - }, - "defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", - "requires": { - "clone": "^1.0.2" - } - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, - "requires": { - "object-keys": "^1.0.12" - } - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, - "detect-indent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", - "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", - "dev": true, - "requires": { - "repeating": "^2.0.0" - } - }, - "detect-newline": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", - "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", - "dev": true - }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, - "doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "domexception": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", - "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", - "dev": true, - "requires": { - "webidl-conversions": "^4.0.2" - } - }, - "dot-prop": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", - "requires": { - "is-obj": "^1.0.0" - } - }, - "duplexer3": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es-abstract": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", - "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", - "dev": true, - "requires": { - "es-to-primitive": "^1.1.1", - "function-bind": "^1.1.1", - "has": "^1.0.1", - "is-callable": "^1.1.3", - "is-regex": "^1.0.4" - } - }, - "es-to-primitive": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", - "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", - "dev": true, - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" - }, - "escodegen": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.0.tgz", - "integrity": "sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw==", - "dev": true, - "requires": { - "esprima": "^3.1.3", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" - }, - "dependencies": { - "esprima": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "optional": true - } - } - }, - "eslint": { - "version": "5.11.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.11.1.tgz", - "integrity": "sha512-gOKhM8JwlFOc2acbOrkYR05NW8M6DCMSvfcJiBB5NDxRE1gv8kbvxKaC9u69e6ZGEMWXcswA/7eKR229cEIpvg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "ajv": "^6.5.3", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", - "debug": "^4.0.1", - "doctrine": "^2.1.0", - "eslint-scope": "^4.0.0", - "eslint-utils": "^1.3.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^5.0.0", - "esquery": "^1.0.1", - "esutils": "^2.0.2", - "file-entry-cache": "^2.0.0", - "functional-red-black-tree": "^1.0.1", - "glob": "^7.1.2", - "globals": "^11.7.0", - "ignore": "^4.0.6", - "imurmurhash": "^0.1.4", - "inquirer": "^6.1.0", - "js-yaml": "^3.12.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.5", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", - "natural-compare": "^1.4.0", - "optionator": "^0.8.2", - "path-is-inside": "^1.0.2", - "pluralize": "^7.0.0", - "progress": "^2.0.0", - "regexpp": "^2.0.1", - "require-uncached": "^1.0.3", - "semver": "^5.5.1", - "strip-ansi": "^4.0.0", - "strip-json-comments": "^2.0.1", - "table": "^5.0.2", - "text-table": "^0.2.0" - }, - "dependencies": { - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "eslint-plugin-jest": { - "version": "21.27.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-21.27.2.tgz", - "integrity": "sha512-0E4OIgBJVlAmf1KfYFtZ3gYxgUzC5Eb3Jzmrc9ikI1OY+/cM8Kh72Ti7KfpeHNeD3HJNf9SmEfmvQLIz44Hrhw==", - "dev": true - }, - "eslint-scope": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", - "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", - "dev": true, - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - }, - "eslint-utils": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", - "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", - "dev": true - }, - "eslint-visitor-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", - "dev": true - }, - "espree": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.0.tgz", - "integrity": "sha512-1MpUfwsdS9MMoN7ZXqAr9e9UKdVHDcvrJpyx7mm1WuQlx/ygErEQBzgi5Nh5qBHIoYweprhtMkTCb9GhcAIcsA==", - "dev": true, - "requires": { - "acorn": "^6.0.2", - "acorn-jsx": "^5.0.0", - "eslint-visitor-keys": "^1.0.0" - } - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "esquery": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", - "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", - "dev": true, - "requires": { - "estraverse": "^4.0.0" - } - }, - "esrecurse": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", - "dev": true, - "requires": { - "estraverse": "^4.1.0" - } - }, - "estraverse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", - "dev": true - }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true - }, - "exec-sh": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.2.2.tgz", - "integrity": "sha512-FIUCJz1RbuS0FKTdaAafAByGS0CPvU3R0MeHxgtl+djzCc//F8HakL8GzmVNZanasTbTAY/3DRFA0KpVqj/eAw==", - "dev": true, - "requires": { - "merge": "^1.2.0" - } - }, - "execa": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", - "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - } - }, - "exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", - "dev": true - }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "dev": true, - "requires": { - "is-posix-bracket": "^0.1.0" - } - }, - "expand-range": { - "version": "1.8.2", - "resolved": "http://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", - "dev": true, - "requires": { - "fill-range": "^2.1.0" - } - }, - "expect": { - "version": "23.6.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-23.6.0.tgz", - "integrity": "sha512-dgSoOHgmtn/aDGRVFWclQyPDKl2CQRq0hmIEoUAuQs/2rn2NcvCWcSCovm6BLeuB/7EZuLGu2QfnR+qRt5OM4w==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "jest-diff": "^23.6.0", - "jest-get-type": "^22.1.0", - "jest-matcher-utils": "^23.6.0", - "jest-message-util": "^23.4.0", - "jest-regex-util": "^23.3.0" - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "external-editor": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", - "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", - "requires": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - } - }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "fb-watchman": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.0.tgz", - "integrity": "sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg=", - "dev": true, - "requires": { - "bser": "^2.0.0" - } - }, - "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, - "file-entry-cache": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", - "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", - "dev": true, - "requires": { - "flat-cache": "^1.2.1", - "object-assign": "^4.0.1" - } - }, - "filename-regex": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", - "dev": true - }, - "fileset": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/fileset/-/fileset-2.0.3.tgz", - "integrity": "sha1-jnVIqW08wjJ+5eZ0FocjozO7oqA=", - "dev": true, - "requires": { - "glob": "^7.0.3", - "minimatch": "^3.0.3" - } - }, - "fill-range": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", - "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", - "dev": true, - "requires": { - "is-number": "^2.1.0", - "isobject": "^2.0.0", - "randomatic": "^3.0.0", - "repeat-element": "^1.1.2", - "repeat-string": "^1.5.2" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "^2.0.0" - } - }, - "flat-cache": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", - "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", - "dev": true, - "requires": { - "circular-json": "^0.3.1", - "graceful-fs": "^4.1.2", - "rimraf": "~2.6.2", - "write": "^0.2.1" - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "dev": true, - "requires": { - "for-in": "^1.0.1" - } - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fsevents": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", - "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", - "dev": true, - "optional": true, - "requires": { - "nan": "^2.9.2", - "node-pre-gyp": "^0.10.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "2.6.9", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.21", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": "^2.1.0" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "minipass": { - "version": "2.2.4", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "^5.1.1", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.2.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "^2.1.2", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.10.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.0", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.1.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.1.10", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.7", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.5.1", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "^7.0.5" - } - }, - "safe-buffer": { - "version": "5.1.1", - "bundled": true, - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.5.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.0.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.2.4", - "minizlib": "^1.1.0", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.1", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "3.0.2", - "bundled": true, - "dev": true - } - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true - }, - "get-stream": { - "version": "3.0.0", - "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "requires": { - "assert-plus": "^1.0.0" - } - }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "dev": true, - "requires": { - "glob-parent": "^2.0.0", - "is-glob": "^2.0.0" - } - }, - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "^2.0.0" - } - }, - "global-dirs": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", - "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", - "requires": { - "ini": "^1.3.4" - } - }, - "globals": { - "version": "11.9.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.9.0.tgz", - "integrity": "sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg==", - "dev": true - }, - "got": { - "version": "6.7.1", - "resolved": "http://registry.npmjs.org/got/-/got-6.7.1.tgz", - "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", - "requires": { - "create-error-class": "^3.0.0", - "duplexer3": "^0.1.4", - "get-stream": "^3.0.0", - "is-redirect": "^1.0.0", - "is-retry-allowed": "^1.0.0", - "is-stream": "^1.0.0", - "lowercase-keys": "^1.0.0", - "safe-buffer": "^5.0.1", - "timed-out": "^4.0.0", - "unzip-response": "^2.0.1", - "url-parse-lax": "^1.0.0" - } - }, - "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==" - }, - "growly": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", - "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", - "dev": true - }, - "handlebars": { - "version": "4.0.12", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.12.tgz", - "integrity": "sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA==", - "dev": true, - "requires": { - "async": "^2.5.0", - "optimist": "^0.6.1", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - } - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - } - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" - }, - "has-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", - "dev": true - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "home-or-tmp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", - "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", - "dev": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.1" - } - }, - "hosted-git-info": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", - "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", - "dev": true - }, - "html-encoding-sniffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", - "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", - "dev": true, - "requires": { - "whatwg-encoding": "^1.0.1" - } - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - }, - "import-lazy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", - "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=" - }, - "import-local": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-1.0.0.tgz", - "integrity": "sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ==", - "dev": true, - "requires": { - "pkg-dir": "^2.0.0", - "resolve-cwd": "^2.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" - }, - "inquirer": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.1.tgz", - "integrity": "sha512-088kl3DRT2dLU5riVMKKr1DlImd6X7smDhpXUCkJDCKvTEJeRiXh0G132HG9u5a+6Ylw9plFRY7RuTnwohYSpg==", - "requires": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.0", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.0", - "figures": "^2.0.0", - "lodash": "^4.17.10", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.1.0", - "string-width": "^2.1.0", - "strip-ansi": "^5.0.0", - "through": "^2.3.6" - } - }, - "invariant": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", - "dev": true, - "requires": { - "loose-envify": "^1.0.0" - } - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", - "dev": true - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "http://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-builtin-module": { - "version": "1.0.0", - "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", - "dev": true, - "requires": { - "builtin-modules": "^1.0.0" - } - }, - "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", - "dev": true - }, - "is-ci": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", - "integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==", - "requires": { - "ci-info": "^1.5.0" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "http://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", - "dev": true - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", - "dev": true - }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", - "dev": true, - "requires": { - "is-primitive": "^2.0.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" - }, - "is-generator-fn": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-1.0.0.tgz", - "integrity": "sha1-lp1J4bszKfa7fwkIm+JleLLd1Go=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "^1.0.0" - } - }, - "is-installed-globally": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", - "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=", - "requires": { - "global-dirs": "^0.1.0", - "is-path-inside": "^1.0.0" - } - }, - "is-npm": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", - "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=" - }, - "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "is-obj": { - "version": "1.0.1", - "resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" - }, - "is-path-inside": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", - "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", - "requires": { - "path-is-inside": "^1.0.1" - } - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } - } - }, - "is-posix-bracket": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", - "dev": true - }, - "is-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "dev": true - }, - "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" - }, - "is-redirect": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", - "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=" - }, - "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", - "dev": true, - "requires": { - "has": "^1.0.1" - } - }, - "is-retry-allowed": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", - "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=" - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" - }, - "is-symbol": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", - "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", - "dev": true, - "requires": { - "has-symbols": "^1.0.0" - } - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" - }, - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, - "istanbul-api": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-1.3.7.tgz", - "integrity": "sha512-4/ApBnMVeEPG3EkSzcw25wDe4N66wxwn+KKn6b47vyek8Xb3NBAcg4xfuQbS7BqcZuTX4wxfD5lVagdggR3gyA==", - "dev": true, - "requires": { - "async": "^2.1.4", - "fileset": "^2.0.2", - "istanbul-lib-coverage": "^1.2.1", - "istanbul-lib-hook": "^1.2.2", - "istanbul-lib-instrument": "^1.10.2", - "istanbul-lib-report": "^1.1.5", - "istanbul-lib-source-maps": "^1.2.6", - "istanbul-reports": "^1.5.1", - "js-yaml": "^3.7.0", - "mkdirp": "^0.5.1", - "once": "^1.4.0" - } - }, - "istanbul-lib-coverage": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz", - "integrity": "sha512-PzITeunAgyGbtY1ibVIUiV679EFChHjoMNRibEIobvmrCRaIgwLxNucOSimtNWUhEib/oO7QY2imD75JVgCJWQ==", - "dev": true - }, - "istanbul-lib-hook": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.2.2.tgz", - "integrity": "sha512-/Jmq7Y1VeHnZEQ3TL10VHyb564mn6VrQXHchON9Jf/AEcmQ3ZIiyD1BVzNOKTZf/G3gE+kiGK6SmpF9y3qGPLw==", - "dev": true, - "requires": { - "append-transform": "^0.4.0" - } - }, - "istanbul-lib-instrument": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.2.tgz", - "integrity": "sha512-aWHxfxDqvh/ZlxR8BBaEPVSWDPUkGD63VjGQn3jcw8jCp7sHEMKcrj4xfJn/ABzdMEHiQNyvDQhqm5o8+SQg7A==", - "dev": true, - "requires": { - "babel-generator": "^6.18.0", - "babel-template": "^6.16.0", - "babel-traverse": "^6.18.0", - "babel-types": "^6.18.0", - "babylon": "^6.18.0", - "istanbul-lib-coverage": "^1.2.1", - "semver": "^5.3.0" - } - }, - "istanbul-lib-report": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-1.1.5.tgz", - "integrity": "sha512-UsYfRMoi6QO/doUshYNqcKJqVmFe9w51GZz8BS3WB0lYxAllQYklka2wP9+dGZeHYaWIdcXUx8JGdbqaoXRXzw==", - "dev": true, - "requires": { - "istanbul-lib-coverage": "^1.2.1", - "mkdirp": "^0.5.1", - "path-parse": "^1.0.5", - "supports-color": "^3.1.2" - }, - "dependencies": { - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, - "istanbul-lib-source-maps": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.6.tgz", - "integrity": "sha512-TtbsY5GIHgbMsMiRw35YBHGpZ1DVFEO19vxxeiDMYaeOFOCzfnYVxvl6pOUIZR4dtPhAGpSMup8OyF8ubsaqEg==", - "dev": true, - "requires": { - "debug": "^3.1.0", - "istanbul-lib-coverage": "^1.2.1", - "mkdirp": "^0.5.1", - "rimraf": "^2.6.1", - "source-map": "^0.5.3" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - } - } - }, - "istanbul-reports": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-1.5.1.tgz", - "integrity": "sha512-+cfoZ0UXzWjhAdzosCPP3AN8vvef8XDkWtTfgaN+7L3YTpNYITnCaEkceo5SEYy644VkHka/P1FvkWvrG/rrJw==", - "dev": true, - "requires": { - "handlebars": "^4.0.3" - } - }, - "jest": { - "version": "23.6.0", - "resolved": "https://registry.npmjs.org/jest/-/jest-23.6.0.tgz", - "integrity": "sha512-lWzcd+HSiqeuxyhG+EnZds6iO3Y3ZEnMrfZq/OTGvF/C+Z4fPMCdhWTGSAiO2Oym9rbEXfwddHhh6jqrTF3+Lw==", - "dev": true, - "requires": { - "import-local": "^1.0.0", - "jest-cli": "^23.6.0" - }, - "dependencies": { - "jest-cli": { - "version": "23.6.0", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-23.6.0.tgz", - "integrity": "sha512-hgeD1zRUp1E1zsiyOXjEn4LzRLWdJBV//ukAHGlx6s5mfCNJTbhbHjgxnDUXA8fsKWN/HqFFF6X5XcCwC/IvYQ==", - "dev": true, - "requires": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.1", - "exit": "^0.1.2", - "glob": "^7.1.2", - "graceful-fs": "^4.1.11", - "import-local": "^1.0.0", - "is-ci": "^1.0.10", - "istanbul-api": "^1.3.1", - "istanbul-lib-coverage": "^1.2.0", - "istanbul-lib-instrument": "^1.10.1", - "istanbul-lib-source-maps": "^1.2.4", - "jest-changed-files": "^23.4.2", - "jest-config": "^23.6.0", - "jest-environment-jsdom": "^23.4.0", - "jest-get-type": "^22.1.0", - "jest-haste-map": "^23.6.0", - "jest-message-util": "^23.4.0", - "jest-regex-util": "^23.3.0", - "jest-resolve-dependencies": "^23.6.0", - "jest-runner": "^23.6.0", - "jest-runtime": "^23.6.0", - "jest-snapshot": "^23.6.0", - "jest-util": "^23.4.0", - "jest-validate": "^23.6.0", - "jest-watcher": "^23.4.0", - "jest-worker": "^23.2.0", - "micromatch": "^2.3.11", - "node-notifier": "^5.2.1", - "prompts": "^0.1.9", - "realpath-native": "^1.0.0", - "rimraf": "^2.5.4", - "slash": "^1.0.0", - "string-length": "^2.0.0", - "strip-ansi": "^4.0.0", - "which": "^1.2.12", - "yargs": "^11.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "jest-changed-files": { - "version": "23.4.2", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-23.4.2.tgz", - "integrity": "sha512-EyNhTAUWEfwnK0Is/09LxoqNDOn7mU7S3EHskG52djOFS/z+IT0jT3h3Ql61+dklcG7bJJitIWEMB4Sp1piHmA==", - "dev": true, - "requires": { - "throat": "^4.0.0" - } - }, - "jest-config": { - "version": "23.6.0", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-23.6.0.tgz", - "integrity": "sha512-i8V7z9BeDXab1+VNo78WM0AtWpBRXJLnkT+lyT+Slx/cbP5sZJ0+NDuLcmBE5hXAoK0aUp7vI+MOxR+R4d8SRQ==", - "dev": true, - "requires": { - "babel-core": "^6.0.0", - "babel-jest": "^23.6.0", - "chalk": "^2.0.1", - "glob": "^7.1.1", - "jest-environment-jsdom": "^23.4.0", - "jest-environment-node": "^23.4.0", - "jest-get-type": "^22.1.0", - "jest-jasmine2": "^23.6.0", - "jest-regex-util": "^23.3.0", - "jest-resolve": "^23.6.0", - "jest-util": "^23.4.0", - "jest-validate": "^23.6.0", - "micromatch": "^2.3.11", - "pretty-format": "^23.6.0" - } - }, - "jest-diff": { - "version": "23.6.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-23.6.0.tgz", - "integrity": "sha512-Gz9l5Ov+X3aL5L37IT+8hoCUsof1CVYBb2QEkOupK64XyRR3h+uRpYIm97K7sY8diFxowR8pIGEdyfMKTixo3g==", - "dev": true, - "requires": { - "chalk": "^2.0.1", - "diff": "^3.2.0", - "jest-get-type": "^22.1.0", - "pretty-format": "^23.6.0" - } - }, - "jest-docblock": { - "version": "23.2.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-23.2.0.tgz", - "integrity": "sha1-8IXh8YVI2Z/dabICB+b9VdkTg6c=", - "dev": true, - "requires": { - "detect-newline": "^2.1.0" - } - }, - "jest-each": { - "version": "23.6.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-23.6.0.tgz", - "integrity": "sha512-x7V6M/WGJo6/kLoissORuvLIeAoyo2YqLOoCDkohgJ4XOXSqOtyvr8FbInlAWS77ojBsZrafbozWoKVRdtxFCg==", - "dev": true, - "requires": { - "chalk": "^2.0.1", - "pretty-format": "^23.6.0" - } - }, - "jest-environment-jsdom": { - "version": "23.4.0", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-23.4.0.tgz", - "integrity": "sha1-BWp5UrP+pROsYqFAosNox52eYCM=", - "dev": true, - "requires": { - "jest-mock": "^23.2.0", - "jest-util": "^23.4.0", - "jsdom": "^11.5.1" - } - }, - "jest-environment-node": { - "version": "23.4.0", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-23.4.0.tgz", - "integrity": "sha1-V+gO0IQd6jAxZ8zozXlSHeuv3hA=", - "dev": true, - "requires": { - "jest-mock": "^23.2.0", - "jest-util": "^23.4.0" - } - }, - "jest-get-type": { - "version": "22.4.3", - "resolved": "http://registry.npmjs.org/jest-get-type/-/jest-get-type-22.4.3.tgz", - "integrity": "sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w==", - "dev": true - }, - "jest-haste-map": { - "version": "23.6.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-23.6.0.tgz", - "integrity": "sha512-uyNhMyl6dr6HaXGHp8VF7cK6KpC6G9z9LiMNsst+rJIZ8l7wY0tk8qwjPmEghczojZ2/ZhtEdIabZ0OQRJSGGg==", - "dev": true, - "requires": { - "fb-watchman": "^2.0.0", - "graceful-fs": "^4.1.11", - "invariant": "^2.2.4", - "jest-docblock": "^23.2.0", - "jest-serializer": "^23.0.1", - "jest-worker": "^23.2.0", - "micromatch": "^2.3.11", - "sane": "^2.0.0" - } - }, - "jest-jasmine2": { - "version": "23.6.0", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-23.6.0.tgz", - "integrity": "sha512-pe2Ytgs1nyCs8IvsEJRiRTPC0eVYd8L/dXJGU08GFuBwZ4sYH/lmFDdOL3ZmvJR8QKqV9MFuwlsAi/EWkFUbsQ==", - "dev": true, - "requires": { - "babel-traverse": "^6.0.0", - "chalk": "^2.0.1", - "co": "^4.6.0", - "expect": "^23.6.0", - "is-generator-fn": "^1.0.0", - "jest-diff": "^23.6.0", - "jest-each": "^23.6.0", - "jest-matcher-utils": "^23.6.0", - "jest-message-util": "^23.4.0", - "jest-snapshot": "^23.6.0", - "jest-util": "^23.4.0", - "pretty-format": "^23.6.0" - } - }, - "jest-leak-detector": { - "version": "23.6.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-23.6.0.tgz", - "integrity": "sha512-f/8zA04rsl1Nzj10HIyEsXvYlMpMPcy0QkQilVZDFOaPbv2ur71X5u2+C4ZQJGyV/xvVXtCCZ3wQ99IgQxftCg==", - "dev": true, - "requires": { - "pretty-format": "^23.6.0" - } - }, - "jest-matcher-utils": { - "version": "23.6.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-23.6.0.tgz", - "integrity": "sha512-rosyCHQfBcol4NsckTn01cdelzWLU9Cq7aaigDf8VwwpIRvWE/9zLgX2bON+FkEW69/0UuYslUe22SOdEf2nog==", - "dev": true, - "requires": { - "chalk": "^2.0.1", - "jest-get-type": "^22.1.0", - "pretty-format": "^23.6.0" - } - }, - "jest-message-util": { - "version": "23.4.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-23.4.0.tgz", - "integrity": "sha1-F2EMUJQjSVCNAaPR4L2iwHkIap8=", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0-beta.35", - "chalk": "^2.0.1", - "micromatch": "^2.3.11", - "slash": "^1.0.0", - "stack-utils": "^1.0.1" - } - }, - "jest-mock": { - "version": "23.2.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-23.2.0.tgz", - "integrity": "sha1-rRxg8p6HGdR8JuETgJi20YsmETQ=", - "dev": true - }, - "jest-regex-util": { - "version": "23.3.0", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-23.3.0.tgz", - "integrity": "sha1-X4ZylUfCeFxAAs6qj4Sf6MpHG8U=", - "dev": true - }, - "jest-resolve": { - "version": "23.6.0", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-23.6.0.tgz", - "integrity": "sha512-XyoRxNtO7YGpQDmtQCmZjum1MljDqUCob7XlZ6jy9gsMugHdN2hY4+Acz9Qvjz2mSsOnPSH7skBmDYCHXVZqkA==", - "dev": true, - "requires": { - "browser-resolve": "^1.11.3", - "chalk": "^2.0.1", - "realpath-native": "^1.0.0" - } - }, - "jest-resolve-dependencies": { - "version": "23.6.0", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-23.6.0.tgz", - "integrity": "sha512-EkQWkFWjGKwRtRyIwRwI6rtPAEyPWlUC2MpzHissYnzJeHcyCn1Hc8j7Nn1xUVrS5C6W5+ZL37XTem4D4pLZdA==", - "dev": true, - "requires": { - "jest-regex-util": "^23.3.0", - "jest-snapshot": "^23.6.0" - } - }, - "jest-runner": { - "version": "23.6.0", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-23.6.0.tgz", - "integrity": "sha512-kw0+uj710dzSJKU6ygri851CObtCD9cN8aNkg8jWJf4ewFyEa6kwmiH/r/M1Ec5IL/6VFa0wnAk6w+gzUtjJzA==", - "dev": true, - "requires": { - "exit": "^0.1.2", - "graceful-fs": "^4.1.11", - "jest-config": "^23.6.0", - "jest-docblock": "^23.2.0", - "jest-haste-map": "^23.6.0", - "jest-jasmine2": "^23.6.0", - "jest-leak-detector": "^23.6.0", - "jest-message-util": "^23.4.0", - "jest-runtime": "^23.6.0", - "jest-util": "^23.4.0", - "jest-worker": "^23.2.0", - "source-map-support": "^0.5.6", - "throat": "^4.0.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "source-map-support": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz", - "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - } - } - }, - "jest-runtime": { - "version": "23.6.0", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-23.6.0.tgz", - "integrity": "sha512-ycnLTNPT2Gv+TRhnAYAQ0B3SryEXhhRj1kA6hBPSeZaNQkJ7GbZsxOLUkwg6YmvWGdX3BB3PYKFLDQCAE1zNOw==", - "dev": true, - "requires": { - "babel-core": "^6.0.0", - "babel-plugin-istanbul": "^4.1.6", - "chalk": "^2.0.1", - "convert-source-map": "^1.4.0", - "exit": "^0.1.2", - "fast-json-stable-stringify": "^2.0.0", - "graceful-fs": "^4.1.11", - "jest-config": "^23.6.0", - "jest-haste-map": "^23.6.0", - "jest-message-util": "^23.4.0", - "jest-regex-util": "^23.3.0", - "jest-resolve": "^23.6.0", - "jest-snapshot": "^23.6.0", - "jest-util": "^23.4.0", - "jest-validate": "^23.6.0", - "micromatch": "^2.3.11", - "realpath-native": "^1.0.0", - "slash": "^1.0.0", - "strip-bom": "3.0.0", - "write-file-atomic": "^2.1.0", - "yargs": "^11.0.0" - }, - "dependencies": { - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - } - } - }, - "jest-serializer": { - "version": "23.0.1", - "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-23.0.1.tgz", - "integrity": "sha1-o3dq6zEekP6D+rnlM+hRAr0WQWU=", - "dev": true - }, - "jest-snapshot": { - "version": "23.6.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-23.6.0.tgz", - "integrity": "sha512-tM7/Bprftun6Cvj2Awh/ikS7zV3pVwjRYU2qNYS51VZHgaAMBs5l4o/69AiDHhQrj5+LA2Lq4VIvK7zYk/bswg==", - "dev": true, - "requires": { - "babel-types": "^6.0.0", - "chalk": "^2.0.1", - "jest-diff": "^23.6.0", - "jest-matcher-utils": "^23.6.0", - "jest-message-util": "^23.4.0", - "jest-resolve": "^23.6.0", - "mkdirp": "^0.5.1", - "natural-compare": "^1.4.0", - "pretty-format": "^23.6.0", - "semver": "^5.5.0" - } - }, - "jest-util": { - "version": "23.4.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-23.4.0.tgz", - "integrity": "sha1-TQY8uSe68KI4Mf9hvsLLv0l5NWE=", - "dev": true, - "requires": { - "callsites": "^2.0.0", - "chalk": "^2.0.1", - "graceful-fs": "^4.1.11", - "is-ci": "^1.0.10", - "jest-message-util": "^23.4.0", - "mkdirp": "^0.5.1", - "slash": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "callsites": { - "version": "2.0.0", - "resolved": "http://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", - "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "jest-validate": { - "version": "23.6.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-23.6.0.tgz", - "integrity": "sha512-OFKapYxe72yz7agrDAWi8v2WL8GIfVqcbKRCLbRG9PAxtzF9b1SEDdTpytNDN12z2fJynoBwpMpvj2R39plI2A==", - "dev": true, - "requires": { - "chalk": "^2.0.1", - "jest-get-type": "^22.1.0", - "leven": "^2.1.0", - "pretty-format": "^23.6.0" - } - }, - "jest-watcher": { - "version": "23.4.0", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-23.4.0.tgz", - "integrity": "sha1-0uKM50+NrWxq/JIrksq+9u0FyRw=", - "dev": true, - "requires": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.1", - "string-length": "^2.0.0" - } - }, - "jest-worker": { - "version": "23.2.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-23.2.0.tgz", - "integrity": "sha1-+vcGqNo2+uYOsmlXJX+ntdjqArk=", - "dev": true, - "requires": { - "merge-stream": "^1.0.1" - } - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "js-yaml": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", - "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" - }, - "jsdom": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz", - "integrity": "sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==", - "dev": true, - "requires": { - "abab": "^2.0.0", - "acorn": "^5.5.3", - "acorn-globals": "^4.1.0", - "array-equal": "^1.0.0", - "cssom": ">= 0.3.2 < 0.4.0", - "cssstyle": "^1.0.0", - "data-urls": "^1.0.0", - "domexception": "^1.0.1", - "escodegen": "^1.9.1", - "html-encoding-sniffer": "^1.0.2", - "left-pad": "^1.3.0", - "nwsapi": "^2.0.7", - "parse5": "4.0.0", - "pn": "^1.1.0", - "request": "^2.87.0", - "request-promise-native": "^1.0.5", - "sax": "^1.2.4", - "symbol-tree": "^3.2.2", - "tough-cookie": "^2.3.4", - "w3c-hr-time": "^1.0.1", - "webidl-conversions": "^4.0.2", - "whatwg-encoding": "^1.0.3", - "whatwg-mimetype": "^2.1.0", - "whatwg-url": "^6.4.1", - "ws": "^5.2.0", - "xml-name-validator": "^3.0.0" - }, - "dependencies": { - "acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", - "dev": true - } - } - }, - "jsesc": { - "version": "1.3.0", - "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", - "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", - "dev": true - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" - }, - "json5": { - "version": "0.5.1", - "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", - "dev": true - }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "requires": { - "graceful-fs": "^4.1.6" - } - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - }, - "kleur": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-2.0.2.tgz", - "integrity": "sha512-77XF9iTllATmG9lSlIv0qdQ2BQ/h9t0bJllHlbvsQ0zUWfU7Yi0S8L5JXzPZgkefIiajLmBJJ4BsMJmqcf7oxQ==", - "dev": true - }, - "latest-version": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-3.1.0.tgz", - "integrity": "sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU=", - "requires": { - "package-json": "^4.0.0" - } - }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "dev": true, - "requires": { - "invert-kv": "^1.0.0" - } - }, - "left-pad": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", - "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==", - "dev": true - }, - "leven": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", - "integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=", - "dev": true - }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - } - }, - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" - }, - "lodash.sortby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", - "dev": true - }, - "log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", - "requires": { - "chalk": "^2.0.1" - } - }, - "loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, - "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" - } - }, - "lowercase-keys": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==" - }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "requires": { - "pify": "^3.0.0" - } - }, - "makeerror": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz", - "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=", - "dev": true, - "requires": { - "tmpl": "1.0.x" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, - "math-random": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", - "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", - "dev": true - }, - "mem": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", - "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "merge": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.1.tgz", - "integrity": "sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ==", - "dev": true - }, - "merge-stream": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", - "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", - "dev": true, - "requires": { - "readable-stream": "^2.0.1" - } - }, - "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true, - "requires": { - "arr-diff": "^2.0.0", - "array-unique": "^0.2.1", - "braces": "^1.8.2", - "expand-brackets": "^0.1.4", - "extglob": "^0.3.1", - "filename-regex": "^2.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.1", - "kind-of": "^3.0.2", - "normalize-path": "^2.0.1", - "object.omit": "^2.0.0", - "parse-glob": "^3.0.4", - "regex-cache": "^0.4.2" - } - }, - "mime-db": { - "version": "1.37.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", - "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==" - }, - "mime-types": { - "version": "2.1.21", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", - "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", - "requires": { - "mime-db": "~1.37.0" - } - }, - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" - }, - "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", - "dev": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - } - } - }, - "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true - }, - "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=" - }, - "nan": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", - "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==", - "dev": true, - "optional": true - }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, - "node-int64": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", - "dev": true - }, - "node-notifier": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.3.0.tgz", - "integrity": "sha512-AhENzCSGZnZJgBARsUjnQ7DnZbzyP+HxlVXuD0xqAnvL8q+OqtSX7lGg9e8nHzwXkMMXNdVeqq4E2M3EUAqX6Q==", - "dev": true, - "requires": { - "growly": "^1.3.0", - "semver": "^5.5.0", - "shellwords": "^0.1.1", - "which": "^1.3.0" - } - }, - "normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "requires": { - "path-key": "^2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true - }, - "nwsapi": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.0.9.tgz", - "integrity": "sha512-nlWFSCTYQcHk/6A9FFnfhKc14c3aFhfdNBXgo8Qgi9QTBu/qg3Ww+Uiz9wMzXd1T8GFxPc2QIHB6Qtf2XFryFQ==", - "dev": true - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "object-keys": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", - "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", - "dev": true - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "requires": { - "isobject": "^3.0.0" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } - } - }, - "object.getownpropertydescriptors": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", - "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.5.1" - } - }, - "object.omit": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", - "dev": true, - "requires": { - "for-own": "^0.1.4", - "is-extendable": "^0.1.1" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "requires": { - "isobject": "^3.0.1" - }, - "dependencies": { - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "requires": { - "mimic-fn": "^1.0.0" - } - }, - "optimist": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", - "dev": true, - "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" - }, - "dependencies": { - "minimist": { - "version": "0.0.10", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", - "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", - "dev": true - }, - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true - } - } - }, - "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", - "dev": true, - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "wordwrap": "~1.0.0" - } - }, - "ora": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ora/-/ora-3.0.0.tgz", - "integrity": "sha512-LBS97LFe2RV6GJmXBi6OKcETKyklHNMV0xw7BtsVn2MlsgsydyZetSCbCANr+PFLmDyv4KV88nn0eCKza665Mg==", - "requires": { - "chalk": "^2.3.1", - "cli-cursor": "^2.1.0", - "cli-spinners": "^1.1.0", - "log-symbols": "^2.2.0", - "strip-ansi": "^4.0.0", - "wcwidth": "^1.0.1" - }, - "dependencies": { - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true - }, - "os-locale": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", - "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", - "dev": true, - "requires": { - "execa": "^0.7.0", - "lcid": "^1.0.0", - "mem": "^1.1.0" - } - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "^1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "^1.1.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "package-json": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz", - "integrity": "sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0=", - "requires": { - "got": "^6.7.1", - "registry-auth-token": "^3.0.1", - "registry-url": "^3.0.3", - "semver": "^5.1.0" - } - }, - "parse-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", - "dev": true, - "requires": { - "glob-base": "^0.3.0", - "is-dotfile": "^1.0.0", - "is-extglob": "^1.0.0", - "is-glob": "^2.0.0" - } - }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "requires": { - "error-ex": "^1.2.0" - } - }, - "parse5": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", - "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", - "dev": true - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=" - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } - } - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - }, - "pkg-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", - "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", - "dev": true, - "requires": { - "find-up": "^2.1.0" - } - }, - "pluralize": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", - "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", - "dev": true - }, - "pn": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", - "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", - "dev": true - }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true - }, - "prepend-http": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" - }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "dev": true - }, - "prettier": { - "version": "1.15.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.15.3.tgz", - "integrity": "sha512-gAU9AGAPMaKb3NNSUUuhhFAS7SCO4ALTN4nRIn6PJ075Qd28Yn2Ig2ahEJWdJwJmlEBTUfC7mMUSFy8MwsOCfg==", - "dev": true - }, - "pretty-format": { - "version": "23.6.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-23.6.0.tgz", - "integrity": "sha512-zf9NV1NSlDLDjycnwm6hpFATCGl/K1lt0R/GdkAK2O5LN/rwJoB+Mh93gGJjut4YbmecbfgLWVGSTCr0Ewvvbw==", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0", - "ansi-styles": "^3.2.0" - } - }, - "private": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "dev": true - }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" - }, - "prompts": { - "version": "0.1.14", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-0.1.14.tgz", - "integrity": "sha512-rxkyiE9YH6zAz/rZpywySLKkpaj0NMVyNw1qhsubdbjjSgcayjTShDreZGlFMcGSu5sab3bAKPfFk78PB90+8w==", - "dev": true, - "requires": { - "kleur": "^2.0.1", - "sisteransi": "^0.1.1" - } - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, - "psl": { - "version": "1.1.31", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", - "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==" - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" - }, - "randomatic": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", - "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", - "dev": true, - "requires": { - "is-number": "^4.0.0", - "kind-of": "^6.0.0", - "math-random": "^1.0.1" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } - }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - } - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "dev": true, - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "dev": true, - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - }, - "dependencies": { - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "dev": true, - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "requires": { - "pinkie-promise": "^2.0.0" - } - } - } - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "realpath-native": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/realpath-native/-/realpath-native-1.0.2.tgz", - "integrity": "sha512-+S3zTvVt9yTntFrBpm7TQmQ3tzpCrnA1a/y+3cUHAc9ZR6aIjG0WNLR+Rj79QpJktY+VeW/TQtFlQ1bzsehI8g==", - "dev": true, - "requires": { - "util.promisify": "^1.0.0" - } - }, - "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", - "dev": true - }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", - "dev": true, - "requires": { - "is-equal-shallow": "^0.1.3" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", - "dev": true - }, - "registry-auth-token": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.2.tgz", - "integrity": "sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==", - "requires": { - "rc": "^1.1.6", - "safe-buffer": "^5.0.1" - } - }, - "registry-url": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", - "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", - "requires": { - "rc": "^1.0.1" - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "dev": true, - "requires": { - "is-finite": "^1.0.0" - } - }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, - "request-promise": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/request-promise/-/request-promise-4.2.2.tgz", - "integrity": "sha1-0epG1lSm7k+O5qT+oQGMIpEZBLQ=", - "requires": { - "bluebird": "^3.5.0", - "request-promise-core": "1.1.1", - "stealthy-require": "^1.1.0", - "tough-cookie": ">=2.3.3" - } - }, - "request-promise-core": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", - "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", - "requires": { - "lodash": "^4.13.1" - } - }, - "request-promise-native": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.5.tgz", - "integrity": "sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU=", - "dev": true, - "requires": { - "request-promise-core": "1.1.1", - "stealthy-require": "^1.1.0", - "tough-cookie": ">=2.3.3" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true - }, - "require-uncached": { - "version": "1.0.3", - "resolved": "http://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", - "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", - "dev": true, - "requires": { - "caller-path": "^0.1.0", - "resolve-from": "^1.0.0" - } - }, - "resolve": { - "version": "1.1.7", - "resolved": "http://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", - "dev": true - }, - "resolve-cwd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", - "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", - "dev": true, - "requires": { - "resolve-from": "^3.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - } - } - }, - "resolve-from": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", - "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", - "dev": true - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", - "requires": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - } - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true - }, - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "dev": true, - "requires": { - "glob": "^7.0.5" - } - }, - "rsvp": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-3.6.2.tgz", - "integrity": "sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw==", - "dev": true - }, - "run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", - "requires": { - "is-promise": "^2.1.0" - } - }, - "rxjs": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz", - "integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==", - "requires": { - "tslib": "^1.9.0" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "requires": { - "ret": "~0.1.10" - } - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "sane": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/sane/-/sane-2.5.2.tgz", - "integrity": "sha1-tNwYYcIbQn6SlQej51HiosuKs/o=", - "dev": true, - "requires": { - "anymatch": "^2.0.0", - "capture-exit": "^1.2.0", - "exec-sh": "^0.2.0", - "fb-watchman": "^2.0.0", - "fsevents": "^1.2.3", - "micromatch": "^3.1.4", - "minimist": "^1.1.1", - "walker": "~1.0.5", - "watch": "~0.18.0" - }, - "dependencies": { - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "http://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "http://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - } - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "dev": true - }, - "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" - }, - "semver-diff": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", - "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", - "requires": { - "semver": "^5.0.3" - } - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, - "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" - }, - "shellwords": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", - "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" - }, - "sisteransi": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-0.1.1.tgz", - "integrity": "sha512-PmGOd02bM9YO5ifxpw36nrNMBTptEtfRl4qUYl9SndkolplkrZZOW7PGHjrZL53QvMVj9nQ+TKqUnRsw4tJa4g==", - "dev": true - }, - "slash": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", - "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", - "dev": true - }, - "slice-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.0.0.tgz", - "integrity": "sha512-4j2WTWjp3GsZ+AOagyzVbzp4vWGtZ0hEZ/gDY/uTvm6MTxUfTUIsnMIFb1bn8o0RuXiqUw15H1bue8f22Vw2oQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" - } - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "requires": { - "kind-of": "^3.2.0" - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, - "source-map-resolve": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", - "dev": true, - "requires": { - "atob": "^2.1.1", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-support": { - "version": "0.4.18", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", - "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", - "dev": true, - "requires": { - "source-map": "^0.5.6" - } - }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", - "dev": true - }, - "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz", - "integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==", - "dev": true - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "http://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "sshpk": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.0.tgz", - "integrity": "sha512-Zhev35/y7hRMcID/upReIvRse+I9SVhyVre/KTJSJQWMz3C3+G+HpO7m1wK/yckEtujKZ7dS4hkVxAnmHaIGVQ==", - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "stack-utils": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.2.tgz", - "integrity": "sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA==", - "dev": true - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "stealthy-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=" - }, - "string-length": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/string-length/-/string-length-2.0.0.tgz", - "integrity": "sha1-1A27aGo6zpYMHP/KVivyxF+DY+0=", - "dev": true, - "requires": { - "astral-regex": "^1.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz", - "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", - "requires": { - "ansi-regex": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz", - "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==" - } - } - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } - }, - "strip-eof": { - "version": "1.0.0", - "resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "requires": { - "has-flag": "^3.0.0" - } - }, - "symbol-tree": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", - "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", - "dev": true - }, - "table": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/table/-/table-5.1.1.tgz", - "integrity": "sha512-NUjapYb/qd4PeFW03HnAuOJ7OMcBkJlqeClWxeNlQ0lXGSb52oZXGzkO0/I0ARegQ2eUT1g2VDJH0eUxDRcHmw==", - "dev": true, - "requires": { - "ajv": "^6.6.1", - "lodash": "^4.17.11", - "slice-ansi": "2.0.0", - "string-width": "^2.1.1" - } - }, - "term-size": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", - "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", - "requires": { - "execa": "^0.7.0" - } - }, - "test-exclude": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-4.2.3.tgz", - "integrity": "sha512-SYbXgY64PT+4GAL2ocI3HwPa4Q4TBKm0cwAVeKOt/Aoc0gSpNRjJX8w0pA1LMKZ3LBmd8pYBqApFNQLII9kavA==", - "dev": true, - "requires": { - "arrify": "^1.0.1", - "micromatch": "^2.3.11", - "object-assign": "^4.1.0", - "read-pkg-up": "^1.0.1", - "require-main-filename": "^1.0.1" - } - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, - "throat": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/throat/-/throat-4.1.0.tgz", - "integrity": "sha1-iQN8vJLFarGJJua6TLsgDhVnKmo=", - "dev": true - }, - "through": { - "version": "2.3.8", - "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" - }, - "timed-out": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", - "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=" - }, - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "requires": { - "os-tmpdir": "~1.0.2" - } - }, - "tmpl": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", - "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=", - "dev": true - }, - "to-fast-properties": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", - "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", - "dev": true - }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - } - } - } - }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - } - } - }, - "tr46": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "trim-right": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", - "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", - "dev": true - }, - "tslib": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2" - } - }, - "typescript": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.2.tgz", - "integrity": "sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg==" - }, - "uglify-js": { - "version": "3.4.9", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", - "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", - "dev": true, - "optional": true, - "requires": { - "commander": "~2.17.1", - "source-map": "~0.6.1" - }, - "dependencies": { - "commander": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", - "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", - "dev": true, - "optional": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "optional": true - } - } - }, - "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } - } - }, - "unique-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", - "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", - "requires": { - "crypto-random-string": "^1.0.0" - } - }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - } - } - }, - "unzip-response": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz", - "integrity": "sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c=" - }, - "update-notifier": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.5.0.tgz", - "integrity": "sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw==", - "requires": { - "boxen": "^1.2.1", - "chalk": "^2.0.1", - "configstore": "^3.0.0", - "import-lazy": "^2.1.0", - "is-ci": "^1.0.10", - "is-installed-globally": "^0.1.0", - "is-npm": "^1.0.0", - "latest-version": "^3.0.0", - "semver-diff": "^2.0.0", - "xdg-basedir": "^3.0.0" - }, - "dependencies": { - "configstore": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.2.tgz", - "integrity": "sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw==", - "requires": { - "dot-prop": "^4.1.0", - "graceful-fs": "^4.1.2", - "make-dir": "^1.0.0", - "unique-string": "^1.0.0", - "write-file-atomic": "^2.0.0", - "xdg-basedir": "^3.0.0" - } - } - } - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "requires": { - "punycode": "^2.1.0" - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "url-parse-lax": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", - "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", - "requires": { - "prepend-http": "^1.0.1" - } - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "util.promisify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", - "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "object.getownpropertydescriptors": "^2.0.3" - } - }, - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "w3c-hr-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", - "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", - "dev": true, - "requires": { - "browser-process-hrtime": "^0.1.2" - } - }, - "walker": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz", - "integrity": "sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=", - "dev": true, - "requires": { - "makeerror": "1.0.x" - } - }, - "watch": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/watch/-/watch-0.18.0.tgz", - "integrity": "sha1-KAlUdsbffJDJYxOJkMClQj60uYY=", - "dev": true, - "requires": { - "exec-sh": "^0.2.0", - "minimist": "^1.2.0" - } - }, - "wcwidth": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", - "requires": { - "defaults": "^1.0.3" - } - }, - "webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", - "dev": true - }, - "whatwg-encoding": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", - "dev": true, - "requires": { - "iconv-lite": "0.4.24" - } - }, - "whatwg-mimetype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", - "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", - "dev": true - }, - "whatwg-url": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.5.0.tgz", - "integrity": "sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==", - "dev": true, - "requires": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "widest-line": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", - "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", - "requires": { - "string-width": "^2.1.1" - } - }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "http://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - } - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "write": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", - "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", - "dev": true, - "requires": { - "mkdirp": "^0.5.1" - } - }, - "write-file-atomic": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", - "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - } - }, - "ws": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", - "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", - "dev": true, - "requires": { - "async-limiter": "~1.0.0" - } - }, - "xdg-basedir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", - "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=" - }, - "xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", - "dev": true - }, - "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", - "dev": true - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" - }, - "yargs": { - "version": "11.1.0", - "resolved": "http://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz", - "integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==", - "dev": true, - "requires": { - "cliui": "^4.0.0", - "decamelize": "^1.1.1", - "find-up": "^2.1.0", - "get-caller-file": "^1.0.1", - "os-locale": "^2.0.0", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^2.0.0", - "which-module": "^2.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^9.0.2" - } - }, - "yargs-parser": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", - "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", - "dev": true, - "requires": { - "camelcase": "^4.1.0" - } - } - } -} diff --git a/app-cli/package.json b/app-cli/package.json index 01f0cac..ddb9ca5 100644 --- a/app-cli/package.json +++ b/app-cli/package.json @@ -41,18 +41,21 @@ ] }, "dependencies": { + "@types/configstore": "^4.0.0", "@types/fs-extra": "^5.0.4", + "@types/inquirer": "^0.0.43", "@types/request-promise": "^4.1.42", + "@types/update-notifier": "^2.5.0", + "axios": "^0.18.0", "chalk": "^2.4.1", "command-exists": "^1.2.8", "commander": "^2.19.0", "configstore": "^4.0.0", "fs-extra": "^7.0.1", "inquirer": "^6.2.1", + "npm": "^6.5.0", "ora": "^3.0.0", "progress": "^2.0.3", - "request": "^2.88.0", - "request-promise": "^4.2.2", "typescript": "^3.2.2", "update-notifier": "^2.5.0" }, diff --git a/app-cli/src/api/ApiManager.ts b/app-cli/src/api/ApiManager.ts new file mode 100644 index 0000000..b3fef6c --- /dev/null +++ b/app-cli/src/api/ApiManager.ts @@ -0,0 +1,390 @@ +import HttpClient from './HttpClient'; +import Logger from '../utils/Logger'; +import { IRegistryInfo } from '../models/IRegistryInfo'; +import { ICaptainDefinition } from '../models/ICaptainDefinition'; +import { IVersionInfo } from '../models/IVersionInfo'; +import { IAppDef } from '../models/AppDef'; + +export default class ApiManager { + private static lastKnownPassword: string = process.env.REACT_APP_DEFAULT_PASSWORD + ? process.env.REACT_APP_DEFAULT_PASSWORD + '' + : 'captain42'; + private static authToken: string = !!process.env.REACT_APP_IS_DEBUG + ? 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7Im5hbWVzcGFjZSI6ImNhcHRhaW4iLCJ0b2tlblZlcnNpb24iOiI5NmRjM2U1MC00ZDk3LTRkNmItYTIzMS04MmNiZjY0ZTA2NTYifSwiaWF0IjoxNTQ1OTg0MDQwLCJleHAiOjE1ODE5ODQwNDB9.uGJyhb2JYsdw9toyMKX28bLVuB0PhnS2POwEjKpchww' + : ''; + + private http: HttpClient; + + constructor(baseUrl: string, private authTokenSaver: (authToken: string) => Promise) { + const self = this; + + this.http = new HttpClient(baseUrl, ApiManager.authToken, function() { + return self.getAuthToken(ApiManager.lastKnownPassword); + }); + } + + destroy() { + this.http.destroy(); + } + + setAuthToken(authToken: string) { + ApiManager.authToken = authToken; + this.http.setAuthToken(authToken); + } + + static isLoggedIn() { + return !!ApiManager.authToken; + } + + getAuthToken(password: string) { + const http = this.http; + ApiManager.lastKnownPassword = password; + let authTokenFetched = ''; + + const self = this; + return Promise.resolve() // + .then(http.fetch(http.POST, '/login', { password })) + .then(function(data) { + authTokenFetched = data.token; + self.setAuthToken(authTokenFetched); + return authTokenFetched; + }) + .then(self.authTokenSaver) + .then(function() { + return authTokenFetched; + }); + } + + getCaptainInfo() { + const http = this.http; + + return Promise.resolve() // + .then(http.fetch(http.GET, '/user/system/info', {})); + } + + updateRootDomain(rootDomain: string) { + const http = this.http; + + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/system/changerootdomain', { rootDomain })); + } + + enableRootSsl(emailAddress: string) { + const http = this.http; + + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/system/enablessl', { emailAddress })); + } + + forceSsl(isEnabled: boolean) { + const http = this.http; + + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/system/forcessl', { isEnabled })); + } + + getAllApps() { + const http = this.http; + + return Promise.resolve() // + .then(http.fetch(http.GET, '/user/apps/appDefinitions', {})); + } + + fetchBuildLogs(appName: string) { + const http = this.http; + + return Promise.resolve() // + .then(http.fetch(http.GET, '/user/apps/appData/' + appName, {})); + } + + uploadAppData(appName: string, file: File) { + const http = this.http; + var formData = new FormData(); + formData.append('sourceFile', file); + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/apps/appData/' + appName + '?detached=1', formData)); + } + + uploadCaptainDefinitionContent( + appName: string, + captainDefinition: ICaptainDefinition, + gitHash: string, + detached: boolean + ) { + const http = this.http; + + return Promise.resolve() // + .then( + http.fetch(http.POST, '/user/apps/appData/' + appName + (detached ? '?detached=1' : ''), { + captainDefinitionContent: JSON.stringify(captainDefinition), + gitHash + }) + ); + } + + updateConfigAndSave(appName: string, appDefinition: IAppDef) { + var instanceCount = appDefinition.instanceCount; + var envVars = appDefinition.envVars; + var notExposeAsWebApp = appDefinition.notExposeAsWebApp; + var forceSsl = appDefinition.forceSsl; + var volumes = appDefinition.volumes; + var ports = appDefinition.ports; + var nodeId = appDefinition.nodeId; + var appPushWebhook = appDefinition.appPushWebhook; + var customNginxConfig = appDefinition.customNginxConfig; + var preDeployFunction = appDefinition.preDeployFunction; + const http = this.http; + + return Promise.resolve() // + .then( + http.fetch(http.POST, '/user/apps/appDefinitions/update', { + appName: appName, + instanceCount: instanceCount, + notExposeAsWebApp: notExposeAsWebApp, + forceSsl: forceSsl, + volumes: volumes, + ports: ports, + customNginxConfig: customNginxConfig, + appPushWebhook: appPushWebhook, + nodeId: nodeId, + preDeployFunction: preDeployFunction, + envVars: envVars + }) + ); + } + + registerNewApp(appName: string, hasPersistentData: boolean) { + const http = this.http; + + return Promise.resolve() // + .then( + http.fetch(http.POST, '/user/apps/appDefinitions/register', { + appName, + hasPersistentData + }) + ); + } + + deleteApp(appName: string) { + const http = this.http; + + return Promise.resolve() // + .then( + http.fetch(http.POST, '/user/apps/appDefinitions/delete', { + appName + }) + ); + } + + enableSslForBaseDomain(appName: string) { + const http = this.http; + + return Promise.resolve() // + .then( + http.fetch(http.POST, '/user/apps/appDefinitions/enablebasedomainssl', { + appName + }) + ); + } + + attachNewCustomDomainToApp(appName: string, customDomain: string) { + const http = this.http; + + return Promise.resolve() // + .then( + http.fetch(http.POST, '/user/apps/appDefinitions/customdomain', { + appName, + customDomain + }) + ); + } + + enableSslForCustomDomain(appName: string, customDomain: string) { + const http = this.http; + + return Promise.resolve() // + .then( + http.fetch(http.POST, '/user/apps/appDefinitions/enablecustomdomainssl', { + appName, + customDomain + }) + ); + } + + removeCustomDomain(appName: string, customDomain: string) { + const http = this.http; + + return Promise.resolve() // + .then( + http.fetch(http.POST, '/user/apps/appDefinitions/removecustomdomain', { + appName, + customDomain + }) + ); + } + + getLoadBalancerInfo() { + const http = this.http; + + return Promise.resolve() // + .then(http.fetch(http.GET, '/user/system/loadbalancerinfo', {})); + } + + getNetDataInfo() { + const http = this.http; + + return Promise.resolve() // + .then(http.fetch(http.GET, '/user/system/netdata', {})); + } + + updateNetDataInfo(netDataInfo: any) { + const http = this.http; + + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/system/netdata', { netDataInfo })); + } + + changePass(oldPassword: string, newPassword: string) { + const http = this.http; + + return Promise.resolve() // + .then( + http.fetch(http.POST, '/user/changepassword', { + oldPassword, + newPassword + }) + ); + } + + getVersionInfo(): Promise { + const http = this.http; + + return Promise.resolve() // + .then(http.fetch(http.GET, '/user/system/versioninfo', {})); + } + + performUpdate(latestVersion: string) { + const http = this.http; + + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/system/versioninfo', { latestVersion })); + } + + getNginxConfig() { + const http = this.http; + + return Promise.resolve() // + .then(http.fetch(http.GET, '/user/system/nginxconfig', {})); + } + + setNginxConfig(customBase: string, customCaptain: string) { + const http = this.http; + + return Promise.resolve() // + .then( + http.fetch(http.POST, '/user/system/nginxconfig', { + baseConfig: { customValue: customBase }, + captainConfig: { customValue: customCaptain } + }) + ); + } + + getUnusedImages(mostRecentLimit: number) { + const http = this.http; + return Promise.resolve() // + .then( + http.fetch(http.GET, '/user/apps/appDefinitions/unusedImages', { + mostRecentLimit: mostRecentLimit + '' + }) + ); + } + + deleteImages(imageIds: string[]) { + const http = this.http; + + return Promise.resolve() // + .then( + http.fetch(http.POST, '/user/apps/appDefinitions/deleteImages', { + imageIds + }) + ); + } + + getDockerRegistries() { + const http = this.http; + + return Promise.resolve() // + .then(http.fetch(http.GET, '/user/registries', {})); + } + + enableSelfHostedDockerRegistry() { + const http = this.http; + + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/system/selfhostregistry/enableregistry', {})); + } + + disableSelfHostedDockerRegistry() { + const http = this.http; + + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/system/selfhostregistry/disableregistry', {})); + } + + addDockerRegistry(dockerRegistry: IRegistryInfo) { + const http = this.http; + + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/registries/insert', { ...dockerRegistry })); + } + + updateDockerRegistry(dockerRegistry: IRegistryInfo) { + const http = this.http; + + return Promise.resolve() // + .then(http.fetch(http.POST, '/user/registries/update', { ...dockerRegistry })); + } + + deleteDockerRegistry(registryId: string) { + const http = this.http; + + return Promise.resolve() // + .then( + http.fetch(http.POST, '/user/registries/delete', { + registryId + }) + ); + } + + setDefaultPushDockerRegistry(registryId: string) { + const http = this.http; + + return Promise.resolve() // + .then( + http.fetch(http.POST, '/user/registries/setpush', { + registryId + }) + ); + } + + getAllNodes() { + const http = this.http; + + return Promise.resolve() // + .then(http.fetch(http.GET, '/user/system/nodes', {})); + } + + addDockerNode(nodeType: string, privateKey: string, remoteNodeIpAddress: string, captainIpAddress: string) { + const http = this.http; + + return Promise.resolve() // + .then( + http.fetch(http.POST, '/user/system/nodes', { + nodeType, + privateKey, + remoteNodeIpAddress, + captainIpAddress + }) + ); + } +} diff --git a/app-cli/src/api/CliApiManager.ts b/app-cli/src/api/CliApiManager.ts new file mode 100644 index 0000000..bfbef63 --- /dev/null +++ b/app-cli/src/api/CliApiManager.ts @@ -0,0 +1,33 @@ +import ApiManager from './ApiManager'; +import { IHashMapGeneric } from '../models/IHashMapGeneric'; +import StorageHelper from '../utils/StorageHelper'; +import { IMachine } from '../models/storage/StoredObjects'; + +function hashCode(str: string) { + var hash = 0, + i, + chr; + if (str.length === 0) return hash; + for (i = 0; i < str.length; i++) { + chr = str.charCodeAt(i); + hash = (hash << 5) - hash + chr; + hash |= 0; // Convert to 32bit integer + } + return hash; +} + +export default class CliApiManager { + static instances: IHashMapGeneric = {}; + + static get(capMachine: IMachine) { + const hashKey = 'v' + hashCode(capMachine.baseUrl); + if (!CliApiManager.instances[hashKey]) + CliApiManager.instances[hashKey] = new ApiManager(capMachine.baseUrl + '/api/v1', function(token) { + capMachine.authToken = token; + StorageHelper.get().saveMachine(capMachine); + return Promise.resolve(); + }); + + return CliApiManager.instances[hashKey]; + } +} diff --git a/app-cli/src/api/DeployApi.ts b/app-cli/src/api/DeployApi.ts deleted file mode 100644 index 890a7cc..0000000 --- a/app-cli/src/api/DeployApi.ts +++ /dev/null @@ -1,109 +0,0 @@ -import { IMachine } from '../models/IModels'; -import MachineHelper from '../helpers/MachineHelper'; - -const MainApi = require('./MainApi'); -const { DEFAULT_BRANCH_TO_PUSH, DEFAULT_APP_NAME } = require('../utils/constants'); - -class DeployApi { - private machineToDeploy: IMachine | undefined; - private branchToPush = DEFAULT_BRANCH_TO_PUSH; - private appName = DEFAULT_APP_NAME; - private appUrl = ''; - - setMachineToDeploy(machineToDeploy: IMachine) { - this.machineToDeploy = machineToDeploy; - } - - updateMachineToDeploy(machineToDeploy: string) { - let possibleMachine = {}; - - // Look machine by host - if (machineToDeploy.startsWith('http')) { - this.machineToDeploy = MachineHelper.getMachines().find((machine) => machine.baseUrl === machineToDeploy)!; - } else { - // Look machine by name - this.machineToDeploy = MachineHelper.getMachines().find((machine) => machine.name === machineToDeploy)!; - } - } - - setBranchToPush(branchToPush: string) { - this.branchToPush = branchToPush; - } - - setAppName(appName: string) { - this.appName = appName; - - this.setAppUrl(); - } - - setAppUrl() { - this.appUrl = this.machineToDeploy!.baseUrl - .replace('//captain.', '//' + this.appName + '.') - .replace('https://', 'http://'); - } - - async fetchBuildLogs() { - try { - const { authToken, baseUrl } = this.machineToDeploy!; - const customOptions = { - headers: { - 'x-captain-auth': authToken - } - }; - const data = await MainApi.get(`${baseUrl}/api/v1/user/appData/${this.appName}`, customOptions); - - return data; - } catch (e) { - throw e; - } - } - - async sendFile(sourceFile: string, gitHash: string) { - try { - const { authToken, baseUrl } = this.machineToDeploy!; - const url = `${baseUrl}/api/v1/user/appData/${this.appName}/?detached=1`; - const form = { - sourceFile, - gitHash - }; - const options = { - headers: { - 'x-captain-auth': authToken - } - }; - const data = await MainApi.postWithFile(url, form, options); - - return data; - } catch (e) { - throw e; - } - } - - // This is not moved to LoginAPI since it's related only for machineToDeploy - async isAuthTokenValid() { - try { - if (!this.machineToDeploy) return false; - - const url = `${this.machineToDeploy.baseUrl}/api/v1/user/appDefinitions/`; - const currentToken = this.machineToDeploy.authToken; - const options = { - headers: { - 'x-captain-auth': currentToken - } - }; - const response = await MainApi.get(url, options); - const data = JSON.parse(response); - - // Tolken is not valid - if (data.status === 1106 || data.status === 1105) { - return false; - } - - return true; - } catch (e) { - throw e; - } - } -} - -export = new DeployApi(); diff --git a/app-cli/src/api/HttpClient.ts b/app-cli/src/api/HttpClient.ts new file mode 100644 index 0000000..1f7f947 --- /dev/null +++ b/app-cli/src/api/HttpClient.ts @@ -0,0 +1,124 @@ +import axios from 'axios'; +import ErrorFactory from '../utils/ErrorFactory'; +import Logger from '../utils/Logger'; + +var TOKEN_HEADER = 'x-captain-auth'; +var NAMESPACE = 'x-namespace'; +var CAPTAIN = 'captain'; + +export default class HttpClient { + public readonly GET = 'GET'; + public readonly POST = 'POST'; + public isDestroyed = false; + + constructor(private baseUrl: string, private authToken: string, private onAuthFailure: () => Promise) { + // + } + + createHeaders() { + let headers: any = {}; + if (this.authToken) headers[TOKEN_HEADER] = this.authToken; + headers[NAMESPACE] = CAPTAIN; + + // check user/appData or apiManager.uploadAppData before changing this signature. + return headers; + } + + setAuthToken(authToken: string) { + this.authToken = authToken; + } + + destroy() { + this.isDestroyed = true; + } + + fetch(method: 'GET' | 'POST', endpoint: string, variables: any) { + const self = this; + return function(): Promise { + return Promise.resolve() // + .then(function() { + if (!process.env.REACT_APP_IS_DEBUG) return Promise.resolve(); + return new Promise(function(res) { + setTimeout(res, 500); + }); + }) + .then(function() { + return self.fetchInternal(method, endpoint, variables); // + }) + .then(function(axiosResponse) { + const data = axiosResponse.data; // this is an axios thing! + if (data.status === ErrorFactory.STATUS_AUTH_TOKEN_INVALID) { + return self + .onAuthFailure() // + .then(function() { + return self.fetchInternal(method, endpoint, variables).then(function(newAxiosResponse) { + return newAxiosResponse.data; + }); + }); + } else { + return data; + } + }) + .then(function(data) { + if (data.status !== ErrorFactory.OKAY && data.status !== ErrorFactory.OKAY_BUILD_STARTED) { + throw ErrorFactory.createError( + data.status || ErrorFactory.UNKNOWN_ERROR, + data.description || '' + ); + } + return data; + }) + .then(function(data) { + // These two blocks are clearly memory leaks! But I don't have time to fix them now... I need to CANCEL the promise, but since I don't + // have CANCEL method on the native Promise, I return a promise that will never RETURN if the HttpClient is destroyed. + // Will fix them later... but it shouldn't be a big deal anyways as it's only a problem when user navigates away from a page before the + // network request returns back. + return new Promise(function(resolve, reject) { + // data.data here is the "data" field inside the API response! {status: 100, description: "Login succeeded", data: {…}} + if (!self.isDestroyed) return resolve(data.data || { token: data.token }); // TODO remove || for API V2 + Logger.dev('Destroyed then not called'); + }); + }) + .catch(function(error) { + Logger.error(error.message || error); + return new Promise(function(resolve, reject) { + if (!self.isDestroyed) return reject(error); + Logger.dev('Destroyed catch not called'); + }); + }); + }; + } + + fetchInternal(method: 'GET' | 'POST', endpoint: string, variables: any) { + if (method === this.GET) return this.getReq(endpoint, variables); + + if (method === this.POST) return this.postReq(endpoint, variables); + + throw new Error('Unknown method: ' + method); + } + + getReq(endpoint: string, variables: any) { + const self = this; + return axios + .get(this.baseUrl + endpoint, { + params: variables, + headers: self.createHeaders() + }) // + .then(function(data) { + //console.log(data); + return data; + }); + } + + postReq(endpoint: string, variables: any) { + const self = this; + return axios + .post(this.baseUrl + endpoint, variables, { + headers: self.createHeaders() + }) // + .then(function(data) { + //console.log(data); + return data; + }); + } +} diff --git a/app-cli/src/api/LoginApi.ts b/app-cli/src/api/LoginApi.ts deleted file mode 100644 index 0ac8d97..0000000 --- a/app-cli/src/api/LoginApi.ts +++ /dev/null @@ -1,56 +0,0 @@ -const MainApi = require('./MainApi'); -const SystemApi = require('./SystemApi'); -const { DEFAULT_PASSWORD } = require('../utils/constants'); - -class LoginApi { - private token = ''; - private oldPassword = DEFAULT_PASSWORD; - - setOldPassword(newPassword: string) { - this.oldPassword = newPassword; - } - - setToken(newToken: string) { - this.token = newToken; - } - - async loginMachine(baseUrl: string, password: string) { - try { - const data = await MainApi.post(`${baseUrl}/api/v1/login`, { password }); - const dataAsObject = JSON.parse(data); - - if (dataAsObject) { - this.setToken(dataAsObject.token); - } - - return data; - } catch (e) { - throw e; - } - } - - async changePass(baseUrl: string, newPassword: string) { - try { - const customOptions = { - headers: { - 'x-captain-auth': this.token - } - }; - const form = { - oldPassword: this.oldPassword, - newPassword - }; - const data = await MainApi.post(`${baseUrl}/api/v1/user/changepassword/`, form, customOptions); - - this.setToken(data.token); - - SystemApi.setIpAddressOfServer(baseUrl); - - return data; - } catch (e) { - throw e; - } - } -} - -export = new LoginApi(); diff --git a/app-cli/src/api/MainApi.ts b/app-cli/src/api/MainApi.ts deleted file mode 100644 index fd0486a..0000000 --- a/app-cli/src/api/MainApi.ts +++ /dev/null @@ -1,99 +0,0 @@ -import * as Request from 'request-promise'; - -interface IOptions { - headers: any; -} - -class MainApi { - private sharedOptions: any; - constructor() { - this.sharedOptions = { - headers: { - 'x-namespace': 'captain' - } - }; - } - - _buildOptions(options: IOptions) { - if (!options) return this.sharedOptions; - - if (options.headers) { - options.headers = Object.assign({}, this.sharedOptions.headers, options.headers); - } - - return Object.assign({}, this.sharedOptions, options); - } - - get(url: string, options: IOptions) { - const overrideOptions = this._buildOptions(options); - const optionsToSend = { - ...overrideOptions, - url, - method: 'GET' - }; - - return Request(optionsToSend); - } - - post(url: string, form: any, options: IOptions) { - const overrideOptions = this._buildOptions(options); - const optionsToSend = { - ...overrideOptions, - url, - method: 'POST', - form - }; - - return Request(optionsToSend); - } - - postWithFile(url: string, formData: any, options: IOptions) { - const overrideOptions = this._buildOptions(options); - const optionsToSend = { - ...overrideOptions, - url, - method: 'POST', - formData - }; - - return Request(optionsToSend); - } - - put(url: string, form: any, options: IOptions) { - const overrideOptions = this._buildOptions(options); - const optionsToSend = { - ...overrideOptions, - url, - method: 'PUT', - form - }; - - return Request(optionsToSend); - } - - patch(url: string, form: any, options: IOptions) { - const overrideOptions = this._buildOptions(options); - const optionsToSend = { - ...overrideOptions, - url, - method: 'PATCH', - form - }; - - return Request(optionsToSend); - } - - delete(url: string, options: IOptions) { - const overrideOptions = this._buildOptions(options); - const optionsToSend = { - ...overrideOptions, - url, - method: 'DELETE' - }; - - return Request(optionsToSend); - } -} - -const instance = new MainApi(); -export = instance; diff --git a/app-cli/src/api/SystemApi.ts b/app-cli/src/api/SystemApi.ts deleted file mode 100644 index 457e008..0000000 --- a/app-cli/src/api/SystemApi.ts +++ /dev/null @@ -1,83 +0,0 @@ -const MainApi = require('./MainApi'); -const LoginApi = require('./LoginApi'); -// const spinnerUtil = require("../../utils/spinner") - -class SystemApi { - private ipAddressOfServer = ''; - private customDomainFromUser = ''; - private newPasswordFirstTry = ''; - - setCustomDomainFromUser(newCustomDomainFromUser: string) { - this.customDomainFromUser = newCustomDomainFromUser; - } - - setIpAddressOfServer(newIpAddress: string) { - this.ipAddressOfServer = newIpAddress.trim(); - } - - async setCustomDomain(baseUrl: string, rootDomain: string) { - try { - const customOptions = { - headers: { - 'x-captain-auth': LoginApi.token - } - }; - const data = await MainApi.post( - `${baseUrl}/api/v1/user/system/changerootdomain/`, - { - rootDomain - }, - customOptions - ); - - return data; - } catch (e) { - throw e; - } - } - - async enableHttps(baseUrl: string, emailAddress: string) { - const customOptions = { - headers: { - 'x-captain-auth': LoginApi.token - } - }; - - try { - const data = await MainApi.post( - `${baseUrl}/api/v1/user/system/enablessl/`, - { - emailAddress - }, - customOptions - ); - - return data; - } catch (e) { - throw e; - } - } - - async forceHttps(baseUrl:string, isEnabled = true) { - try { - const customOptions = { - headers: { - 'x-captain-auth': LoginApi.token - } - }; - const data = await MainApi.post( - `${baseUrl}/api/v1/user/system/forcessl/`, - { - isEnabled - }, - customOptions - ); - - return data; - } catch (e) { - throw e; - } - } -} - -export = new SystemApi(); diff --git a/app-cli/src/commands/captainduckduck.ts b/app-cli/src/commands/captainduckduck.ts index fb6dca0..1de2c37 100755 --- a/app-cli/src/commands/captainduckduck.ts +++ b/app-cli/src/commands/captainduckduck.ts @@ -1,30 +1,23 @@ #!/usr/bin/env node -import logout = require("./logout"); - -const { printError } = require('../utils/messageHandler'); const packagejson = require('../../package.json'); -const updateNotifier = require('update-notifier'); -const program = require('commander'); - +import * as updateNotifier from 'update-notifier'; updateNotifier({ pkg: packagejson }).notify({ isGlobal: true }); +import StdOutUtil from '../utils/StdOutUtil'; +import * as program from 'commander'; + // Command actions -const serversetup = require('./serversetup'); -const { login } = require('./login'); -const list = require('./list'); -const deploy = require('./deploy'); +import login from './login'; +// import serversetup = require('./serversetup'); +// import list = require('./list'); +// import deploy = require('./deploy'); +// import logout = require('./logout'); // Setup program.version(packagejson.version).description(packagejson.description); // Commands -program - .command('serversetup') - .description('Performs necessary actions and prepares your Captain server.') - .action(() => { - serversetup(); - }); program .command('login') @@ -33,35 +26,42 @@ program login(); }); -program.command('logout').description('Logout from a specific Captain machine.').action(() => { - logout(); -}); +// program +// .command('serversetup') +// .description('Performs necessary actions and prepares your Captain server.') +// .action(() => { +// serversetup(); +// }); -program.command('list').alias('ls').description('List all Captain machines currently logged in.').action(() => { - list(); -}); +// program.command('logout').description('Logout from a specific Captain machine.').action(() => { +// logout(); +// }); -program - .command('deploy') - .description( - "Deploy your app (current directory) to a specific Captain machine. You'll be prompted to choose your Captain machine." - ) - .option('-t, --tarFile ', 'Specify file to be uploaded (rather than using git archive)') - .option('-d, --default', 'Run with default options') - .option('-s, --stateless', 'Run deploy stateless') - .option('-h, --host ', 'Only for stateless mode: Host of the captain machine') - .option('-a, --appName ', 'Only for stateless mode: Name of the app') - .option('-p, --pass ', 'Only for stateless mode: Password for Captain') - .option('-b, --branch ', 'Only for stateless mode: Branch name (default master)') - .action((options: any) => { - deploy(options); - }); +// program.command('list').alias('ls').description('List all Captain machines currently logged in.').action(() => { +// list(); +// }); + +// program +// .command('deploy') +// .description( +// "Deploy your app (current directory) to a specific Captain machine. You'll be prompted to choose your Captain machine." +// ) +// .option('-t, --tarFile ', 'Specify file to be uploaded (rather than using git archive)') +// .option('-d, --default', 'Run with default options') +// .option('-s, --stateless', 'Run deploy stateless') +// .option('-h, --host ', 'Only for stateless mode: Host of the captain machine') +// .option('-a, --appName ', 'Only for stateless mode: Name of the app') +// .option('-p, --pass ', 'Only for stateless mode: Password for Captain') +// .option('-b, --branch ', 'Only for stateless mode: Branch name (default master)') +// .action((options: any) => { +// deploy(options); +// }); // Error on unknown commands program.on('command:*', () => { const wrongCommands = program.args.join(' '); - printError(`\nInvalid command: ${wrongCommands}\nSee --help for a list of available commands.`, true); + StdOutUtil.printError(`\nInvalid command: ${wrongCommands}\nSee --help for a list of available commands.`, true); }); program.parse(process.argv); diff --git a/app-cli/src/commands/deploy.ts b/app-cli/src/commands/deploy.ts deleted file mode 100644 index 0e5d9f7..0000000 --- a/app-cli/src/commands/deploy.ts +++ /dev/null @@ -1,200 +0,0 @@ -#!/usr/bin/env node - -import MachineHelper from '../helpers/MachineHelper'; -const inquirer = require('inquirer'); -const DeployApi = require('../api/DeployApi'); -const LoginApi = require('../api/LoginApi'); -const { printError, printMessage } = require('../utils/messageHandler'); -const { - validateIsGitRepository, - validateDefinitionFile, - optionIsNotGiven, - validateAuthentication -} = require('../utils/validationsHandler'); -const { uploadFile } = require('../utils/fileHelper'); -const { gitArchiveFile } = require('../utils/fileHelper'); -const fs = require('fs-extra'); -const path = require('path'); -const commandExistsSync = require('command-exists').sync; -const { initMachineFromLocalStorage } = require('../utils/machineUtils'); - -async function deployAsDefaultValues() { - try { - const isValidAuthentication = await validateAuthentication(); - - if (isValidAuthentication) { - const { appName, branchToPush, machineToDeploy } = DeployApi; - - if (!appName || !branchToPush || !machineToDeploy) { - printError('Default deploy failed. There are no default options selected.', true); - } - - printMessage(`Deploying to ${machineToDeploy.name}`); - - deployFromGitProject(); - } else { - printError('Incorrect login details', true); - } - } catch (e) { - printError(e.message, true); - } -} - -async function deployAsStateless(host: string, appName: string, branch: string, pass: string) { - const isStateless = host && appName && branch && pass; - - if (isStateless) { - // login first - printMessage(`Trying to login to ${host}\n`); - - const { name } = DeployApi.machineToDeploy; - const response = await LoginApi.loginMachine(host, pass); - const data = JSON.parse(response); - const newToken = data.token; - - // Update the token to the machine that corresponds (if needed) - MachineHelper.updateMachineAuthToken(name, newToken); - - if (data) { - printMessage(`Starting stateless deploy to\n${host}\n${branch}\n${appName}`); - - deployFromGitProject(); - } - } else { - printError('You are missing parameters for deploying on stateless. '); - } -} - -async function deployFromTarFile(tarFile: string) { - try { - const isValidAuthentication = await validateAuthentication(); - - if (isValidAuthentication) { - // Send from tar file - const filePath = tarFile; - const gitHash = 'sendviatarfile'; - - await uploadFile(filePath, gitHash); - } else { - printError('Incorrect login details', true); - } - } catch (e) { - printError(e.message, true); - } -} - -function deployFromGitProject() { - if (!commandExistsSync('git')) { - printError("'git' command not found..."); - - printError("Captain needs 'git' to create tar file of your source files...", true); - } - - const zipFileNameToDeploy = 'temporary-captain-to-deploy.tar'; - const zipFileFullPath = path.join(process.cwd(), zipFileNameToDeploy); - - printMessage(`Saving tar file to:\n${zipFileFullPath}\n`); - - // Removes the temporarly file created - try { - const tempFileExists = fs.pathExistsSync(zipFileFullPath); - - if (tempFileExists) { - fs.removeSync(zipFileFullPath); - } - } catch (e) { - // IgnoreError - } - - gitArchiveFile(zipFileFullPath, DeployApi.branchToPush); -} - -async function deploy(options: any) { - // Reads local storage and sets the machine if found - initMachineFromLocalStorage(); - - if (!options.tarFile || !options.stateless) { - validateIsGitRepository(); - - validateDefinitionFile(); - } - - printMessage('Preparing deployment to Captain...\n'); - - if (options.default) { - deployAsDefaultValues(); - } else if (options.stateless) { - deployAsStateless(options.host, options.appName, options.branch, options.pass); - } else if (options.tarFile) { - deployFromTarFile(options.tarFile); - } else { - const questions = [ - { - type: 'list', - name: 'captainNameToDeploy', - default: DeployApi.machineToDeploy.name || '', - message: 'Select the Captain Machine you want to deploy to:', - choices: MachineHelper.getMachinesAsOptions(), - when: () => optionIsNotGiven(options, 'host') - }, - { - type: 'input', - default: DeployApi.branchToPush || 'master', - name: 'branchToPush', - message: "Enter the 'git' branch you would like to deploy:", - when: () => optionIsNotGiven(options, 'branch') - }, - { - type: 'input', - default: DeployApi.appName, - name: 'appName', - message: 'Enter the Captain app name this directory will be deployed to:', - when: () => optionIsNotGiven(options, 'appName') - }, - { - type: 'confirm', - name: 'confirmedToDeploy', - message: - 'Note that uncommitted files and files in gitignore (if any) will not be pushed to server. Please confirm so that deployment process can start.', - default: true, - when: () => optionIsNotGiven(options, 'stateless') - } - ]; - const answers = await inquirer.prompt(questions); - - if (!answers.confirmedToDeploy && !options.stateless) { - printMessage('\nOperation cancelled by the user...\n'); - - process.exit(0); - } - - const captainNameToDeploy = answers.captainNameToDeploy; - const branchToPush = answers.branchToPush || options.branch; - const appName = answers.appName || options.appName; - - DeployApi.updateMachineToDeploy(captainNameToDeploy || options.host); - - DeployApi.setBranchToPush(branchToPush); - - DeployApi.setAppName(appName); - - printMessage(`Deploying to ${DeployApi.machineToDeploy.name}`); - - // Normal deploy - if (answers.confirmedToDeploy) { - try { - const isValidAuthentication = await validateAuthentication(); - - if (isValidAuthentication) { - deployFromGitProject(); - } else { - printError('Incorrect login details', true); - } - } catch (e) { - printError(e.message, true); - } - } - } -} - -export = deploy; diff --git a/app-cli/src/commands/list.ts b/app-cli/src/commands/list.ts deleted file mode 100644 index efeee5e..0000000 --- a/app-cli/src/commands/list.ts +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env node - -const chalk = require('chalk'); -import MachineHelper from '../helpers/MachineHelper'; -import { IMachine } from '../models/IModels'; -const { printMessage } = require('../utils/messageHandler'); - -function _displayMachine(machine: IMachine) { - console.log('>> ' + chalk.greenBright(machine.name) + ' at ' + chalk.cyan(machine.baseUrl)); -} - -function list() { - printMessage('\nLogged in Captain Machines:\n'); - - MachineHelper.getMachines().map((machine) => { - _displayMachine(machine); - }); - - printMessage(''); -} - -export = list; diff --git a/app-cli/src/commands/login.ts b/app-cli/src/commands/login.ts index fb2b75b..f0709be 100644 --- a/app-cli/src/commands/login.ts +++ b/app-cli/src/commands/login.ts @@ -1,50 +1,58 @@ #!/usr/bin/env node -import MachineHelper from '../helpers/MachineHelper'; +import * as inquirer from 'inquirer'; +import StdOutUtil from '../utils/StdOutUtil'; +import StorageHelper from '../utils/StorageHelper'; +import Constants from '../utils/Constants'; +import Utils from '../utils/Utils'; +import CliHelper from '../utils/CliHelper'; +import { IHashMapGeneric } from '../models/IHashMapGeneric'; +import CliApiManager from '../api/CliApiManager'; -const { printMessage, printGreenMessage, printError } = require('../utils/messageHandler'); -const inquirer = require('inquirer'); -const DeployApi = require('../api/DeployApi'); -const { cleanUpUrl, findDefaultCaptainName } = require('../utils/loginHelpers'); -const { SAMPLE_DOMAIN } = require('../utils/constants'); -const LoginApi = require('../api/LoginApi'); +const SAMPLE_DOMAIN = Constants.SAMPLE_DOMAIN; +const cleanUpUrl = Utils.cleanUpUrl; + +// const DeployApi = require('../api/DeployApi'); +// const { cleanUpUrl, findDefaultCaptainName } = require('../utils/loginHelpers'); +// const { SAMPLE_DOMAIN } = require('../utils/constants'); +// const LoginApi = require('../api/LoginApi'); // In case the token is expired -async function requestLogin() { - const { baseUrl, name } = DeployApi.machineToDeploy; +// async function requestLogin() { +// const { baseUrl, name } = DeployApi.machineToDeploy; - printMessage('Your auth token is not valid anymore. Try to login again.'); +// printMessage('Your auth token is not valid anymore. Try to login again.'); - const questions = [ - { - type: 'password', - name: 'captainPassword', - message: 'Please enter your password for ' + baseUrl, - validate: (value: string) => { - if (value && value.trim()) { - return true; - } +// const questions = [ +// { +// type: 'password', +// name: 'captainPassword', +// message: 'Please enter your password for ' + baseUrl, +// validate: (value: string) => { +// if (value && value.trim()) { +// return true; +// } - return 'Please enter your password for ' + baseUrl; - } - } - ]; - const loginPassword = await inquirer.prompt(questions); - const password = loginPassword.captainPassword; - const response = await LoginApi.loginMachine(baseUrl, password); - const data = JSON.parse(response); - const newToken = data.token; +// return 'Please enter your password for ' + baseUrl; +// } +// } +// ]; +// const loginPassword = await inquirer.prompt(questions); +// const password = loginPassword.captainPassword; +// const response = await LoginApi.loginMachine(baseUrl, password); +// const data = JSON.parse(response); +// const newToken = data.token; - if (!newToken) return false; +// if (!newToken) return false; - // Update the token to the machine that corresponds - MachineHelper.updateMachineAuthToken(name, newToken); +// // Update the token to the machine that corresponds +// MachineHelper.updateMachineAuthToken(name, newToken); - return true; -} +// return true; +// } async function login() { - printMessage('Login to a Captain Machine'); + StdOutUtil.printMessage('Login to a Captain Machine'); const questions = [ { @@ -59,7 +67,7 @@ async function login() { if (!cleanUpUrl(value)) return 'This is an invalid URL: ' + value; - MachineHelper.getMachines().map((machine) => { + StorageHelper.get().getMachines().map((machine) => { if (cleanUpUrl(machine.baseUrl) === cleanUpUrl(value)) { return `${value} already exist as ${machine.name}. If you want to replace the existing entry, you have to first use command, and then re-login.`; } @@ -94,9 +102,9 @@ async function login() { type: 'input', name: 'captainName', message: 'Enter a name for this Captain machine:', - default: findDefaultCaptainName(), + default: CliHelper.get().findDefaultCaptainName(), validate: (value: string) => { - MachineHelper.getMachines().map((machine) => { + StorageHelper.get().getMachines().map((machine) => { if (machine.name === value) { return `${value} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.`; } @@ -110,36 +118,25 @@ async function login() { } } ]; - const answers = await inquirer.prompt(questions); + const answers = (await inquirer.prompt(questions)) as IHashMapGeneric; const { captainHasRootSsl, captainPassword, captainAddress, captainName } = answers; const handleHttp = captainHasRootSsl ? 'https://' : 'http://'; const baseUrl = `${handleHttp}${cleanUpUrl(captainAddress)}`; try { - const data = await LoginApi.loginMachine(baseUrl, captainPassword); - const response = JSON.parse(data); - - // TODO - This status should be 200 maybe? - if (response.status !== 100) { - throw new Error(JSON.stringify(response, null, 2)); - } - - const newMachine = { - authToken: response.token, + const tokenToIgnore = await CliApiManager.get({ + authToken: '', baseUrl, name: captainName - }; + }).getAuthToken(captainPassword); - MachineHelper.addMachine(newMachine); - - printGreenMessage(`Logged in successfully to ${baseUrl}`); - - printGreenMessage(`Authorization token is now saved as ${captainName} \n`); + StdOutUtil.printGreenMessage(`Logged in successfully to ${baseUrl}`); + StdOutUtil.printGreenMessage(`Authorization token is now saved as ${captainName} \n`); } catch (error) { const errorMessage = error.message ? error.message : error; - printError(`Something bad happened. Cannot save "${captainName}" \n${errorMessage}`); + StdOutUtil.printError(`Something bad happened. Cannot save "${captainName}" \n${errorMessage}`); } } -export = { login, requestLogin }; +export default login; diff --git a/app-cli/src/commands/logout.ts b/app-cli/src/commands/logout.ts deleted file mode 100644 index a9ee590..0000000 --- a/app-cli/src/commands/logout.ts +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env node - -import MachineHelper from '../helpers/MachineHelper'; -const { printMessage } = require('../utils/messageHandler'); -const inquirer = require('inquirer'); - -function generateQuestions() { - const listOfMachines = MachineHelper.getMachinesAsOptions(); - - return [ - { - type: 'list', - name: 'captainNameToLogout', - message: 'Select the Captain Machine you want to logout from:', - choices: listOfMachines - }, - { - type: 'confirm', - name: 'confirmedToLogout', - message: 'Are you sure you want to logout from this Captain machine?', - default: false, - when: (answers: any) => answers.captainNameToLogout - } - ]; -} - -async function logout() { - const questions = generateQuestions(); - - printMessage('Logout from a Captain Machine and clear auth info'); - - const answers = await inquirer.prompt(questions); - const { captainNameToLogout } = answers; - - if (!captainNameToLogout) { - printMessage('\nOperation cancelled by the user...\n', true); - } - - MachineHelper.logoutMachine(captainNameToLogout); -} - -export = logout; diff --git a/app-cli/src/commands/serversetup.ts b/app-cli/src/commands/serversetup.ts deleted file mode 100644 index 70bc8a9..0000000 --- a/app-cli/src/commands/serversetup.ts +++ /dev/null @@ -1,218 +0,0 @@ -#!/usr/bin/env node - -import { isIpAddress } from '../utils/validationsHandler'; - -const SystemApi = require('../api/SystemApi'); -const LoginApi = require('../api/LoginApi'); -const inquirer = require('inquirer'); -const { findDefaultCaptainName } = require('../utils/loginHelpers'); -const { SAMPLE_IP, DEFAULT_PASSWORD } = require('../utils/constants'); -const { printMessage, printError, printMessageAndExit, errorHandler } = require('../utils/messageHandler'); -import MachineHelper from '../helpers/MachineHelper'; - -let newPasswordFirstTry: string | undefined = undefined; -const questions = [ - { - type: 'list', - name: 'hasInstalledCaptain', - message: - 'Have you already installed Captain on your server by running the following line:' + - '\nmkdir /captain && docker run -p 80:80 -p 443:443 -p 3000:3000 -v /var/run/docker.sock:/var/run/docker.sock dockersaturn/captainduckduck ?', - default: 'Yes', - choices: [ 'Yes', 'No' ], - filter: (value: string) => { - const answerFromUser = value.trim(); - - if (answerFromUser === 'Yes') return answerFromUser; - - printMessage('\n\nCannot start the setup process if Captain is not installed.'); - - printMessageAndExit( - 'Please read tutorial on CaptainDuckDuck.com to learn how to install CaptainDuckDuck on a server.' - ); - } - }, - { - type: 'input', - default: SAMPLE_IP, - name: 'captainAddress', - message: 'Enter IP address of your captain server:', - filter: async (value: string) => { - const ipFromUser = value.trim(); - - if (ipFromUser === SAMPLE_IP || !isIpAddress(ipFromUser)) { - printError(`\nThis is an invalid IP Address: ${ipFromUser}`, true); - } - - try { - // login using captain42. and set the ipAddressToServer - const data = await LoginApi.loginMachine(`http://${ipFromUser}:3000`, DEFAULT_PASSWORD); - - SystemApi.setIpAddressOfServer(ipFromUser); - - // All went well - if (data) return ipFromUser; - } catch (e) { - errorHandler(e); - } - } - }, - { - type: 'password', - name: 'captainOriginalPassword', - message: 'Enter your current password:', - when: () => !LoginApi.token, - filter: async (value: string) => { - try { - const captainPasswordFromUser = value.trim(); - const data = await LoginApi.loginMachine( - `http://${SystemApi.ipAddressOfServer}:3000`, - captainPasswordFromUser - ); - - if (data) { - SystemApi.setIpAddressOfServer(captainPasswordFromUser); - - LoginApi.setOldPassword(captainPasswordFromUser); - } - } catch (e) { - errorHandler(e); - } - } - }, - { - type: 'input', - name: 'captainRootDomain', - message: - 'Enter a root domain for this Captain server. For example, enter test.yourdomain.com if you' + - ' setup your DNS to point *.test.yourdomain.com to ip address of your server' + - ': ', - filter: async (value: string) => { - try { - const captainRootDomainFromUser = value.trim(); - const data = await SystemApi.setCustomDomain( - `http://${SystemApi.ipAddressOfServer}:3000`, - captainRootDomainFromUser - ); - - if (data) { - const newCustomDomainFromUser = `captain.${captainRootDomainFromUser}`; - - SystemApi.setCustomDomainFromUser(newCustomDomainFromUser); - - return captainRootDomainFromUser; - } - } catch (e) { - errorHandler(e); - } - } - }, - { - type: 'input', - name: 'emailAddress', - message: "Enter your 'valid' email address to enable HTTPS: ", - filter: async (value: string) => { - try { - const emailAddressFromUser = value.trim(); - const { customDomainFromUser } = SystemApi; - - await SystemApi.enableHttps(`http://${customDomainFromUser}`, emailAddressFromUser); - - const data = await SystemApi.forceHttps(`https://${customDomainFromUser}`); - - if (data) return emailAddressFromUser; - } catch (e) { - errorHandler(e); - } - } - }, - { - type: 'password', - name: 'newPasswordFirstTry', - message: 'Enter a new password:', - filter: (value: string) => { - newPasswordFirstTry = value; - - return value; - } - }, - { - type: 'password', - name: 'newPassword', - message: 'Enter a new password:', - filter: async (value: string) => { - const { customDomainFromUser } = SystemApi; - - try { - const confirmPasswordValueFromUser = value; - const machineUrl = `https://${customDomainFromUser}`; - - if (newPasswordFirstTry !== confirmPasswordValueFromUser) { - printError('Passwords do not match', true); - } - - const changePassData = await LoginApi.changePass(machineUrl, confirmPasswordValueFromUser); - - if (changePassData) { - const loginData = await LoginApi.login(machineUrl, confirmPasswordValueFromUser); - - if (loginData) return; - } - } catch (e) { - printError('\nIMPORTANT!! Server setup is completed by password is not changed.'); - - printError('\nYou CANNOT use serversetup anymore. To continue:'); - - printError( - `\n- Go to https://${customDomainFromUser} login with default password and change the password in settings.` - ); - - printError( - `\n- In terminal (here), type captainduckduck login and enter this as your root domain: ${customDomainFromUser}`, - true - ); - } - } - }, - { - type: 'input', - name: 'captainName', - message: 'Enter a name for this Captain machine:', - default: findDefaultCaptainName(), - validate: (value: string) => { - const newMachineName = value.trim(); - - MachineHelper.getMachines().map( - (machine) => - machine.name === newMachineName && - `${newMachineName} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.` - ); - - if (value.match(/^[-\d\w]+$/i)) { - return true; - } - - return 'Please enter a Captain Name.'; - } - } -]; - -async function serversetup() { - printMessage('\nSetup your Captain server\n'); - - const answers = await inquirer.prompt(questions); - const captainAddress = `https://${SystemApi.customDomainFromUser}`; - const newMachine = { - authToken: LoginApi.token, - baseUrl: captainAddress, - name: answers.captainName - }; - - MachineHelper.addMachine(newMachine); - - printMessage(`\n\nCaptain is available at ${captainAddress}`); - - printMessage('\nFor more details and docs see http://www.captainduckduck.com\n\n'); -} - -export = serversetup; diff --git a/app-cli/src/helpers/MachineHelper.ts b/app-cli/src/helpers/MachineHelper.ts deleted file mode 100644 index 8d26b1d..0000000 --- a/app-cli/src/helpers/MachineHelper.ts +++ /dev/null @@ -1,117 +0,0 @@ -import { IMachine, IApp } from '../models/IModels'; - -const { printMessage } = require('../utils/messageHandler'); -const configstore = require('configstore'); -const packagejson = require('../../package.json'); -const configs = new configstore(packagejson.name, { - captainMachines: [] -}); - -class MachineHelper { - private machines: IMachine[]; - private apps: IApp[]; - constructor() { - this.machines = configs.get('captainMachines'); - - this.apps = configs.get('apps'); - } - - getMachinesAsOptions() { - const firstItemInOption = [ - { - name: '-- CANCEL --', - value: '', - short: '' - } - ]; - const listOfMachines = this.machines.map((machine) => { - return { - name: `${machine.name} at ${machine.baseUrl}`, - value: `${machine.name}`, - short: `${machine.name} at ${machine.baseUrl}` - }; - }); - - return [ ...firstItemInOption, ...listOfMachines ]; - } - - getMachines() { - return this.machines; - } - - getApps() { - return this.apps; - } - - setMachines(newMachines: IMachine[]) { - this.machines = newMachines; - - configs.set('captainMachines', newMachines); - } - - updateMachineAuthToken(machineName: string, authToken: string) { - let updatedMachine: IMachine; - const newMachines = this.machines.map((machine) => { - if (machine.name === machineName) { - updatedMachine = { - ...machine, - authToken - }; - - return updatedMachine; - } - - return machine; - }); - - this.setMachines(newMachines); - - this.updateAppsAuthToken(updatedMachine!); - } - - updateAppsAuthToken(updatedMachine: IMachine) { - if (!updatedMachine) return; - - const newApps = this.apps.map((app) => { - if (app.machineToDeploy.name === updatedMachine.name) { - return { - ...app, - machineToDeploy: updatedMachine - }; - } - - return app; - }); - - this.setApps(newApps); - } - - setApps(newApps: IApp[]) { - this.apps = newApps; - - configs.set('apps', newApps); - } - - addMachine(newMachine: IMachine) { - const tempMachines = this.machines; - const newMachines = [ ...tempMachines, newMachine ]; - - // Add to local storage - configs.set('captainMachines', newMachines); - - this.setMachines(configs.get('captainMachines')); - } - - logoutMachine(machineName: string) { - const removedMachine = this.machines.filter((machine) => machine.name === machineName)[0]; - const newMachines = this.machines.filter((machine) => machine.name !== machineName); - - this.setMachines(newMachines); - - printMessage(`You are now logged out from ${removedMachine.name} at ${removedMachine.baseUrl}...\n`); - } -} - -const instance = new MachineHelper(); - -export default instance; diff --git a/app-cli/src/models/AppDef.ts b/app-cli/src/models/AppDef.ts new file mode 100644 index 0000000..1e08352 --- /dev/null +++ b/app-cli/src/models/AppDef.ts @@ -0,0 +1,93 @@ +//COPIED FROM BACKEND CODE +interface IHashMapGeneric { + [id: string]: T; + } + + type IAllAppDefinitions = IHashMapGeneric; + + export interface IAppEnvVar { + key: string; + value: string; + } + + interface IAppVolume { + containerPath: string; + volumeName?: string; + hostPath?: string; + } + + interface IAppPort { + containerPort: number; + hostPort: number; + protocol?: "udp" | "tcp"; + + publishMode?: "ingress" | "host"; + } + + export interface RepoInfo { + repo: string; + branch: string; + user: string; + password: string; + } + + interface RepoInfoEncrypted { + repo: string; + branch: string; + user: string; + passwordEncrypted: string; + } + + export interface IAppVersion { + version: number; + deployedImageName?: string; // empty if the deploy is not completed + timeStamp: string; + gitHash: string | undefined; + } + + interface IAppCustomDomain { + publicDomain: string; + hasSsl: boolean; + } + + interface IAppDefinitionBase { + deployedVersion: number; + notExposeAsWebApp: boolean; + hasPersistentData: boolean; + hasDefaultSubDomainSsl: boolean; + + forceSsl: boolean; + nodeId?: string; + instanceCount: number; + preDeployFunction?: string; + customNginxConfig?: string; + networks: string[]; + customDomain: IAppCustomDomain[]; + + ports: IAppPort[]; + volumes: IAppVolume[]; + envVars: IAppEnvVar[]; + + versions: IAppVersion[]; + } + + export interface IAppDef extends IAppDefinitionBase { + appPushWebhook?: { + repoInfo: RepoInfo; + tokenVersion?: string; // On FrontEnd, these values are null, until they are assigned. + pushWebhookToken?: string; // On FrontEnd, these values are null, until they are assigned. + }; + appName?: string; + isAppBuilding?: boolean; + } + + interface IAppDefSaved extends IAppDefinitionBase { + appPushWebhook: + | { + tokenVersion: string; + repoInfo: RepoInfoEncrypted; + pushWebhookToken: string; + } + | undefined; + } + \ No newline at end of file diff --git a/app-cli/src/models/ICaptainDefinition.ts b/app-cli/src/models/ICaptainDefinition.ts new file mode 100644 index 0000000..d11eda8 --- /dev/null +++ b/app-cli/src/models/ICaptainDefinition.ts @@ -0,0 +1,6 @@ +export interface ICaptainDefinition { + schemaVersion: number + dockerfileLines?: string[] + imageName?: string + templateId?: string +} diff --git a/app-cli/src/models/IHashMapGeneric.ts b/app-cli/src/models/IHashMapGeneric.ts new file mode 100644 index 0000000..28cfe92 --- /dev/null +++ b/app-cli/src/models/IHashMapGeneric.ts @@ -0,0 +1,3 @@ +export interface IHashMapGeneric { + [id: string]: T +} \ No newline at end of file diff --git a/app-cli/src/models/IOneClickAppModels.ts b/app-cli/src/models/IOneClickAppModels.ts new file mode 100644 index 0000000..a569ce1 --- /dev/null +++ b/app-cli/src/models/IOneClickAppModels.ts @@ -0,0 +1,36 @@ +import { IHashMapGeneric } from "./IHashMapGeneric"; + +export interface IOneClickAppIdentifier { + name: string; + download_url: string; +} + +export interface IOneClickVariable { + id: string; + label: string; + defaultValue?: string; + validRegex?: string; + description?: string; +} + +export interface IDockerComposeService { + image?: string; + dockerFileLines?: string[]; // This is our property, not DockerCompose. We use this instead of image if we need to extend the image. + volumes?: string[]; + ports?: string[]; + environment?: IHashMapGeneric; + depends_on?: string[]; +} + +export interface IOneClickTemplate { + captainVersion: number; + dockerCompose: { + version: string; + services: IHashMapGeneric; + }; + instructions: { + start: string; + end: string; + }; + variables: IOneClickVariable[]; +} \ No newline at end of file diff --git a/app-cli/src/models/IRegistryInfo.ts b/app-cli/src/models/IRegistryInfo.ts new file mode 100644 index 0000000..6413791 --- /dev/null +++ b/app-cli/src/models/IRegistryInfo.ts @@ -0,0 +1,20 @@ +export interface IRegistryApi { + registries: IRegistryInfo[]; + defaultPushRegistryId: string | undefined; +} + +export class IRegistryTypes { + static readonly LOCAL_REG = "LOCAL_REG"; + static readonly REMOTE_REG = "REMOTE_REG"; +} + +type IRegistryType = "LOCAL_REG" | "REMOTE_REG"; + +export interface IRegistryInfo { + id: string; + registryUser: string; + registryPassword: string; + registryDomain: string; + registryImagePrefix: string; + registryType: IRegistryType; +} diff --git a/app-cli/src/models/IVersionInfo.ts b/app-cli/src/models/IVersionInfo.ts new file mode 100644 index 0000000..1447414 --- /dev/null +++ b/app-cli/src/models/IVersionInfo.ts @@ -0,0 +1,5 @@ +export interface IVersionInfo { + currentVersion: string; + latestVersion: string; + canUpdate: boolean; +} diff --git a/app-cli/src/models/IModels.ts b/app-cli/src/models/storage/StoredObjects.ts similarity index 51% rename from app-cli/src/models/IModels.ts rename to app-cli/src/models/storage/StoredObjects.ts index 386ff21..8e48527 100644 --- a/app-cli/src/models/IModels.ts +++ b/app-cli/src/models/storage/StoredObjects.ts @@ -1,12 +1,19 @@ -export interface IApp { +export interface IMachine { + authToken: string; + baseUrl: string; + name: string; +} + +export interface IOldSavedApp { cwd: string; appName: string; branchToPush: string; machineToDeploy: IMachine; } -export interface IMachine { - name: string; - authToken: string; - baseUrl: string; +export interface IDeployedDirectory { + cwd: string; + appName: string; + branchToPush: string; + machineNameToDeploy: string; } diff --git a/app-cli/src/utils/CliHelper.ts b/app-cli/src/utils/CliHelper.ts new file mode 100644 index 0000000..4daf3a0 --- /dev/null +++ b/app-cli/src/utils/CliHelper.ts @@ -0,0 +1,40 @@ +import StorageHelper from './StorageHelper'; +import { IMachine } from '../models/storage/StoredObjects'; + +export default class CliHelper { + static instance: CliHelper; + + static get() { + if (!CliHelper.instance) CliHelper.instance = new CliHelper(); + return CliHelper.instance; + } + + findDefaultCaptainName() { + let currentSuffix = StorageHelper.get().getMachines().length + 1; + const self = this; + + while (!self.isSuffixValid(currentSuffix)) { + currentSuffix++; + } + + return self.getCaptainFullName(currentSuffix); + } + + getCaptainFullName(suffix: number) { + const formatSuffix = suffix < 10 ? `0${suffix}` : suffix; + + return `captain-${formatSuffix}`; + } + + isSuffixValid(suffixNumber: number) { + const self = this; + let valid = true; + StorageHelper.get().getMachines().map((machine: IMachine) => { + if (machine.name === self.getCaptainFullName(suffixNumber)) { + valid = false; + } + }); + + return valid; + } +} diff --git a/app-cli/src/utils/constants.ts b/app-cli/src/utils/Constants.ts similarity index 95% rename from app-cli/src/utils/constants.ts rename to app-cli/src/utils/Constants.ts index aa8b7e2..9c16d45 100644 --- a/app-cli/src/utils/constants.ts +++ b/app-cli/src/utils/Constants.ts @@ -5,7 +5,7 @@ const DEFAULT_BRANCH_TO_PUSH = "branchToPush" const DEFAULT_APP_NAME = "appName" const EMPTY_STRING = "" -export = { +export default { SAMPLE_DOMAIN, SAMPLE_IP, DEFAULT_PASSWORD, diff --git a/app-cli/src/utils/ErrorFactory.ts b/app-cli/src/utils/ErrorFactory.ts new file mode 100644 index 0000000..da3b319 --- /dev/null +++ b/app-cli/src/utils/ErrorFactory.ts @@ -0,0 +1,34 @@ + +class ErrorFactory { + public readonly OKAY = 100; + public readonly OKAY_BUILD_STARTED = 101; + + public readonly STATUS_ERROR_GENERIC = 1000; + public readonly STATUS_ERROR_CAPTAIN_NOT_INITIALIZED = 1001; + public readonly STATUS_ERROR_USER_NOT_INITIALIZED = 1101; + public readonly STATUS_ERROR_NOT_AUTHORIZED = 1102; + public readonly STATUS_ERROR_ALREADY_EXIST = 1103; + public readonly STATUS_ERROR_BAD_NAME = 1104; + public readonly STATUS_WRONG_PASSWORD = 1105; + public readonly STATUS_AUTH_TOKEN_INVALID = 1106; + public readonly VERIFICATION_FAILED = 1107; + + public readonly UNKNOWN_ERROR = 1999; + + constructor() {} + + createError(status: number, message: string) { + let e = new Error(message) as any; + e.captainStatus = status; + e.captainMessage = message; + return e; + } + + eatUpPromiseRejection() { + return function(error: any) { + // nom nom + }; + } +} + +export default new ErrorFactory(); diff --git a/app-cli/src/utils/Logger.ts b/app-cli/src/utils/Logger.ts new file mode 100644 index 0000000..cde15bf --- /dev/null +++ b/app-cli/src/utils/Logger.ts @@ -0,0 +1,15 @@ +export default class Logger { + static log(s: string) { + console.log(s); + } + + static error(s: any) { + console.error(s); + } + + static dev(s: string) { + if (process.env.CLI_IS_DEBUG) { + console.log(">>> ", s); + } + } +} diff --git a/app-cli/src/helpers/SpinnerHelper.ts b/app-cli/src/utils/SpinnerHelper.ts similarity index 89% rename from app-cli/src/helpers/SpinnerHelper.ts rename to app-cli/src/utils/SpinnerHelper.ts index 520b776..e2db6d4 100644 --- a/app-cli/src/helpers/SpinnerHelper.ts +++ b/app-cli/src/utils/SpinnerHelper.ts @@ -24,4 +24,4 @@ class SpinnerHelper { } } -module.exports = new SpinnerHelper(); +export default SpinnerHelper; diff --git a/app-cli/src/utils/StdOutUtil.ts b/app-cli/src/utils/StdOutUtil.ts new file mode 100644 index 0000000..b798cf3 --- /dev/null +++ b/app-cli/src/utils/StdOutUtil.ts @@ -0,0 +1,39 @@ +const chalk = require('chalk'); +class StdOutUtils { + printMessage(message: string) { + console.log(message); + } + + printMessageAndExit(message: string) { + console.log(message); + + process.exit(0); + } + + printGreenMessage(message: string, exit = false) { + console.log(`${chalk.green(message)}`); + + exit && process.exit(0); + } + + printMagentaMessage(message: string, exit = false) { + console.log(`${chalk.magenta(message)}`); + + exit && process.exit(0); + } + + printError(error: string, exit = false) { + console.log(`${chalk.bold.red(error)}`); + + exit && process.exit(0); + } + + errorHandler(error: any) { + if (error.status) { + this.printError(`\nError: ${error.status}\nError: ${error.description}`, true); + } else { + this.printError(`\nError: ${error}`, true); + } + } +} +export default new StdOutUtils(); diff --git a/app-cli/src/utils/StorageHelper.ts b/app-cli/src/utils/StorageHelper.ts new file mode 100644 index 0000000..f8f0522 --- /dev/null +++ b/app-cli/src/utils/StorageHelper.ts @@ -0,0 +1,68 @@ +import { IMachine, IDeployedDirectory } from '../models/storage/StoredObjects'; +import * as ConfigStore from 'configstore'; +import Utils from './Utils'; + +const CAP_MACHINES = 'CapMachines'; +const DEPLOYED_DIRS = 'DeployedDirs'; + +export default class StorageHelper { + static instance: StorageHelper; + + static get() { + if (!StorageHelper.instance) StorageHelper.instance = new StorageHelper(); + return StorageHelper.instance; + } + + private data: ConfigStore; + + constructor() { + this.data = new ConfigStore('new-captainduckduck'); + // migrate data! TODO + } + + getMachines(): IMachine[] { + return Utils.copyObject(this.data.get(CAP_MACHINES) || []); + } + + saveMachine(machineToSaveOrUpdate: IMachine) { + const currMachines = this.getMachines(); + let updatedMachine = false; + for (let index = 0; index < currMachines.length; index++) { + const element = currMachines[index]; + if (element.name === machineToSaveOrUpdate.name) { + updatedMachine = true; + currMachines[index] = machineToSaveOrUpdate; + break; + } + } + + if (!updatedMachine) { + currMachines.push(machineToSaveOrUpdate); + } + + this.data.set(CAP_MACHINES, currMachines); + } + + getDeployedDirectories(): IDeployedDirectory[] { + return Utils.copyObject(this.data.get(DEPLOYED_DIRS) || []); + } + + saveDeployedDirectory(directoryToSaveOrUpdate: IDeployedDirectory) { + const currDirs = this.getDeployedDirectories(); + let updatedDir = false; + for (let index = 0; index < currDirs.length; index++) { + const element = currDirs[index]; + if (element.cwd === directoryToSaveOrUpdate.cwd) { + updatedDir = true; + currDirs[index] = directoryToSaveOrUpdate; + break; + } + } + + if (!updatedDir) { + currDirs.push(directoryToSaveOrUpdate); + } + + this.data.set(DEPLOYED_DIRS, currDirs); + } +} diff --git a/app-cli/src/utils/Utils.ts b/app-cli/src/utils/Utils.ts new file mode 100644 index 0000000..3000fb7 --- /dev/null +++ b/app-cli/src/utils/Utils.ts @@ -0,0 +1,41 @@ +export default { + copyObject(obj: T): T { + return JSON.parse(JSON.stringify(obj)) as T; + }, + + generateUuidV4() { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { + var r = (Math.random() * 16) | 0, + v = c === 'x' ? r : (r & 0x3) | 0x8; + return v.toString(16); + }); + }, + + getAnsiColorRegex() { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, 'g'); + }, + + cleanUpUrl(urlInput: string) { + if (!urlInput || !urlInput.length) return null; + + let cleanedUrl = urlInput; + + if (cleanedUrl.indexOf('#') >= 0) cleanedUrl = cleanedUrl.substr(0, cleanedUrl.indexOf('#')); + + const hasSlashAtTheEnd = cleanedUrl.substr(cleanedUrl.length - 1, 1) === '/'; + + if (hasSlashAtTheEnd) { + // Remove the slash at the end + cleanedUrl = cleanedUrl.substr(0, cleanedUrl.length - 1); + } + + cleanedUrl = cleanedUrl.replace('http://', '').replace('https://', '').trim(); + + return cleanedUrl; + } +}; diff --git a/app-cli/src/utils/__tests__/loginHelpers.test.js b/app-cli/src/utils/__tests__/loginHelpers.test.js deleted file mode 100644 index 92c14e8..0000000 --- a/app-cli/src/utils/__tests__/loginHelpers.test.js +++ /dev/null @@ -1,47 +0,0 @@ -const { - cleanUpUrl, - findDefaultCaptainName, - getCaptainFullName -} = require("../loginHelpers") - -jest.mock("../../helpers/MachineHelper", () => { - return { - machines: [ - { - baseUrl: "https://captain.myfirstmachine.com", - name: "machine-01", - authToken: "token1" - }, - { - baseUrl: "https://captain.mysecondmachine.com", - name: "machine-02", - authToken: "token2" - } - ] - } -}) - -describe("Login helpers", () => { - it("should clean a url", () => { - const mockUrl = "https://www.google.com" - const expectedResult = "www.google.com" - const result = cleanUpUrl(mockUrl) - - expect(result).toBe(expectedResult) - }) - - it("should get a captain machine name", () => { - const result = getCaptainFullName(1) - const expectedResult = "captain-01" - - expect(result).toBe(expectedResult) - }) - - it("should find an unused name for a possible new captain machine", () => { - // If machines are 2, then it should be with suffix 03 - const result = findDefaultCaptainName() - const expectedResult = "captain-03" - - expect(result).toBe(expectedResult) - }) -}) diff --git a/app-cli/src/utils/__tests__/machineUtils.test.js b/app-cli/src/utils/__tests__/machineUtils.test.js deleted file mode 100644 index f1246fa..0000000 --- a/app-cli/src/utils/__tests__/machineUtils.test.js +++ /dev/null @@ -1,71 +0,0 @@ -const { - initMachineFromLocalStorage, - saveMachineToLocalStorage -} = require("../machineUtils") -const DeployApi = require("../../api/DeployApi") -const MachineHelper = require("../../helpers/MachineHelper") -const mockUpdatedApps = [ - { - cwd: process.cwd(), - appName: "captain-node-app-new-name", - branchToPush: "master", - machineToDeploy: { - baseUrl: "https://int-test.captainduckduck.com", - name: "int-test", - authToken: "token1" - } - } -] - -jest.mock("../../helpers/MachineHelper", () => { - return { - apps: [ - { - cwd: process.cwd(), - appName: "captain-node-app", - branchToPush: "master", - machineToDeploy: { - baseUrl: "https://int-test.captainduckduck.com", - name: "int-test", - authToken: "token1" - } - } - ], - setApps: jest.fn() - } -}) - -jest.mock("../../api/DeployApi", () => { - return { - setMachineToDeploy: jest.fn(), - setAppName: jest.fn(), - setBranchToPush: jest.fn(), - appName: "captain-node-app-new-name", - branchToPush: "master", - machineToDeploy: { - baseUrl: "https://int-test.captainduckduck.com", - name: "int-test", - authToken: "token1" - } - } -}) - -describe("Machine utils", () => { - it("should init machine from localStorage", () => { - initMachineFromLocalStorage() - - expect(DeployApi.setMachineToDeploy).toHaveBeenCalledTimes(1) - - expect(DeployApi.setAppName).toHaveBeenCalledTimes(1) - - expect(DeployApi.setBranchToPush).toHaveBeenCalledTimes(1) - }) - - it("should update an app from localstorage", () => { - saveMachineToLocalStorage() - - const updatedApps = mockUpdatedApps - - expect(MachineHelper.setApps).toBeCalledWith(updatedApps) - }) -}) diff --git a/app-cli/src/utils/__tests__/validationsHandler.test.js b/app-cli/src/utils/__tests__/validationsHandler.test.js deleted file mode 100644 index 5b24050..0000000 --- a/app-cli/src/utils/__tests__/validationsHandler.test.js +++ /dev/null @@ -1,92 +0,0 @@ -const { - validateIsGitRepository, - validateDefinitionFile, - optionIsNotGiven, - isIpAddress, - validateAuthentication -} = require("../validationsHandler") -const { printError } = require("../messageHandler") -const { requestLogin } = require("../../commands/login") -const { initMachineFromLocalStorage } = require("../machineUtils") - -jest.mock("fs") - -jest.mock("../messageHandler", () => { - return { - printError: jest.fn() - } -}) - -jest.mock("../../api/DeployApi", () => { - return { - isAuthTokenValid: jest.fn(() => false) // Simulates it's not authenticated - } -}) - -jest.mock("../../commands/login", () => { - return { - requestLogin: jest.fn() - } -}) - -jest.mock("../machineUtils", () => { - return { - initMachineFromLocalStorage: jest.fn() - } -}) - -describe("Validations handler", () => { - it("should printError if not on a git repository", () => { - validateIsGitRepository() - - expect(printError).toHaveBeenCalledTimes(1) - }) - - it("should printError if there is no captain definition file", () => { - validateDefinitionFile() - - // 2nd time because file was not found - // 3rd time because it tried to read from a file and was not valid json - expect(printError).toHaveBeenCalledTimes(3) - }) - - it("should return false if the option is included", () => { - const options = { - branch: "master" - } - const result = optionIsNotGiven(options, "branch") - - expect(result).toBe(false) - }) - - it("should return true if the option is not given", () => { - const options = { - test: "something" - } - const result = optionIsNotGiven(options, "branch") - - expect(result).toBe(true) - }) - - it("should be a valid IP Address", () => { - const validIpAddress = "192.168.1.1" - const result = isIpAddress(validIpAddress) - - expect(result).toBe(true) - }) - - it("should be an invalid IP Address", () => { - const validIpAddress = "192.168.1" - const result = isIpAddress(validIpAddress) - - expect(result).toBe(false) - }) - - it("should promt the login option and initialize from the machine in localstorage", async () => { - await validateAuthentication() - - expect(requestLogin).toBeCalledTimes(1) - - expect(initMachineFromLocalStorage).toBeCalledTimes(1) - }) -}) diff --git a/app-cli/src/utils/fileHelper.ts b/app-cli/src/utils/fileHelper.ts deleted file mode 100644 index 3817549..0000000 --- a/app-cli/src/utils/fileHelper.ts +++ /dev/null @@ -1,169 +0,0 @@ -const { printMessage, printError, printGreenMessage, printMagentaMessage } = require('./messageHandler'); -const SpinnerHelper = require('../helpers/SpinnerHelper'); -import { exec } from 'child_process'; -import * as fs from 'fs-extra'; -const ProgressBar = require('progress'); -const DeployApi = require('../api/DeployApi'); -const { saveMachineToLocalStorage } = require('../utils/machineUtils'); -let lastLineNumberPrinted = -10000; // we want to show all lines to begin with! - -interface ILogInfo { - isAppBuilding: boolean; - isBuildFailed: boolean; - logs: { - firstLineNumber: number; - lines: string[]; - }; -} - -function gitArchiveFile(zipFileFullPath: string, branchToPush: string) { - exec(`git archive --format tar --output "${zipFileFullPath}" ${branchToPush}`, (err, stdout, stderr) => { - if (err) { - printError(`TAR file failed\n${err}\n`); - - fs.removeSync(zipFileFullPath); - - return; - } - - exec(`git rev-parse ${branchToPush}`, (err, stdout, stderr) => { - const gitHash = (stdout || '').trim(); - - if (err || !/^[a-f0-9]{40}$/.test(gitHash)) { - printError(`Cannot find hash of last commit on this branch: ${branchToPush}\n${gitHash}\n${err}\n`); - - return; - } - - printMessage(`Pushing last commit on ${branchToPush}: ${gitHash}`); - - uploadFile(zipFileFullPath, gitHash); - }); - }); -} - -function onLogRetrieved(data: ILogInfo) { - if (data) { - const lines = data.logs.lines; - const firstLineNumberOfLogs = data.logs.firstLineNumber; - let firstLinesToPrint = 0; - - if (firstLineNumberOfLogs > lastLineNumberPrinted) { - if (firstLineNumberOfLogs < 0) { - // This is the very first fetch, probably firstLineNumberOfLogs is around -50 - firstLinesToPrint = -firstLineNumberOfLogs; - } else { - printMessage('[[ TRUNCATED ]]'); - } - } else { - firstLinesToPrint = lastLineNumberPrinted - firstLineNumberOfLogs; - } - - lastLineNumberPrinted = firstLineNumberOfLogs + lines.length; - - for (let i = firstLinesToPrint; i < lines.length; i++) { - printMessage((lines[i] || '').trim()); - } - } - - const finishedBuilding = data && !data.isAppBuilding; - - if (finishedBuilding) { - if (!data.isBuildFailed) { - printGreenMessage(`Deployed successfully: ${DeployApi.appName}`); - - printMagentaMessage(`App is available at ${DeployApi.appUrl}\n`, true); - } else { - printError(`\nSomething bad happened. Cannot deploy "${DeployApi.appName}"\n`, true); - } - } - - setTimeout(() => { - startFetchingBuildLogs(); - }, 2000); -} - -async function startFetchingBuildLogs() { - try { - const data = await DeployApi.fetchBuildLogs(); - const response = JSON.parse(data); - - if (response.status !== 100) { - throw new Error(JSON.stringify(response, null, 2)); - } - onLogRetrieved(response.data); - } catch (error) { - printError(`\nSomething while retrieving app build logs.. ${error}\n`); - - // onLogRetrieved() // TODO - should this be here? - } -} - -function getFileStream(zipFileFullPath: string) { - const fileSize = fs.statSync(zipFileFullPath).size; - const fileStream = fs.createReadStream(zipFileFullPath); - const barOpts = { - width: 20, - total: fileSize, - clear: true - }; - const bar = new ProgressBar(' uploading [:bar] :percent (ETA :etas)', barOpts); - - fileStream.on('data', (chunk) => { - bar.tick(chunk.length); - }); - - fileStream.on('end', () => { - printMessage('This might take several minutes. PLEASE BE PATIENT...'); - - SpinnerHelper.start('Building your source code...'); - - SpinnerHelper.setColor('yellow'); - }); - - return fileStream; -} - -async function uploadFile(filePath: string, gitHash: string) { - try { - printMessage(`Uploading file to ${DeployApi.machineToDeploy.baseUrl}`); - - const fileStream = getFileStream(filePath); - const response = await DeployApi.sendFile(fileStream, gitHash); - const data = JSON.parse(response); - const somethingWentWrong = data.status !== 100 && data.status !== 101; - const isDeployedAndBuilding = data.status === 101; - const isDeployedSuccessfully = data.status === 100; - - if (somethingWentWrong) { - throw new Error(JSON.stringify(data, null, 2)); - } - - deleteFileFromDisk(filePath); // Uncomment this - - // Save app to local storage - saveMachineToLocalStorage(); - - if (isDeployedAndBuilding) { - startFetchingBuildLogs(); - } - - if (isDeployedSuccessfully) { - printGreenMessage(`Deployed successfully: ${DeployApi.appName}\n`, true); - } - } catch (e) { - printError(e.message, true); - } -} - -function deleteFileFromDisk(filePath: string) { - if (fs.pathExistsSync(filePath)) { - fs.removeSync(filePath); - } -} -export = { - gitArchiveFile, - getFileStream, - uploadFile, - startFetchingBuildLogs -}; diff --git a/app-cli/src/utils/loginHelpers.ts b/app-cli/src/utils/loginHelpers.ts deleted file mode 100644 index 2be1d38..0000000 --- a/app-cli/src/utils/loginHelpers.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { IMachine } from '../models/IModels'; -import MachineHelper from '../helpers/MachineHelper'; - -function cleanUpUrl(url: string) { - if (!url || !url.length) return null; - - let cleanedUrl = url; - const hasSlashAtTheEnd = url.substr(url.length - 1, 1) === '/'; - - if (hasSlashAtTheEnd) { - // Remove the slash at the end - cleanedUrl = url.substr(0, url.length - 1); - } - - return cleanedUrl.replace('http://', '').replace('https://', '').trim(); -} - -function findDefaultCaptainName() { - let currentSuffix = MachineHelper.getMachines().length + 1; - - while (!isSuffixValid(currentSuffix)) { - currentSuffix++; - } - - return getCaptainFullName(currentSuffix); -} - -function getCaptainFullName(suffix: number) { - const formatSuffix = suffix < 10 ? `0${suffix}` : suffix; - - return `captain-${formatSuffix}`; -} - -const isSuffixValid = (suffixNumber: number) => - MachineHelper.getMachines().map((machine: IMachine) => { - machine.name !== getCaptainFullName(suffixNumber); - }); - -export = { - cleanUpUrl, - findDefaultCaptainName, - isSuffixValid, - getCaptainFullName -}; diff --git a/app-cli/src/utils/machineUtils.ts b/app-cli/src/utils/machineUtils.ts deleted file mode 100644 index f85691b..0000000 --- a/app-cli/src/utils/machineUtils.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { IApp } from '../models/IModels'; - -const DeployApi = require('../api/DeployApi'); -import MachineHelper from '../helpers/MachineHelper'; - -function initMachineFromLocalStorage() { - const possibleApp = MachineHelper.getApps().find((app: IApp) => app.cwd === process.cwd()); - - if (possibleApp) { - DeployApi.setMachineToDeploy(possibleApp.machineToDeploy); - - DeployApi.setAppName(possibleApp.appName); - - DeployApi.setBranchToPush(possibleApp.branchToPush); - } -} - -// Saves the app directory into local storage -function saveMachineToLocalStorage() { - const apps = MachineHelper.getApps(); - const currentDirectory = process.cwd(); - let appExists = false; - // Update app - const updatedApps = apps.map((app: IApp) => { - if (app.cwd === currentDirectory) { - appExists = true; - - return { - cwd: app.cwd, - appName: DeployApi.appName, - branchToPush: DeployApi.branchToPush, - machineToDeploy: DeployApi.machineToDeploy - }; - } - - return app; - }); - - MachineHelper.setApps(updatedApps); - - if (!appExists) { - const newApp = { - cwd: process.cwd(), - appName: DeployApi.appName, - branchToPush: DeployApi.branchToPush, - machineToDeploy: DeployApi.machineToDeploy - }; - - updatedApps.push(newApp); - - MachineHelper.setApps(apps); - } -} - -export = { - initMachineFromLocalStorage, - saveMachineToLocalStorage -}; diff --git a/app-cli/src/utils/messageHandler.ts b/app-cli/src/utils/messageHandler.ts deleted file mode 100644 index 74fd4c3..0000000 --- a/app-cli/src/utils/messageHandler.ts +++ /dev/null @@ -1,46 +0,0 @@ -const chalk = require('chalk'); - -function printMessage(message: string) { - console.log(message); -} - -function printMessageAndExit(message: string) { - console.log(message); - - process.exit(0); -} - -function printGreenMessage(message: string, exit = false) { - console.log(`${chalk.green(message)}`); - - exit && process.exit(0); -} - -function printMagentaMessage(message: string, exit = false) { - console.log(`${chalk.magenta(message)}`); - - exit && process.exit(0); -} - -function printError(error: string, exit = false) { - console.log(`${chalk.bold.red(error)}`); - - exit && process.exit(0); -} - -function errorHandler(error: any) { - if (error.status) { - printError(`\nError: ${error.status}\nError: ${error.description}`, true); - } else { - printError(`\nError: ${error}`, true); - } -} - -export = { - printMessage, - printMessageAndExit, - printError, - printGreenMessage, - printMagentaMessage, - errorHandler -}; diff --git a/app-cli/src/utils/validationsHandler.ts b/app-cli/src/utils/validationsHandler.ts deleted file mode 100644 index 0b7a955..0000000 --- a/app-cli/src/utils/validationsHandler.ts +++ /dev/null @@ -1,94 +0,0 @@ -const fs = require('fs-extra'); -const DeployApi = require('../api/DeployApi'); -const { printError } = require('./messageHandler'); -const { requestLogin } = require('../commands/login'); -const { initMachineFromLocalStorage } = require('../utils/machineUtils'); - -export function validateIsGitRepository() { - const gitFolderExists = fs.pathExistsSync('./.git'); - - if (!gitFolderExists) { - printError( - '\n**** ERROR: You are not in a git root directory. This command will only deploys the current directory ****\n', - true - ); - } -} - -export function validateDefinitionFile() { - const captainDefinitionExists = fs.pathExistsSync('./captain-definition'); - - if (!captainDefinitionExists) { - printError('\n**** ERROR: captain-definition file cannot be found. Please see docs! ****\n', true); - } - - const contents = fs.readFileSync('./captain-definition', 'utf8'); - let contentsJson = null; - - try { - contentsJson = JSON.parse(contents); - } catch (e) { - printError(`**** ERROR: captain-definition file is not a valid JSON! ****\n Error:${e}`, true); - } - - if (contentsJson) { - if (!contentsJson.schemaVersion) { - printError('**** ERROR: captain-definition needs schemaVersion. Please see docs! ****', true); - } - - if (!contentsJson.templateId && !contentsJson.dockerfileLines) { - printError( - '**** ERROR: captain-definition needs templateId or dockerfileLines. Please see docs! ****', - true - ); - } - - if (contentsJson.templateId && contentsJson.dockerfileLines) { - printError( - '**** ERROR: captain-definition needs templateId or dockerfileLines, NOT BOTH! Please see docs! ****', - true - ); - } - } -} - -// Only show that question if there is no option given as argument -export function optionIsNotGiven(allOptions: { [id: string]: any }, option: string) { - // console.log(allOptions) - if (allOptions[option]) { - return false; - } - - return true; -} - -export function isIpAddress(ipaddress: string) { - if ( - /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test( - ipaddress - ) - ) { - return true; - } - - return false; -} - -export async function validateAuthentication() { - // 1. Check if valid auth - const isAuthenticated = await DeployApi.isAuthTokenValid(); - - // 2. Request login - // 3. Login - // 4. Update token - if (!isAuthenticated) { - const loggedInStatus = await requestLogin(); - - // Refresh token in DeployApi - initMachineFromLocalStorage(); - - return loggedInStatus; - } else { - return Boolean(isAuthenticated); - } -} diff --git a/app-cli/yarn.lock b/app-cli/yarn.lock new file mode 100644 index 0000000..3888fe9 --- /dev/null +++ b/app-cli/yarn.lock @@ -0,0 +1,5865 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.0.0-beta.35": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" + integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== + dependencies: + "@babel/highlight" "^7.0.0" + +"@babel/highlight@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" + integrity sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw== + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^4.0.0" + +"@types/bluebird@*": + version "3.5.25" + resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.25.tgz#59188b871208092e37767e4b3d80c3b3eaae43bd" + integrity sha512-yfhIBix+AIFTmYGtkC0Bi+XGjSkOINykqKvO/Wqdz/DuXlAKK7HmhLAXdPIGsV4xzKcL3ev/zYc4yLNo+OvGaw== + +"@types/caseless@*": + version "0.12.1" + resolved "https://registry.yarnpkg.com/@types/caseless/-/caseless-0.12.1.tgz#9794c69c8385d0192acc471a540d1f8e0d16218a" + integrity sha512-FhlMa34NHp9K5MY1Uz8yb+ZvuX0pnvn3jScRSNAb75KHGB8d3rEU6hqMs3Z2vjuytcMfRg6c5CHMc3wtYyD2/A== + +"@types/configstore@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@types/configstore/-/configstore-4.0.0.tgz#cb718f9507e9ee73782f40d07aaca1cd747e36fa" + integrity sha512-SvCBBPzOIe/3Tu7jTl2Q8NjITjLmq9m7obzjSyb8PXWWZ31xVK6w4T6v8fOx+lrgQnqk3Yxc00LDolFsSakKCA== + +"@types/form-data@*": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@types/form-data/-/form-data-2.2.1.tgz#ee2b3b8eaa11c0938289953606b745b738c54b1e" + integrity sha512-JAMFhOaHIciYVh8fb5/83nmuO/AHwmto+Hq7a9y8FzLDcC1KCU344XDOMEmahnrTFlHjgh4L0WJFczNIX2GxnQ== + dependencies: + "@types/node" "*" + +"@types/fs-extra@^5.0.4": + version "5.0.4" + resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-5.0.4.tgz#b971134d162cc0497d221adde3dbb67502225599" + integrity sha512-DsknoBvD8s+RFfSGjmERJ7ZOP1HI0UZRA3FSI+Zakhrc/Gy26YQsLI+m5V5DHxroHRJqCDLKJp7Hixn8zyaF7g== + dependencies: + "@types/node" "*" + +"@types/inquirer@^0.0.43": + version "0.0.43" + resolved "https://registry.yarnpkg.com/@types/inquirer/-/inquirer-0.0.43.tgz#1eb0bbb4648e6cc568bd396c1e989f620ad01273" + integrity sha512-xgyfKZVMFqE8aIKy1xfFVsX2MxyXUNgjgmbF6dRbR3sL+ZM5K4ka/9L4mmTwX8eTeVYtduyXu0gUVwVJa1HbNw== + dependencies: + "@types/rx" "*" + "@types/through" "*" + +"@types/node@*", "@types/node@^10.12.18": + version "10.12.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" + integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== + +"@types/request-promise@^4.1.42": + version "4.1.42" + resolved "https://registry.yarnpkg.com/@types/request-promise/-/request-promise-4.1.42.tgz#a70a6777429531e60ed09faa077ead9b995204cd" + integrity sha512-b8li55sEZ00BXZstZ3d8WOi48dnapTqB1VufEG9Qox0nVI2JVnTVT1Mw4JbBa1j+1sGVX/qJ0R4WDv4v2GjT0w== + dependencies: + "@types/bluebird" "*" + "@types/request" "*" + +"@types/request@*": + version "2.48.1" + resolved "https://registry.yarnpkg.com/@types/request/-/request-2.48.1.tgz#e402d691aa6670fbbff1957b15f1270230ab42fa" + integrity sha512-ZgEZ1TiD+KGA9LiAAPPJL68Id2UWfeSO62ijSXZjFJArVV+2pKcsVHmrcu+1oiE3q6eDGiFiSolRc4JHoerBBg== + dependencies: + "@types/caseless" "*" + "@types/form-data" "*" + "@types/node" "*" + "@types/tough-cookie" "*" + +"@types/rx-core-binding@*": + version "4.0.4" + resolved "https://registry.yarnpkg.com/@types/rx-core-binding/-/rx-core-binding-4.0.4.tgz#d969d32f15a62b89e2862c17b3ee78fe329818d3" + integrity sha512-5pkfxnC4w810LqBPUwP5bg7SFR/USwhMSaAeZQQbEHeBp57pjKXRlXmqpMrLJB4y1oglR/c2502853uN0I+DAQ== + dependencies: + "@types/rx-core" "*" + +"@types/rx-core@*": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@types/rx-core/-/rx-core-4.0.3.tgz#0b3354b1238cedbe2b74f6326f139dbc7a591d60" + integrity sha1-CzNUsSOM7b4rdPYybxOdvHpZHWA= + +"@types/rx-lite-aggregates@*": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@types/rx-lite-aggregates/-/rx-lite-aggregates-4.0.3.tgz#6efb2b7f3d5f07183a1cb2bd4b1371d7073384c2" + integrity sha512-MAGDAHy8cRatm94FDduhJF+iNS5//jrZ/PIfm+QYw9OCeDgbymFHChM8YVIvN2zArwsRftKgE33QfRWvQk4DPg== + dependencies: + "@types/rx-lite" "*" + +"@types/rx-lite-async@*": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@types/rx-lite-async/-/rx-lite-async-4.0.2.tgz#27fbf0caeff029f41e2d2aae638b05e91ceb600c" + integrity sha512-vTEv5o8l6702ZwfAM5aOeVDfUwBSDOs+ARoGmWAKQ6LOInQ8J4/zjM7ov12fuTpktUKdMQjkeCp07Vd73mPkxw== + dependencies: + "@types/rx-lite" "*" + +"@types/rx-lite-backpressure@*": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@types/rx-lite-backpressure/-/rx-lite-backpressure-4.0.3.tgz#05abb19bdf87cc740196c355e5d0b37bb50b5d56" + integrity sha512-Y6aIeQCtNban5XSAF4B8dffhIKu6aAy/TXFlScHzSxh6ivfQBQw6UjxyEJxIOt3IT49YkS+siuayM2H/Q0cmgA== + dependencies: + "@types/rx-lite" "*" + +"@types/rx-lite-coincidence@*": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@types/rx-lite-coincidence/-/rx-lite-coincidence-4.0.3.tgz#80bd69acc4054a15cdc1638e2dc8843498cd85c0" + integrity sha512-1VNJqzE9gALUyMGypDXZZXzR0Tt7LC9DdAZQ3Ou/Q0MubNU35agVUNXKGHKpNTba+fr8GdIdkC26bRDqtCQBeQ== + dependencies: + "@types/rx-lite" "*" + +"@types/rx-lite-experimental@*": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/rx-lite-experimental/-/rx-lite-experimental-4.0.1.tgz#c532f5cbdf3f2c15da16ded8930d1b2984023cbd" + integrity sha1-xTL1y98/LBXaFt7Ykw0bKYQCPL0= + dependencies: + "@types/rx-lite" "*" + +"@types/rx-lite-joinpatterns@*": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/rx-lite-joinpatterns/-/rx-lite-joinpatterns-4.0.1.tgz#f70fe370518a8432f29158cc92ffb56b4e4afc3e" + integrity sha1-9w/jcFGKhDLykVjMkv+1a05K/D4= + dependencies: + "@types/rx-lite" "*" + +"@types/rx-lite-testing@*": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/rx-lite-testing/-/rx-lite-testing-4.0.1.tgz#21b19d11f4dfd6ffef5a9d1648e9c8879bfe21e9" + integrity sha1-IbGdEfTf1v/vWp0WSOnIh5v+Iek= + dependencies: + "@types/rx-lite-virtualtime" "*" + +"@types/rx-lite-time@*": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@types/rx-lite-time/-/rx-lite-time-4.0.3.tgz#0eda65474570237598f3448b845d2696f2dbb1c4" + integrity sha512-ukO5sPKDRwCGWRZRqPlaAU0SKVxmWwSjiOrLhoQDoWxZWg6vyB9XLEZViKOzIO6LnTIQBlk4UylYV0rnhJLxQw== + dependencies: + "@types/rx-lite" "*" + +"@types/rx-lite-virtualtime@*": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@types/rx-lite-virtualtime/-/rx-lite-virtualtime-4.0.3.tgz#4b30cacd0fe2e53af29f04f7438584c7d3959537" + integrity sha512-3uC6sGmjpOKatZSVHI2xB1+dedgml669ZRvqxy+WqmGJDVusOdyxcKfyzjW0P3/GrCiN4nmRkLVMhPwHCc5QLg== + dependencies: + "@types/rx-lite" "*" + +"@types/rx-lite@*": + version "4.0.6" + resolved "https://registry.yarnpkg.com/@types/rx-lite/-/rx-lite-4.0.6.tgz#3c02921c4244074234f26b772241bcc20c18c253" + integrity sha512-oYiDrFIcor9zDm0VDUca1UbROiMYBxMLMaM6qzz4ADAfOmA9r1dYEcAFH+2fsPI5BCCjPvV9pWC3X3flbrvs7w== + dependencies: + "@types/rx-core" "*" + "@types/rx-core-binding" "*" + +"@types/rx@*": + version "4.1.1" + resolved "https://registry.yarnpkg.com/@types/rx/-/rx-4.1.1.tgz#598fc94a56baed975f194574e0f572fd8e627a48" + integrity sha1-WY/JSla67ZdfGUV04PVy/Y5iekg= + dependencies: + "@types/rx-core" "*" + "@types/rx-core-binding" "*" + "@types/rx-lite" "*" + "@types/rx-lite-aggregates" "*" + "@types/rx-lite-async" "*" + "@types/rx-lite-backpressure" "*" + "@types/rx-lite-coincidence" "*" + "@types/rx-lite-experimental" "*" + "@types/rx-lite-joinpatterns" "*" + "@types/rx-lite-testing" "*" + "@types/rx-lite-time" "*" + "@types/rx-lite-virtualtime" "*" + +"@types/through@*": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/through/-/through-0.0.29.tgz#72943aac922e179339c651fa34a4428a4d722f93" + integrity sha512-9a7C5VHh+1BKblaYiq+7Tfc+EOmjMdZaD1MYtkQjSoxgB69tBjW98ry6SKsi4zEIWztLOMRuL87A3bdT/Fc/4w== + dependencies: + "@types/node" "*" + +"@types/tough-cookie@*": + version "2.3.4" + resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-2.3.4.tgz#821878b81bfab971b93a265a561d54ea61f9059f" + integrity sha512-Set5ZdrAaKI/qHdFlVMgm/GsAv/wkXhSTuZFkJ+JI7HK+wIkIlOaUXSXieIvJ0+OvGIqtREFoE+NHJtEq0gtEw== + +"@types/update-notifier@^2.5.0": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@types/update-notifier/-/update-notifier-2.5.0.tgz#63cfcee92cc915f9a6eea4d1442ec6efd012e118" + integrity sha512-YV+ZcSIiv30GhLM7WwxI+bsbcW34d3Yhl2JSFBNFL6qtfsoI9++hogxz+jTqeS86ynKcMUE0AsnLWQynfJnsfA== + +JSONStream@^1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" + integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + +abab@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f" + integrity sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w== + +abbrev@1, abbrev@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== + +acorn-globals@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.0.tgz#e3b6f8da3c1552a95ae627571f7dd6923bb54103" + integrity sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw== + dependencies: + acorn "^6.0.1" + acorn-walk "^6.0.1" + +acorn-jsx@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" + integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== + +acorn-walk@^6.0.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913" + integrity sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw== + +acorn@^5.5.3: + version "5.7.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" + integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== + +acorn@^6.0.1, acorn@^6.0.2: + version "6.0.5" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.0.5.tgz#81730c0815f3f3b34d8efa95cb7430965f4d887a" + integrity sha512-i33Zgp3XWtmZBMNvCr4azvOFeWVw1Rk6p3hfi3LUDvIFraOMywb1kAtrbi+med14m4Xfpqm3zRZMT+c0FNE7kg== + +agent-base@4, agent-base@^4.1.0, agent-base@~4.2.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" + integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg== + dependencies: + es6-promisify "^5.0.0" + +agentkeepalive@^3.4.1: + version "3.5.2" + resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-3.5.2.tgz#a113924dd3fa24a0bc3b78108c450c2abee00f67" + integrity sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ== + dependencies: + humanize-ms "^1.2.1" + +ajv@^6.5.3, ajv@^6.5.5, ajv@^6.6.1: + version "6.6.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.6.2.tgz#caceccf474bf3fc3ce3b147443711a24063cc30d" + integrity sha512-FBHEW6Jf5TB9MGBgUUA9XHkTbjXYfAUjY43ACMfmdMRHniyoMHjHjzD50OK8LGDWQwp4rWEsIq5kEqq7rvIM1g== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-align@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f" + integrity sha1-w2rsy6VjuJzrVW82kPCx2eNUf38= + dependencies: + string-width "^2.0.0" + +ansi-escapes@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" + integrity sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw== + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +ansi-regex@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.0.0.tgz#70de791edf021404c3fd615aa89118ae0432e5a9" + integrity sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w== + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= + +ansi-styles@^3.2.0, ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansicolors@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/ansicolors/-/ansicolors-0.3.2.tgz#665597de86a9ffe3aa9bfbe6cae5c6ea426b4979" + integrity sha1-ZlWX3oap/+Oqm/vmyuXG6kJrSXk= + +ansistyles@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/ansistyles/-/ansistyles-0.1.3.tgz#5de60415bda071bb37127854c864f41b23254539" + integrity sha1-XeYEFb2gcbs3EnhUyGT0GyMlRTk= + +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + +append-transform@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991" + integrity sha1-126/jKlNJ24keja61EpLdKthGZE= + dependencies: + default-require-extensions "^1.0.0" + +aproba@^1.0.3, aproba@^1.1.1, aproba@^1.1.2, aproba@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== + +"aproba@^1.1.2 || 2": + version "2.0.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" + integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== + +archy@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" + integrity sha1-+cjBN1fMHde8N5rHeyxipcKGjEA= + +are-we-there-yet@~1.1.2: + version "1.1.5" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= + dependencies: + arr-flatten "^1.0.1" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= + +arr-flatten@^1.0.1, arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= + +array-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" + integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM= + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= + +arrify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= + +asap@^2.0.0: + version "2.0.6" + resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" + integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= + +asn1@~0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= + +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== + +async-limiter@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" + integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== + +async@^2.1.4, async@^2.5.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" + integrity sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ== + dependencies: + lodash "^4.17.10" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + +atob@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= + +aws4@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" + integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== + +axios@^0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.18.0.tgz#32d53e4851efdc0a11993b6cd000789d70c05102" + integrity sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI= + dependencies: + follow-redirects "^1.3.0" + is-buffer "^1.1.5" + +babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-core@^6.0.0, babel-core@^6.26.0: + version "6.26.3" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" + integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.1" + debug "^2.6.9" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.8" + slash "^1.0.0" + source-map "^0.5.7" + +babel-generator@^6.18.0, babel-generator@^6.26.0: + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.7" + trim-right "^1.0.1" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + integrity sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-jest@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-23.6.0.tgz#a644232366557a2240a0c083da6b25786185a2f1" + integrity sha512-lqKGG6LYXYu+DQh/slrQ8nxXQkEkhugdXsU6St7GmhVS7Ilc/22ArwqXNJrf0QaOBjZB0360qZMwXqDYQHXaew== + dependencies: + babel-plugin-istanbul "^4.1.6" + babel-preset-jest "^23.2.0" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-istanbul@^4.1.6: + version "4.1.6" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz#36c59b2192efce81c5b378321b74175add1c9a45" + integrity sha512-PWP9FQ1AhZhS01T/4qLSKoHGY/xvkZdVBGlKM/HuxxS3+sC66HhTNR7+MpbO/so/cz/wY94MeSWJuP1hXIPfwQ== + dependencies: + babel-plugin-syntax-object-rest-spread "^6.13.0" + find-up "^2.1.0" + istanbul-lib-instrument "^1.10.1" + test-exclude "^4.2.1" + +babel-plugin-jest-hoist@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.2.0.tgz#e61fae05a1ca8801aadee57a6d66b8cefaf44167" + integrity sha1-5h+uBaHKiAGq3uV6bWa4zvr0QWc= + +babel-plugin-syntax-object-rest-spread@^6.13.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + integrity sha1-/WU28rzhODb/o6VFjEkDpZe7O/U= + +babel-preset-jest@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-23.2.0.tgz#8ec7a03a138f001a1a8fb1e8113652bf1a55da46" + integrity sha1-jsegOhOPABoaj7HoETZSvxpV2kY= + dependencies: + babel-plugin-jest-hoist "^23.2.0" + babel-plugin-syntax-object-rest-spread "^6.13.0" + +babel-register@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + integrity sha1-btAhFz4vy0htestFxgCahW9kcHE= + dependencies: + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + home-or-tmp "^2.0.0" + lodash "^4.17.4" + mkdirp "^0.5.1" + source-map-support "^0.4.15" + +babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@^6.0.0, babel-traverse@^6.18.0, babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + integrity sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4= + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.0.0, babel-types@^6.18.0, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + integrity sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc= + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= + dependencies: + tweetnacl "^0.14.3" + +bin-links@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/bin-links/-/bin-links-1.1.2.tgz#fb74bd54bae6b7befc6c6221f25322ac830d9757" + integrity sha512-8eEHVgYP03nILphilltWjeIjMbKyJo3wvp9K816pHbhP301ismzw15mxAAEVQ/USUwcP++1uNrbERbp8lOA6Fg== + dependencies: + bluebird "^3.5.0" + cmd-shim "^2.0.2" + gentle-fs "^2.0.0" + graceful-fs "^4.1.11" + write-file-atomic "^2.3.0" + +block-stream@*: + version "0.0.9" + resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" + integrity sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo= + dependencies: + inherits "~2.0.0" + +bluebird@^3.5.0, bluebird@^3.5.1, bluebird@^3.5.3: + version "3.5.3" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.3.tgz#7d01c6f9616c9a51ab0f8c549a79dfe6ec33efa7" + integrity sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw== + +boxen@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b" + integrity sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw== + dependencies: + ansi-align "^2.0.0" + camelcase "^4.0.0" + chalk "^2.0.1" + cli-boxes "^1.0.0" + string-width "^2.0.0" + term-size "^1.2.0" + widest-line "^2.0.0" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +browser-process-hrtime@^0.1.2: + version "0.1.3" + resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz#616f00faef1df7ec1b5bf9cfe2bdc3170f26c7b4" + integrity sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw== + +browser-resolve@^1.11.3: + version "1.11.3" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" + integrity sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ== + dependencies: + resolve "1.1.7" + +bser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" + integrity sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk= + dependencies: + node-int64 "^0.4.0" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +builtin-modules@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= + +builtins@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" + integrity sha1-y5T662HIaWRR2zZTThQi+U8K7og= + +byline@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/byline/-/byline-5.0.0.tgz#741c5216468eadc457b03410118ad77de8c1ddb1" + integrity sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE= + +byte-size@^4.0.3: + version "4.0.4" + resolved "https://registry.yarnpkg.com/byte-size/-/byte-size-4.0.4.tgz#29d381709f41aae0d89c631f1c81aec88cd40b23" + integrity sha512-82RPeneC6nqCdSwCX2hZUz3JPOvN5at/nTEw/CMf05Smu3Hrpo9Psb7LjN+k+XndNArG1EY8L4+BM3aTM4BCvw== + +cacache@^10.0.4: + version "10.0.4" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-10.0.4.tgz#6452367999eff9d4188aefd9a14e9d7c6a263460" + integrity sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA== + dependencies: + bluebird "^3.5.1" + chownr "^1.0.1" + glob "^7.1.2" + graceful-fs "^4.1.11" + lru-cache "^4.1.1" + mississippi "^2.0.0" + mkdirp "^0.5.1" + move-concurrently "^1.0.1" + promise-inflight "^1.0.1" + rimraf "^2.6.2" + ssri "^5.2.4" + unique-filename "^1.1.0" + y18n "^4.0.0" + +cacache@^11.0.1, cacache@^11.0.2, cacache@^11.2.0: + version "11.3.2" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-11.3.2.tgz#2d81e308e3d258ca38125b676b98b2ac9ce69bfa" + integrity sha512-E0zP4EPGDOaT2chM08Als91eYnf8Z+eH1awwwVsngUmgppfM5jjJ8l3z5vO5p5w/I3LsiXawb1sW0VY65pQABg== + dependencies: + bluebird "^3.5.3" + chownr "^1.1.1" + figgy-pudding "^3.5.1" + glob "^7.1.3" + graceful-fs "^4.1.15" + lru-cache "^5.1.1" + mississippi "^3.0.0" + mkdirp "^0.5.1" + move-concurrently "^1.0.1" + promise-inflight "^1.0.1" + rimraf "^2.6.2" + ssri "^6.0.1" + unique-filename "^1.1.1" + y18n "^4.0.0" + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +call-limit@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/call-limit/-/call-limit-1.1.0.tgz#6fd61b03f3da42a2cd0ec2b60f02bd0e71991fea" + integrity sha1-b9YbA/PaQqLNDsK2DwK9DnGZH+o= + +callsites@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" + integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= + +callsites@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.0.0.tgz#fb7eb569b72ad7a45812f93fd9430a3e410b3dd3" + integrity sha512-tWnkwu9YEq2uzlBDI4RcLn8jrFvF9AOi8PxDNU3hZZjJcjkcRAq3vCI+vZcg1SuxISDYe86k9VZFwAxDiJGoAw== + +camelcase@^4.0.0, camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= + +capture-exit@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-1.2.0.tgz#1c5fcc489fd0ab00d4f1ac7ae1072e3173fbab6f" + integrity sha1-HF/MSJ/QqwDU8ax64QcuMXP7q28= + dependencies: + rsvp "^3.3.3" + +capture-stack-trace@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz#a6c0bbe1f38f3aa0b92238ecb6ff42c344d4135d" + integrity sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw== + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= + +chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" + integrity sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + +chownr@^1.0.1, chownr@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" + integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== + +chownr@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" + integrity sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE= + +ci-info@^1.5.0, ci-info@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.6.0.tgz#2ca20dbb9ceb32d4524a683303313f0304b1e497" + integrity sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A== + +cidr-regex@^2.0.10: + version "2.0.10" + resolved "https://registry.yarnpkg.com/cidr-regex/-/cidr-regex-2.0.10.tgz#af13878bd4ad704de77d6dc800799358b3afa70d" + integrity sha512-sB3ogMQXWvreNPbJUZMRApxuRYd+KoIo4RGQ81VatjmMW6WJPo+IJZ2846FGItr9VzKo5w7DXzijPLGtSd0N3Q== + dependencies: + ip-regex "^2.1.0" + +circular-json@^0.3.1: + version "0.3.3" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" + integrity sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A== + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +cli-boxes@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" + integrity sha1-T6kXw+WclKAEzWH47lCdplFocUM= + +cli-columns@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/cli-columns/-/cli-columns-3.1.2.tgz#6732d972979efc2ae444a1f08e08fa139c96a18e" + integrity sha1-ZzLZcpee/CrkRKHwjgj6E5yWoY4= + dependencies: + string-width "^2.0.0" + strip-ansi "^3.0.1" + +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= + dependencies: + restore-cursor "^2.0.0" + +cli-spinners@^1.1.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-1.3.1.tgz#002c1990912d0d59580c93bd36c056de99e4259a" + integrity sha512-1QL4544moEsDVH9T/l6Cemov/37iv1RtoKf7NJ04A60+4MREXNfx/QvavbH6QoGdsD4N4Mwy49cmaINR/o2mdg== + +cli-table3@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.5.1.tgz#0252372d94dfc40dbd8df06005f48f31f656f202" + integrity sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw== + dependencies: + object-assign "^4.1.0" + string-width "^2.1.1" + optionalDependencies: + colors "^1.1.2" + +cli-width@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" + integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= + +cliui@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" + integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + wrap-ansi "^2.0.0" + +clone@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" + integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= + +cmd-shim@^2.0.2, cmd-shim@~2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/cmd-shim/-/cmd-shim-2.0.2.tgz#6fcbda99483a8fd15d7d30a196ca69d688a2efdb" + integrity sha1-b8vamUg6j9FdfTChlspp1oii79s= + dependencies: + graceful-fs "^4.1.2" + mkdirp "~0.5.0" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +colors@^1.1.2: + version "1.3.3" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.3.tgz#39e005d546afe01e01f9c4ca8fa50f686a01205d" + integrity sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg== + +columnify@~1.5.4: + version "1.5.4" + resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb" + integrity sha1-Rzfd8ce2mop8NAVweC6UfuyOeLs= + dependencies: + strip-ansi "^3.0.0" + wcwidth "^1.0.0" + +combined-stream@^1.0.6, combined-stream@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" + integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w== + dependencies: + delayed-stream "~1.0.0" + +command-exists@^1.2.8: + version "1.2.8" + resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.8.tgz#715acefdd1223b9c9b37110a149c6392c2852291" + integrity sha512-PM54PkseWbiiD/mMsbvW351/u+dafwTJ0ye2qB60G1aGQP9j3xK2gmMDc+R34L3nDtx4qMCitXT75mkbkGJDLw== + +commander@^2.19.0: + version "2.19.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" + integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== + +commander@~2.17.1: + version "2.17.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" + integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg== + +component-emitter@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" + integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY= + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +concat-stream@^1.5.0, concat-stream@^1.5.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== + dependencies: + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +config-chain@^1.1.12: + version "1.1.12" + resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.12.tgz#0fde8d091200eb5e808caf25fe618c02f48e4efa" + integrity sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA== + dependencies: + ini "^1.3.4" + proto-list "~1.2.1" + +configstore@^3.0.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.1.2.tgz#c6f25defaeef26df12dd33414b001fe81a543f8f" + integrity sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw== + dependencies: + dot-prop "^4.1.0" + graceful-fs "^4.1.2" + make-dir "^1.0.0" + unique-string "^1.0.0" + write-file-atomic "^2.0.0" + xdg-basedir "^3.0.0" + +configstore@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/configstore/-/configstore-4.0.0.tgz#5933311e95d3687efb592c528b922d9262d227e7" + integrity sha512-CmquAXFBocrzaSM8mtGPMM/HiWmyIpr4CcJl/rgY2uCObZ/S7cKU0silxslqJejl+t/T9HS8E0PUNQD81JGUEQ== + dependencies: + dot-prop "^4.1.0" + graceful-fs "^4.1.2" + make-dir "^1.0.0" + unique-string "^1.0.0" + write-file-atomic "^2.0.0" + xdg-basedir "^3.0.0" + +console-control-strings@^1.0.0, console-control-strings@^1.1.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= + +convert-source-map@^1.4.0, convert-source-map@^1.5.1: + version "1.6.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" + integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== + dependencies: + safe-buffer "~5.1.1" + +copy-concurrently@^1.0.0: + version "1.0.5" + resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0" + integrity sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A== + dependencies: + aproba "^1.1.1" + fs-write-stream-atomic "^1.0.8" + iferr "^0.1.5" + mkdirp "^0.5.1" + rimraf "^2.5.4" + run-queue "^1.0.0" + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= + +core-js@^2.4.0, core-js@^2.5.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.1.tgz#87416ae817de957a3f249b3b5ca475d4aaed6042" + integrity sha512-L72mmmEayPJBejKIWe2pYtGis5r0tQ5NaJekdhyXgeMQTpJoBsH0NL4ElY2LfSoV15xeQWKQ+XTTOZdyero5Xg== + +core-util-is@1.0.2, core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +create-error-class@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" + integrity sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y= + dependencies: + capture-stack-trace "^1.0.0" + +cross-spawn@^5.0.1: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + +cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +crypto-random-string@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" + integrity sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4= + +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": + version "0.3.4" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.4.tgz#8cd52e8a3acfd68d3aed38ee0a640177d2f9d797" + integrity sha512-+7prCSORpXNeR4/fUP3rL+TzqtiFfhMvTd7uEqMdgPvLPt4+uzFUeufx5RHjGTACCargg/DiEt/moMQmvnfkog== + +cssstyle@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.1.1.tgz#18b038a9c44d65f7a8e428a653b9f6fe42faf5fb" + integrity sha512-364AI1l/M5TYcFH83JnOH/pSqgaNnKmYgKrm0didZMGKWjQB60dymwWy1rKUgL3J1ffdq9xVi2yGLHdSjjSNog== + dependencies: + cssom "0.3.x" + +cyclist@~0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640" + integrity sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA= + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= + dependencies: + assert-plus "^1.0.0" + +data-urls@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" + integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ== + dependencies: + abab "^2.0.0" + whatwg-mimetype "^2.2.0" + whatwg-url "^7.0.0" + +debug@3.1.0, debug@=3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== + dependencies: + ms "2.0.0" + +debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@^3.1.0: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + +debug@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + dependencies: + ms "^2.1.1" + +debuglog@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" + integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI= + +decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + +default-require-extensions@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8" + integrity sha1-836hXT4T/9m0N9M+GnW1+5eHTLg= + dependencies: + strip-bom "^2.0.0" + +defaults@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" + integrity sha1-xlYFHpgX2f8I7YgUd/P+QBnz730= + dependencies: + clone "^1.0.2" + +define-properties@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== + dependencies: + object-keys "^1.0.12" + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + integrity sha1-920GQ1LN9Docts5hnE7jqUdd4gg= + dependencies: + repeating "^2.0.0" + +detect-indent@~5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" + integrity sha1-OHHMCmoALow+Wzz38zYmRnXwa50= + +detect-libc@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= + +detect-newline@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" + integrity sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I= + +dezalgo@^1.0.0, dezalgo@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/dezalgo/-/dezalgo-1.0.3.tgz#7f742de066fc748bc8db820569dddce49bf0d456" + integrity sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY= + dependencies: + asap "^2.0.0" + wrappy "1" + +diff@^3.2.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== + +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== + dependencies: + esutils "^2.0.2" + +domexception@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" + integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug== + dependencies: + webidl-conversions "^4.0.2" + +dot-prop@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.0.tgz#1f19e0c2e1aa0e32797c49799f2837ac6af69c57" + integrity sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ== + dependencies: + is-obj "^1.0.0" + +dotenv@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-5.0.1.tgz#a5317459bd3d79ab88cff6e44057a6a3fbb1fcef" + integrity sha512-4As8uPrjfwb7VXC+WnLCbXK7y+Ueb2B3zgNCePYfhxS1PYeaO1YTeplffTEcbfLhvFNGLAz90VvJs9yomG7bow== + +duplexer3@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= + +duplexify@^3.4.2, duplexify@^3.6.0: + version "3.6.1" + resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.6.1.tgz#b1a7a29c4abfd639585efaecce80d666b1e34125" + integrity sha512-vM58DwdnKmty+FSPzT14K9JXb90H+j5emaR4KYbr2KTIz00WHGbWOe5ghQTx233ZCLZtrGDALzKwcjEtSt35mA== + dependencies: + end-of-stream "^1.0.0" + inherits "^2.0.1" + readable-stream "^2.0.0" + stream-shift "^1.0.0" + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +editor@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/editor/-/editor-1.0.0.tgz#60c7f87bd62bcc6a894fa8ccd6afb7823a24f742" + integrity sha1-YMf4e9YrzGqJT6jM1q+3gjok90I= + +encoding@^0.1.11: + version "0.1.12" + resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" + integrity sha1-U4tm8+5izRq1HsMjgp0flIDHS+s= + dependencies: + iconv-lite "~0.4.13" + +end-of-stream@^1.0.0, end-of-stream@^1.1.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" + integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== + dependencies: + once "^1.4.0" + +err-code@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/err-code/-/err-code-1.1.2.tgz#06e0116d3028f6aef4806849eb0ea6a748ae6960" + integrity sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA= + +errno@~0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" + integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg== + dependencies: + prr "~1.0.1" + +error-ex@^1.2.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.5.1: + version "1.13.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" + integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg== + dependencies: + es-to-primitive "^1.2.0" + function-bind "^1.1.1" + has "^1.0.3" + is-callable "^1.1.4" + is-regex "^1.0.4" + object-keys "^1.0.12" + +es-to-primitive@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" + integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + +es6-promise@^4.0.3: + version "4.2.5" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.5.tgz#da6d0d5692efb461e082c14817fe2427d8f5d054" + integrity sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg== + +es6-promisify@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" + integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= + dependencies: + es6-promise "^4.0.3" + +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +escodegen@^1.9.1: + version "1.11.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.0.tgz#b27a9389481d5bfd5bec76f7bb1eb3f8f4556589" + integrity sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw== + dependencies: + esprima "^3.1.3" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + +eslint-plugin-jest@^21.27.2: + version "21.27.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-21.27.2.tgz#2a795b7c3b5e707df48a953d651042bd01d7b0a8" + integrity sha512-0E4OIgBJVlAmf1KfYFtZ3gYxgUzC5Eb3Jzmrc9ikI1OY+/cM8Kh72Ti7KfpeHNeD3HJNf9SmEfmvQLIz44Hrhw== + +eslint-scope@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.0.tgz#50bf3071e9338bcdc43331794a0cb533f0136172" + integrity sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA== + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-utils@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" + integrity sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q== + +eslint-visitor-keys@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" + integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== + +eslint@^5.11.1: + version "5.12.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.12.0.tgz#fab3b908f60c52671fb14e996a450b96c743c859" + integrity sha512-LntwyPxtOHrsJdcSwyQKVtHofPHdv+4+mFwEe91r2V13vqpM8yLr7b1sW+Oo/yheOPkWYsYlYJCkzlFAt8KV7g== + dependencies: + "@babel/code-frame" "^7.0.0" + ajv "^6.5.3" + chalk "^2.1.0" + cross-spawn "^6.0.5" + debug "^4.0.1" + doctrine "^2.1.0" + eslint-scope "^4.0.0" + eslint-utils "^1.3.1" + eslint-visitor-keys "^1.0.0" + espree "^5.0.0" + esquery "^1.0.1" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.7.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + inquirer "^6.1.0" + js-yaml "^3.12.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.5" + minimatch "^3.0.4" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + pluralize "^7.0.0" + progress "^2.0.0" + regexpp "^2.0.1" + semver "^5.5.1" + strip-ansi "^4.0.0" + strip-json-comments "^2.0.1" + table "^5.0.2" + text-table "^0.2.0" + +espree@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.0.tgz#fc7f984b62b36a0f543b13fb9cd7b9f4a7f5b65c" + integrity sha512-1MpUfwsdS9MMoN7ZXqAr9e9UKdVHDcvrJpyx7mm1WuQlx/ygErEQBzgi5Nh5qBHIoYweprhtMkTCb9GhcAIcsA== + dependencies: + acorn "^6.0.2" + acorn-jsx "^5.0.0" + eslint-visitor-keys "^1.0.0" + +esprima@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +esquery@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" + integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== + dependencies: + estraverse "^4.0.0" + +esrecurse@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" + integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== + dependencies: + estraverse "^4.1.0" + +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= + +exec-sh@^0.2.0: + version "0.2.2" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.2.tgz#2a5e7ffcbd7d0ba2755bdecb16e5a427dfbdec36" + integrity sha512-FIUCJz1RbuS0FKTdaAafAByGS0CPvU3R0MeHxgtl+djzCc//F8HakL8GzmVNZanasTbTAY/3DRFA0KpVqj/eAw== + dependencies: + merge "^1.2.0" + +execa@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" + integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= + dependencies: + is-posix-bracket "^0.1.0" + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= + dependencies: + fill-range "^2.1.0" + +expect@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-23.6.0.tgz#1e0c8d3ba9a581c87bd71fb9bc8862d443425f98" + integrity sha512-dgSoOHgmtn/aDGRVFWclQyPDKl2CQRq0hmIEoUAuQs/2rn2NcvCWcSCovm6BLeuB/7EZuLGu2QfnR+qRt5OM4w== + dependencies: + ansi-styles "^3.2.0" + jest-diff "^23.6.0" + jest-get-type "^22.1.0" + jest-matcher-utils "^23.6.0" + jest-message-util "^23.4.0" + jest-regex-util "^23.3.0" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +external-editor@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" + integrity sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= + dependencies: + is-extglob "^1.0.0" + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + +fast-deep-equal@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + +fb-watchman@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + integrity sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg= + dependencies: + bser "^2.0.0" + +figgy-pudding@^3.0.0, figgy-pudding@^3.1.0, figgy-pudding@^3.4.1, figgy-pudding@^3.5.1: + version "3.5.1" + resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790" + integrity sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w== + +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" + integrity sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E= + dependencies: + flat-cache "^1.2.1" + object-assign "^4.0.1" + +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= + +fileset@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/fileset/-/fileset-2.0.3.tgz#8e7548a96d3cc2327ee5e674168723a333bba2a0" + integrity sha1-jnVIqW08wjJ+5eZ0FocjozO7oqA= + dependencies: + glob "^7.0.3" + minimatch "^3.0.3" + +fill-range@^2.1.0: + version "2.2.4" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" + integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^3.0.0" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +find-npm-prefix@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/find-npm-prefix/-/find-npm-prefix-1.0.2.tgz#8d8ce2c78b3b4b9e66c8acc6a37c231eb841cfdf" + integrity sha512-KEftzJ+H90x6pcKtdXZEPsQse8/y/UnvzRKrOSQFprnrGaFuJ62fVkP34Iu2IYuMvyauCyoLTNkJZgrrGA2wkA== + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= + dependencies: + locate-path "^2.0.0" + +flat-cache@^1.2.1: + version "1.3.4" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.4.tgz#2c2ef77525cc2929007dfffa1dd314aa9c9dee6f" + integrity sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg== + dependencies: + circular-json "^0.3.1" + graceful-fs "^4.1.2" + rimraf "~2.6.2" + write "^0.2.1" + +flush-write-stream@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.0.3.tgz#c5d586ef38af6097650b49bc41b55fabb19f35bd" + integrity sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw== + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.4" + +follow-redirects@^1.3.0: + version "1.6.1" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.6.1.tgz#514973c44b5757368bad8bddfe52f81f015c94cb" + integrity sha512-t2JCjbzxQpWvbhts3l6SH1DKzSrx8a+SsaVf4h6bG4kOXUuPYS/kg2Lr4gQSb7eemaHqJkOThF1BGyjlUkO1GQ== + dependencies: + debug "=3.1.0" + +for-in@^1.0.1, for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= + dependencies: + for-in "^1.0.1" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= + +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= + dependencies: + map-cache "^0.2.2" + +from2@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/from2/-/from2-1.3.0.tgz#88413baaa5f9a597cfde9221d86986cd3c061dfd" + integrity sha1-iEE7qqX5pZfP3pIh2GmGzTwGHf0= + dependencies: + inherits "~2.0.1" + readable-stream "~1.1.10" + +from2@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" + integrity sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8= + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.0" + +fs-extra@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs-minipass@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" + integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ== + dependencies: + minipass "^2.2.1" + +fs-vacuum@^1.2.10, fs-vacuum@~1.2.10: + version "1.2.10" + resolved "https://registry.yarnpkg.com/fs-vacuum/-/fs-vacuum-1.2.10.tgz#b7629bec07a4031a2548fdf99f5ecf1cc8b31e36" + integrity sha1-t2Kb7AekAxolSP35n17PHMizHjY= + dependencies: + graceful-fs "^4.1.2" + path-is-inside "^1.0.1" + rimraf "^2.5.2" + +fs-write-stream-atomic@^1.0.8, fs-write-stream-atomic@~1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" + integrity sha1-tH31NJPvkR33VzHnCp3tAYnbQMk= + dependencies: + graceful-fs "^4.1.2" + iferr "^0.1.5" + imurmurhash "^0.1.4" + readable-stream "1 || 2" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +fsevents@^1.2.3: + version "1.2.4" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" + integrity sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg== + dependencies: + nan "^2.9.2" + node-pre-gyp "^0.10.0" + +fstream@^1.0.0, fstream@^1.0.2: + version "1.0.11" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" + integrity sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE= + dependencies: + graceful-fs "^4.1.2" + inherits "~2.0.0" + mkdirp ">=0.5 0" + rimraf "2" + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +genfun@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/genfun/-/genfun-5.0.0.tgz#9dd9710a06900a5c4a5bf57aca5da4e52fe76537" + integrity sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA== + +gentle-fs@^2.0.0, gentle-fs@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/gentle-fs/-/gentle-fs-2.0.1.tgz#585cfd612bfc5cd52471fdb42537f016a5ce3687" + integrity sha512-cEng5+3fuARewXktTEGbwsktcldA+YsnUEaXZwcK/3pjSE1X9ObnTs+/8rYf8s+RnIcQm2D5x3rwpN7Zom8Bew== + dependencies: + aproba "^1.1.2" + fs-vacuum "^1.2.10" + graceful-fs "^4.1.11" + iferr "^0.1.5" + mkdirp "^0.5.1" + path-is-inside "^1.0.2" + read-cmd-shim "^1.0.1" + slide "^1.1.6" + +get-caller-file@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== + +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= + dependencies: + assert-plus "^1.0.0" + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= + dependencies: + is-glob "^2.0.0" + +glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +global-dirs@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" + integrity sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU= + dependencies: + ini "^1.3.4" + +globals@^11.7.0: + version "11.9.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.9.0.tgz#bde236808e987f290768a93d065060d78e6ab249" + integrity sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg== + +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== + +got@^6.7.1: + version "6.7.1" + resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" + integrity sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA= + dependencies: + create-error-class "^3.0.0" + duplexer3 "^0.1.4" + get-stream "^3.0.0" + is-redirect "^1.0.0" + is-retry-allowed "^1.0.0" + is-stream "^1.0.0" + lowercase-keys "^1.0.0" + safe-buffer "^5.0.1" + timed-out "^4.0.0" + unzip-response "^2.0.1" + url-parse-lax "^1.0.0" + +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6: + version "4.1.15" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" + integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== + +growly@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" + integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= + +handlebars@^4.0.3: + version "4.0.12" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.12.tgz#2c15c8a96d46da5e266700518ba8cb8d919d5bc5" + integrity sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA== + dependencies: + async "^2.5.0" + optimist "^0.6.1" + source-map "^0.6.1" + optionalDependencies: + uglify-js "^3.1.4" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= + +har-validator@~5.1.0: + version "5.1.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" + integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== + dependencies: + ajv "^6.5.5" + har-schema "^2.0.0" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= + dependencies: + ansi-regex "^2.0.0" + +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + integrity sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo= + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" + integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= + +has-unicode@^2.0.0, has-unicode@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +has@^1.0.1, has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + integrity sha1-42w/LSyufXRqhX440Y1fMqeILbg= + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +hosted-git-info@^2.1.4, hosted-git-info@^2.6.0, hosted-git-info@^2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" + integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== + +html-encoding-sniffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" + integrity sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw== + dependencies: + whatwg-encoding "^1.0.1" + +http-cache-semantics@^3.8.1: + version "3.8.1" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" + integrity sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w== + +http-proxy-agent@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405" + integrity sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg== + dependencies: + agent-base "4" + debug "3.1.0" + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +https-proxy-agent@^2.2.0, https-proxy-agent@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" + integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ== + dependencies: + agent-base "^4.1.0" + debug "^3.1.0" + +humanize-ms@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" + integrity sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0= + dependencies: + ms "^2.0.0" + +iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +iferr@^0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" + integrity sha1-xg7taebY/bazEEofy8ocGS3FtQE= + +iferr@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/iferr/-/iferr-1.0.2.tgz#e9fde49a9da06dc4a4194c6c9ed6d08305037a6d" + integrity sha512-9AfeLfji44r5TKInjhz3W9DyZI1zR1JAf2hVBMGhddAKPqBsupb89jGfbCTHIGZd6fGZl9WlHdn4AObygyMKwg== + +ignore-walk@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== + dependencies: + minimatch "^3.0.4" + +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + +import-fresh@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.0.0.tgz#a3d897f420cab0e671236897f75bc14b4885c390" + integrity sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +import-lazy@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" + integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM= + +import-local@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-1.0.0.tgz#5e4ffdc03f4fe6c009c6729beb29631c2f8227bc" + integrity sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ== + dependencies: + pkg-dir "^2.0.0" + resolve-cwd "^2.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + +inflight@^1.0.4, inflight@~1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== + +init-package-json@^1.10.3: + version "1.10.3" + resolved "https://registry.yarnpkg.com/init-package-json/-/init-package-json-1.10.3.tgz#45ffe2f610a8ca134f2bd1db5637b235070f6cbe" + integrity sha512-zKSiXKhQveNteyhcj1CoOP8tqp1QuxPIPBl8Bid99DGLFqA1p87M6lNgfjJHSBoWJJlidGOv5rWjyYKEB3g2Jw== + dependencies: + glob "^7.1.1" + npm-package-arg "^4.0.0 || ^5.0.0 || ^6.0.0" + promzard "^0.3.0" + read "~1.0.1" + read-package-json "1 || 2" + semver "2.x || 3.x || 4 || 5" + validate-npm-package-license "^3.0.1" + validate-npm-package-name "^3.0.0" + +inquirer@^6.1.0, inquirer@^6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.1.tgz#9943fc4882161bdb0b0c9276769c75b32dbfcd52" + integrity sha512-088kl3DRT2dLU5riVMKKr1DlImd6X7smDhpXUCkJDCKvTEJeRiXh0G132HG9u5a+6Ylw9plFRY7RuTnwohYSpg== + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.0" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^3.0.0" + figures "^2.0.0" + lodash "^4.17.10" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^6.1.0" + string-width "^2.1.0" + strip-ansi "^5.0.0" + through "^2.3.6" + +invariant@^2.2.2, invariant@^2.2.4: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== + dependencies: + loose-envify "^1.0.0" + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= + +ip-regex@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" + integrity sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk= + +ip@^1.1.4, ip@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" + integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== + dependencies: + kind-of "^6.0.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + +is-builtin-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + integrity sha1-VAVy0096wxGfj3bDDLwbHgN6/74= + dependencies: + builtin-modules "^1.0.0" + +is-callable@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" + integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== + +is-ci@^1.0.10: + version "1.2.1" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c" + integrity sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg== + dependencies: + ci-info "^1.5.0" + +is-cidr@^2.0.6: + version "2.0.7" + resolved "https://registry.yarnpkg.com/is-cidr/-/is-cidr-2.0.7.tgz#0fd4b863c26b2eb2d157ed21060c4f3f8dd356ce" + integrity sha512-YfOm5liUO1RoYfFh+lhiGNYtbLzem7IXzFqvfjXh+zLCEuAiznTBlQ2QcMWxsgYeOFmjzljOxJfmZID4/cRBAQ== + dependencies: + cidr-regex "^2.0.10" + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== + dependencies: + kind-of "^6.0.0" + +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-dotfile@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + integrity sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko= + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-generator-fn@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-1.0.0.tgz#969d49e1bb3329f6bb7f09089be26578b2ddd46a" + integrity sha1-lp1J4bszKfa7fwkIm+JleLLd1Go= + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= + dependencies: + is-extglob "^1.0.0" + +is-installed-globally@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.1.0.tgz#0dfd98f5a9111716dd535dda6492f67bf3d25a80" + integrity sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA= + dependencies: + global-dirs "^0.1.0" + is-path-inside "^1.0.0" + +is-npm@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" + integrity sha1-8vtjpl5JBbQGyGBydloaTceTufQ= + +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= + dependencies: + kind-of "^3.0.2" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= + dependencies: + kind-of "^3.0.2" + +is-number@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== + +is-obj@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= + +is-path-inside@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" + integrity sha1-jvW33lBDej/cprToZe96pVy0gDY= + dependencies: + path-is-inside "^1.0.1" + +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= + +is-promise@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= + +is-redirect@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" + integrity sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ= + +is-regex@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= + dependencies: + has "^1.0.1" + +is-retry-allowed@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" + integrity sha1-EaBgVotnM5REAz0BJaYaINVk+zQ= + +is-stream@^1.0.0, is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + +is-symbol@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" + integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw== + dependencies: + has-symbols "^1.0.0" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= + +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= + +isarray@1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= + +istanbul-api@^1.3.1: + version "1.3.7" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.3.7.tgz#a86c770d2b03e11e3f778cd7aedd82d2722092aa" + integrity sha512-4/ApBnMVeEPG3EkSzcw25wDe4N66wxwn+KKn6b47vyek8Xb3NBAcg4xfuQbS7BqcZuTX4wxfD5lVagdggR3gyA== + dependencies: + async "^2.1.4" + fileset "^2.0.2" + istanbul-lib-coverage "^1.2.1" + istanbul-lib-hook "^1.2.2" + istanbul-lib-instrument "^1.10.2" + istanbul-lib-report "^1.1.5" + istanbul-lib-source-maps "^1.2.6" + istanbul-reports "^1.5.1" + js-yaml "^3.7.0" + mkdirp "^0.5.1" + once "^1.4.0" + +istanbul-lib-coverage@^1.2.0, istanbul-lib-coverage@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz#ccf7edcd0a0bb9b8f729feeb0930470f9af664f0" + integrity sha512-PzITeunAgyGbtY1ibVIUiV679EFChHjoMNRibEIobvmrCRaIgwLxNucOSimtNWUhEib/oO7QY2imD75JVgCJWQ== + +istanbul-lib-hook@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.2.2.tgz#bc6bf07f12a641fbf1c85391d0daa8f0aea6bf86" + integrity sha512-/Jmq7Y1VeHnZEQ3TL10VHyb564mn6VrQXHchON9Jf/AEcmQ3ZIiyD1BVzNOKTZf/G3gE+kiGK6SmpF9y3qGPLw== + dependencies: + append-transform "^0.4.0" + +istanbul-lib-instrument@^1.10.1, istanbul-lib-instrument@^1.10.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.2.tgz#1f55ed10ac3c47f2bdddd5307935126754d0a9ca" + integrity sha512-aWHxfxDqvh/ZlxR8BBaEPVSWDPUkGD63VjGQn3jcw8jCp7sHEMKcrj4xfJn/ABzdMEHiQNyvDQhqm5o8+SQg7A== + dependencies: + babel-generator "^6.18.0" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + babylon "^6.18.0" + istanbul-lib-coverage "^1.2.1" + semver "^5.3.0" + +istanbul-lib-report@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.5.tgz#f2a657fc6282f96170aaf281eb30a458f7f4170c" + integrity sha512-UsYfRMoi6QO/doUshYNqcKJqVmFe9w51GZz8BS3WB0lYxAllQYklka2wP9+dGZeHYaWIdcXUx8JGdbqaoXRXzw== + dependencies: + istanbul-lib-coverage "^1.2.1" + mkdirp "^0.5.1" + path-parse "^1.0.5" + supports-color "^3.1.2" + +istanbul-lib-source-maps@^1.2.4, istanbul-lib-source-maps@^1.2.6: + version "1.2.6" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.6.tgz#37b9ff661580f8fca11232752ee42e08c6675d8f" + integrity sha512-TtbsY5GIHgbMsMiRw35YBHGpZ1DVFEO19vxxeiDMYaeOFOCzfnYVxvl6pOUIZR4dtPhAGpSMup8OyF8ubsaqEg== + dependencies: + debug "^3.1.0" + istanbul-lib-coverage "^1.2.1" + mkdirp "^0.5.1" + rimraf "^2.6.1" + source-map "^0.5.3" + +istanbul-reports@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.5.1.tgz#97e4dbf3b515e8c484caea15d6524eebd3ff4e1a" + integrity sha512-+cfoZ0UXzWjhAdzosCPP3AN8vvef8XDkWtTfgaN+7L3YTpNYITnCaEkceo5SEYy644VkHka/P1FvkWvrG/rrJw== + dependencies: + handlebars "^4.0.3" + +jest-changed-files@^23.4.2: + version "23.4.2" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-23.4.2.tgz#1eed688370cd5eebafe4ae93d34bb3b64968fe83" + integrity sha512-EyNhTAUWEfwnK0Is/09LxoqNDOn7mU7S3EHskG52djOFS/z+IT0jT3h3Ql61+dklcG7bJJitIWEMB4Sp1piHmA== + dependencies: + throat "^4.0.0" + +jest-cli@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-23.6.0.tgz#61ab917744338f443ef2baa282ddffdd658a5da4" + integrity sha512-hgeD1zRUp1E1zsiyOXjEn4LzRLWdJBV//ukAHGlx6s5mfCNJTbhbHjgxnDUXA8fsKWN/HqFFF6X5XcCwC/IvYQ== + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.1" + exit "^0.1.2" + glob "^7.1.2" + graceful-fs "^4.1.11" + import-local "^1.0.0" + is-ci "^1.0.10" + istanbul-api "^1.3.1" + istanbul-lib-coverage "^1.2.0" + istanbul-lib-instrument "^1.10.1" + istanbul-lib-source-maps "^1.2.4" + jest-changed-files "^23.4.2" + jest-config "^23.6.0" + jest-environment-jsdom "^23.4.0" + jest-get-type "^22.1.0" + jest-haste-map "^23.6.0" + jest-message-util "^23.4.0" + jest-regex-util "^23.3.0" + jest-resolve-dependencies "^23.6.0" + jest-runner "^23.6.0" + jest-runtime "^23.6.0" + jest-snapshot "^23.6.0" + jest-util "^23.4.0" + jest-validate "^23.6.0" + jest-watcher "^23.4.0" + jest-worker "^23.2.0" + micromatch "^2.3.11" + node-notifier "^5.2.1" + prompts "^0.1.9" + realpath-native "^1.0.0" + rimraf "^2.5.4" + slash "^1.0.0" + string-length "^2.0.0" + strip-ansi "^4.0.0" + which "^1.2.12" + yargs "^11.0.0" + +jest-config@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-23.6.0.tgz#f82546a90ade2d8c7026fbf6ac5207fc22f8eb1d" + integrity sha512-i8V7z9BeDXab1+VNo78WM0AtWpBRXJLnkT+lyT+Slx/cbP5sZJ0+NDuLcmBE5hXAoK0aUp7vI+MOxR+R4d8SRQ== + dependencies: + babel-core "^6.0.0" + babel-jest "^23.6.0" + chalk "^2.0.1" + glob "^7.1.1" + jest-environment-jsdom "^23.4.0" + jest-environment-node "^23.4.0" + jest-get-type "^22.1.0" + jest-jasmine2 "^23.6.0" + jest-regex-util "^23.3.0" + jest-resolve "^23.6.0" + jest-util "^23.4.0" + jest-validate "^23.6.0" + micromatch "^2.3.11" + pretty-format "^23.6.0" + +jest-diff@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-23.6.0.tgz#1500f3f16e850bb3d71233408089be099f610c7d" + integrity sha512-Gz9l5Ov+X3aL5L37IT+8hoCUsof1CVYBb2QEkOupK64XyRR3h+uRpYIm97K7sY8diFxowR8pIGEdyfMKTixo3g== + dependencies: + chalk "^2.0.1" + diff "^3.2.0" + jest-get-type "^22.1.0" + pretty-format "^23.6.0" + +jest-docblock@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-23.2.0.tgz#f085e1f18548d99fdd69b20207e6fd55d91383a7" + integrity sha1-8IXh8YVI2Z/dabICB+b9VdkTg6c= + dependencies: + detect-newline "^2.1.0" + +jest-each@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-23.6.0.tgz#ba0c3a82a8054387016139c733a05242d3d71575" + integrity sha512-x7V6M/WGJo6/kLoissORuvLIeAoyo2YqLOoCDkohgJ4XOXSqOtyvr8FbInlAWS77ojBsZrafbozWoKVRdtxFCg== + dependencies: + chalk "^2.0.1" + pretty-format "^23.6.0" + +jest-environment-jsdom@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-23.4.0.tgz#056a7952b3fea513ac62a140a2c368c79d9e6023" + integrity sha1-BWp5UrP+pROsYqFAosNox52eYCM= + dependencies: + jest-mock "^23.2.0" + jest-util "^23.4.0" + jsdom "^11.5.1" + +jest-environment-node@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-23.4.0.tgz#57e80ed0841dea303167cce8cd79521debafde10" + integrity sha1-V+gO0IQd6jAxZ8zozXlSHeuv3hA= + dependencies: + jest-mock "^23.2.0" + jest-util "^23.4.0" + +jest-get-type@^22.1.0: + version "22.4.3" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.4.3.tgz#e3a8504d8479342dd4420236b322869f18900ce4" + integrity sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w== + +jest-haste-map@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-23.6.0.tgz#2e3eb997814ca696d62afdb3f2529f5bbc935e16" + integrity sha512-uyNhMyl6dr6HaXGHp8VF7cK6KpC6G9z9LiMNsst+rJIZ8l7wY0tk8qwjPmEghczojZ2/ZhtEdIabZ0OQRJSGGg== + dependencies: + fb-watchman "^2.0.0" + graceful-fs "^4.1.11" + invariant "^2.2.4" + jest-docblock "^23.2.0" + jest-serializer "^23.0.1" + jest-worker "^23.2.0" + micromatch "^2.3.11" + sane "^2.0.0" + +jest-jasmine2@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-23.6.0.tgz#840e937f848a6c8638df24360ab869cc718592e0" + integrity sha512-pe2Ytgs1nyCs8IvsEJRiRTPC0eVYd8L/dXJGU08GFuBwZ4sYH/lmFDdOL3ZmvJR8QKqV9MFuwlsAi/EWkFUbsQ== + dependencies: + babel-traverse "^6.0.0" + chalk "^2.0.1" + co "^4.6.0" + expect "^23.6.0" + is-generator-fn "^1.0.0" + jest-diff "^23.6.0" + jest-each "^23.6.0" + jest-matcher-utils "^23.6.0" + jest-message-util "^23.4.0" + jest-snapshot "^23.6.0" + jest-util "^23.4.0" + pretty-format "^23.6.0" + +jest-leak-detector@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-23.6.0.tgz#e4230fd42cf381a1a1971237ad56897de7e171de" + integrity sha512-f/8zA04rsl1Nzj10HIyEsXvYlMpMPcy0QkQilVZDFOaPbv2ur71X5u2+C4ZQJGyV/xvVXtCCZ3wQ99IgQxftCg== + dependencies: + pretty-format "^23.6.0" + +jest-matcher-utils@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-23.6.0.tgz#726bcea0c5294261a7417afb6da3186b4b8cac80" + integrity sha512-rosyCHQfBcol4NsckTn01cdelzWLU9Cq7aaigDf8VwwpIRvWE/9zLgX2bON+FkEW69/0UuYslUe22SOdEf2nog== + dependencies: + chalk "^2.0.1" + jest-get-type "^22.1.0" + pretty-format "^23.6.0" + +jest-message-util@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-23.4.0.tgz#17610c50942349508d01a3d1e0bda2c079086a9f" + integrity sha1-F2EMUJQjSVCNAaPR4L2iwHkIap8= + dependencies: + "@babel/code-frame" "^7.0.0-beta.35" + chalk "^2.0.1" + micromatch "^2.3.11" + slash "^1.0.0" + stack-utils "^1.0.1" + +jest-mock@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-23.2.0.tgz#ad1c60f29e8719d47c26e1138098b6d18b261134" + integrity sha1-rRxg8p6HGdR8JuETgJi20YsmETQ= + +jest-regex-util@^23.3.0: + version "23.3.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-23.3.0.tgz#5f86729547c2785c4002ceaa8f849fe8ca471bc5" + integrity sha1-X4ZylUfCeFxAAs6qj4Sf6MpHG8U= + +jest-resolve-dependencies@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-23.6.0.tgz#b4526af24c8540d9a3fab102c15081cf509b723d" + integrity sha512-EkQWkFWjGKwRtRyIwRwI6rtPAEyPWlUC2MpzHissYnzJeHcyCn1Hc8j7Nn1xUVrS5C6W5+ZL37XTem4D4pLZdA== + dependencies: + jest-regex-util "^23.3.0" + jest-snapshot "^23.6.0" + +jest-resolve@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-23.6.0.tgz#cf1d1a24ce7ee7b23d661c33ba2150f3aebfa0ae" + integrity sha512-XyoRxNtO7YGpQDmtQCmZjum1MljDqUCob7XlZ6jy9gsMugHdN2hY4+Acz9Qvjz2mSsOnPSH7skBmDYCHXVZqkA== + dependencies: + browser-resolve "^1.11.3" + chalk "^2.0.1" + realpath-native "^1.0.0" + +jest-runner@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-23.6.0.tgz#3894bd219ffc3f3cb94dc48a4170a2e6f23a5a38" + integrity sha512-kw0+uj710dzSJKU6ygri851CObtCD9cN8aNkg8jWJf4ewFyEa6kwmiH/r/M1Ec5IL/6VFa0wnAk6w+gzUtjJzA== + dependencies: + exit "^0.1.2" + graceful-fs "^4.1.11" + jest-config "^23.6.0" + jest-docblock "^23.2.0" + jest-haste-map "^23.6.0" + jest-jasmine2 "^23.6.0" + jest-leak-detector "^23.6.0" + jest-message-util "^23.4.0" + jest-runtime "^23.6.0" + jest-util "^23.4.0" + jest-worker "^23.2.0" + source-map-support "^0.5.6" + throat "^4.0.0" + +jest-runtime@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-23.6.0.tgz#059e58c8ab445917cd0e0d84ac2ba68de8f23082" + integrity sha512-ycnLTNPT2Gv+TRhnAYAQ0B3SryEXhhRj1kA6hBPSeZaNQkJ7GbZsxOLUkwg6YmvWGdX3BB3PYKFLDQCAE1zNOw== + dependencies: + babel-core "^6.0.0" + babel-plugin-istanbul "^4.1.6" + chalk "^2.0.1" + convert-source-map "^1.4.0" + exit "^0.1.2" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.1.11" + jest-config "^23.6.0" + jest-haste-map "^23.6.0" + jest-message-util "^23.4.0" + jest-regex-util "^23.3.0" + jest-resolve "^23.6.0" + jest-snapshot "^23.6.0" + jest-util "^23.4.0" + jest-validate "^23.6.0" + micromatch "^2.3.11" + realpath-native "^1.0.0" + slash "^1.0.0" + strip-bom "3.0.0" + write-file-atomic "^2.1.0" + yargs "^11.0.0" + +jest-serializer@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-23.0.1.tgz#a3776aeb311e90fe83fab9e533e85102bd164165" + integrity sha1-o3dq6zEekP6D+rnlM+hRAr0WQWU= + +jest-snapshot@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-23.6.0.tgz#f9c2625d1b18acda01ec2d2b826c0ce58a5aa17a" + integrity sha512-tM7/Bprftun6Cvj2Awh/ikS7zV3pVwjRYU2qNYS51VZHgaAMBs5l4o/69AiDHhQrj5+LA2Lq4VIvK7zYk/bswg== + dependencies: + babel-types "^6.0.0" + chalk "^2.0.1" + jest-diff "^23.6.0" + jest-matcher-utils "^23.6.0" + jest-message-util "^23.4.0" + jest-resolve "^23.6.0" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + pretty-format "^23.6.0" + semver "^5.5.0" + +jest-util@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-23.4.0.tgz#4d063cb927baf0a23831ff61bec2cbbf49793561" + integrity sha1-TQY8uSe68KI4Mf9hvsLLv0l5NWE= + dependencies: + callsites "^2.0.0" + chalk "^2.0.1" + graceful-fs "^4.1.11" + is-ci "^1.0.10" + jest-message-util "^23.4.0" + mkdirp "^0.5.1" + slash "^1.0.0" + source-map "^0.6.0" + +jest-validate@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.6.0.tgz#36761f99d1ed33fcd425b4e4c5595d62b6597474" + integrity sha512-OFKapYxe72yz7agrDAWi8v2WL8GIfVqcbKRCLbRG9PAxtzF9b1SEDdTpytNDN12z2fJynoBwpMpvj2R39plI2A== + dependencies: + chalk "^2.0.1" + jest-get-type "^22.1.0" + leven "^2.1.0" + pretty-format "^23.6.0" + +jest-watcher@^23.4.0: + version "23.4.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-23.4.0.tgz#d2e28ce74f8dad6c6afc922b92cabef6ed05c91c" + integrity sha1-0uKM50+NrWxq/JIrksq+9u0FyRw= + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.1" + string-length "^2.0.0" + +jest-worker@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-23.2.0.tgz#faf706a8da36fae60eb26957257fa7b5d8ea02b9" + integrity sha1-+vcGqNo2+uYOsmlXJX+ntdjqArk= + dependencies: + merge-stream "^1.0.1" + +jest@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-23.6.0.tgz#ad5835e923ebf6e19e7a1d7529a432edfee7813d" + integrity sha512-lWzcd+HSiqeuxyhG+EnZds6iO3Y3ZEnMrfZq/OTGvF/C+Z4fPMCdhWTGSAiO2Oym9rbEXfwddHhh6jqrTF3+Lw== + dependencies: + import-local "^1.0.0" + jest-cli "^23.6.0" + +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= + +js-yaml@^3.12.0, js-yaml@^3.7.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" + integrity sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= + +jsdom@^11.5.1: + version "11.12.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8" + integrity sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw== + dependencies: + abab "^2.0.0" + acorn "^5.5.3" + acorn-globals "^4.1.0" + array-equal "^1.0.0" + cssom ">= 0.3.2 < 0.4.0" + cssstyle "^1.0.0" + data-urls "^1.0.0" + domexception "^1.0.1" + escodegen "^1.9.1" + html-encoding-sniffer "^1.0.2" + left-pad "^1.3.0" + nwsapi "^2.0.7" + parse5 "4.0.0" + pn "^1.1.0" + request "^2.87.0" + request-promise-native "^1.0.5" + sax "^1.2.4" + symbol-tree "^3.2.2" + tough-cookie "^2.3.4" + w3c-hr-time "^1.0.1" + webidl-conversions "^4.0.2" + whatwg-encoding "^1.0.3" + whatwg-mimetype "^2.1.0" + whatwg-url "^6.4.1" + ws "^5.2.0" + xml-name-validator "^3.0.0" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + integrity sha1-RsP+yMGJKxKwgz25vHYiF226s0s= + +json-parse-better-errors@^1.0.0, json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + +json5@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= + +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= + optionalDependencies: + graceful-fs "^4.1.6" + +jsonparse@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== + +kleur@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-2.0.2.tgz#b704f4944d95e255d038f0cb05fb8a602c55a300" + integrity sha512-77XF9iTllATmG9lSlIv0qdQ2BQ/h9t0bJllHlbvsQ0zUWfU7Yi0S8L5JXzPZgkefIiajLmBJJ4BsMJmqcf7oxQ== + +latest-version@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15" + integrity sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU= + dependencies: + package-json "^4.0.0" + +lazy-property@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lazy-property/-/lazy-property-1.0.0.tgz#84ddc4b370679ba8bd4cdcfa4c06b43d57111147" + integrity sha1-hN3Es3Bnm6i9TNz6TAa0PVcREUc= + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= + dependencies: + invert-kv "^1.0.0" + +left-pad@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" + integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA== + +leven@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + integrity sha1-wuep93IJTe6dNCAq6KzORoeHVYA= + +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +libcipm@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/libcipm/-/libcipm-2.0.2.tgz#4f38c2b37acf2ec156936cef1cbf74636568fc7b" + integrity sha512-9uZ6/LAflVEijksTRq/RX0e+pGA4mr8tND9Cmk2JMg7j2fFUBrs8PpFX2DOAJR/XoxPzz+5h8bkWmtIYLunKAg== + dependencies: + bin-links "^1.1.2" + bluebird "^3.5.1" + find-npm-prefix "^1.0.2" + graceful-fs "^4.1.11" + lock-verify "^2.0.2" + mkdirp "^0.5.1" + npm-lifecycle "^2.0.3" + npm-logical-tree "^1.2.1" + npm-package-arg "^6.1.0" + pacote "^8.1.6" + protoduck "^5.0.0" + read-package-json "^2.0.13" + rimraf "^2.6.2" + worker-farm "^1.6.0" + +libnpmhook@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/libnpmhook/-/libnpmhook-4.0.1.tgz#63641654de772cbeb96a88527a7fd5456ec3c2d7" + integrity sha512-3qqpfqvBD1712WA6iGe0stkG40WwAeoWcujA6BlC0Be1JArQbqwabnEnZ0CRcD05Tf1fPYJYdCbSfcfedEJCOg== + dependencies: + figgy-pudding "^3.1.0" + npm-registry-fetch "^3.0.0" + +libnpx@^10.2.0: + version "10.2.0" + resolved "https://registry.yarnpkg.com/libnpx/-/libnpx-10.2.0.tgz#1bf4a1c9f36081f64935eb014041da10855e3102" + integrity sha512-X28coei8/XRCt15cYStbLBph+KGhFra4VQhRBPuH/HHMkC5dxM8v24RVgUsvODKCrUZ0eTgiTqJp6zbl0sskQQ== + dependencies: + dotenv "^5.0.1" + npm-package-arg "^6.0.0" + rimraf "^2.6.2" + safe-buffer "^5.1.0" + update-notifier "^2.3.0" + which "^1.3.0" + y18n "^4.0.0" + yargs "^11.0.0" + +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + integrity sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA= + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +lock-verify@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/lock-verify/-/lock-verify-2.0.2.tgz#148e4f85974915c9e3c34d694b7de9ecb18ee7a8" + integrity sha512-QNVwK0EGZBS4R3YQ7F1Ox8p41Po9VGl2QG/2GsuvTbkJZYSsPeWHKMbbH6iZMCHWSMww5nrJroZYnGzI4cePuw== + dependencies: + npm-package-arg "^5.1.2 || 6" + semver "^5.4.1" + +lockfile@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lockfile/-/lockfile-1.0.4.tgz#07f819d25ae48f87e538e6578b6964a4981a5609" + integrity sha512-cvbTwETRfsFh4nHsL1eGWapU1XFi5Ot9E85sWAwia7Y7EgB7vfqcZhTKZ+l7hCGxSPoushMv5GKhT5PdLv03WA== + dependencies: + signal-exit "^3.0.2" + +lodash._baseuniq@~4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8" + integrity sha1-DrtE5FaBSveQXGIS+iybLVG4Qeg= + dependencies: + lodash._createset "~4.0.0" + lodash._root "~3.0.0" + +lodash._createset@~4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26" + integrity sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY= + +lodash._root@~3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" + integrity sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI= + +lodash.clonedeep@~4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= + +lodash.sortby@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" + integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= + +lodash.union@~4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.union/-/lodash.union-4.6.0.tgz#48bb5088409f16f1821666641c44dd1aaae3cd88" + integrity sha1-SLtQiECfFvGCFmZkHETdGqrjzYg= + +lodash.uniq@~4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" + integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= + +lodash.without@~4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.without/-/lodash.without-4.4.0.tgz#3cd4574a00b67bae373a94b748772640507b7aac" + integrity sha1-PNRXSgC2e643OpS3SHcmQFB7eqw= + +lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.4, lodash@^4.17.5: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== + +log-symbols@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" + integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== + dependencies: + chalk "^2.0.1" + +loose-envify@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +lowercase-keys@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" + integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== + +lru-cache@^4.0.1, lru-cache@^4.1.1, lru-cache@^4.1.2, lru-cache@^4.1.3: + version "4.1.5" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" + integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + +lru-cache@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== + dependencies: + yallist "^3.0.2" + +make-dir@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" + integrity sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ== + dependencies: + pify "^3.0.0" + +"make-fetch-happen@^2.5.0 || 3 || 4", make-fetch-happen@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-4.0.1.tgz#141497cb878f243ba93136c83d8aba12c216c083" + integrity sha512-7R5ivfy9ilRJ1EMKIOziwrns9fGeAD4bAha8EB7BIiBBLHm2KeTUGCrICFt2rbHfzheTLynv50GnNTK1zDTrcQ== + dependencies: + agentkeepalive "^3.4.1" + cacache "^11.0.1" + http-cache-semantics "^3.8.1" + http-proxy-agent "^2.1.0" + https-proxy-agent "^2.2.1" + lru-cache "^4.1.2" + mississippi "^3.0.0" + node-fetch-npm "^2.0.2" + promise-retry "^1.1.1" + socks-proxy-agent "^4.0.0" + ssri "^6.0.0" + +make-fetch-happen@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-3.0.0.tgz#7b661d2372fc4710ab5cc8e1fa3c290eea69a961" + integrity sha512-FmWY7gC0mL6Z4N86vE14+m719JKE4H0A+pyiOH18B025gF/C113pyfb4gHDDYP5cqnRMHOz06JGdmffC/SES+w== + dependencies: + agentkeepalive "^3.4.1" + cacache "^10.0.4" + http-cache-semantics "^3.8.1" + http-proxy-agent "^2.1.0" + https-proxy-agent "^2.2.0" + lru-cache "^4.1.2" + mississippi "^3.0.0" + node-fetch-npm "^2.0.2" + promise-retry "^1.1.1" + socks-proxy-agent "^3.0.1" + ssri "^5.2.4" + +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + integrity sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw= + dependencies: + tmpl "1.0.x" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= + dependencies: + object-visit "^1.0.0" + +math-random@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" + integrity sha1-izqsWIuKZuSXXjzepn97sylgH6w= + +meant@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/meant/-/meant-1.0.1.tgz#66044fea2f23230ec806fb515efea29c44d2115d" + integrity sha512-UakVLFjKkbbUwNWJ2frVLnnAtbb7D7DsloxRd3s/gDpI8rdv8W5Hp3NaDb+POBI1fQdeussER6NB8vpcRURvlg== + +mem@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + integrity sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y= + dependencies: + mimic-fn "^1.0.0" + +merge-stream@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" + integrity sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE= + dependencies: + readable-stream "^2.0.1" + +merge@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.1.tgz#38bebf80c3220a8a487b6fcfb3941bb11720c145" + integrity sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ== + +micromatch@^2.3.11: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +micromatch@^3.1.4: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +mime-db@~1.37.0: + version "1.37.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.37.0.tgz#0b6a0ce6fdbe9576e25f1f2d2fde8830dc0ad0d8" + integrity sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg== + +mime-types@^2.1.12, mime-types@~2.1.19: + version "2.1.21" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.21.tgz#28995aa1ecb770742fe6ae7e58f9181c744b3f96" + integrity sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg== + dependencies: + mime-db "~1.37.0" + +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== + +minimatch@^3.0.3, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= + +minimist@^1.1.1, minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= + +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= + +minipass@^2.2.1, minipass@^2.3.3, minipass@^2.3.4: + version "2.3.5" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" + integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== + dependencies: + safe-buffer "^5.1.2" + yallist "^3.0.0" + +minizlib@^1.1.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" + integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== + dependencies: + minipass "^2.2.1" + +mississippi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-2.0.0.tgz#3442a508fafc28500486feea99409676e4ee5a6f" + integrity sha512-zHo8v+otD1J10j/tC+VNoGK9keCuByhKovAvdn74dmxJl9+mWHnx6EMsDN4lgRoMI/eYo2nchAxniIbUPb5onw== + dependencies: + concat-stream "^1.5.0" + duplexify "^3.4.2" + end-of-stream "^1.1.0" + flush-write-stream "^1.0.0" + from2 "^2.1.0" + parallel-transform "^1.1.0" + pump "^2.0.1" + pumpify "^1.3.3" + stream-each "^1.1.0" + through2 "^2.0.0" + +mississippi@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022" + integrity sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA== + dependencies: + concat-stream "^1.5.0" + duplexify "^3.4.2" + end-of-stream "^1.1.0" + flush-write-stream "^1.0.0" + from2 "^2.1.0" + parallel-transform "^1.1.0" + pump "^3.0.0" + pumpify "^1.3.3" + stream-each "^1.1.0" + through2 "^2.0.0" + +mixin-deep@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= + dependencies: + minimist "0.0.8" + +move-concurrently@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" + integrity sha1-viwAX9oy4LKa8fBdfEszIUxwH5I= + dependencies: + aproba "^1.1.1" + copy-concurrently "^1.0.0" + fs-write-stream-atomic "^1.0.8" + mkdirp "^0.5.1" + rimraf "^2.5.4" + run-queue "^1.0.3" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@^2.0.0, ms@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= + +mute-stream@~0.0.4: + version "0.0.8" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" + integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== + +nan@^2.9.2: + version "2.12.1" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.12.1.tgz#7b1aa193e9aa86057e3c7bbd0ac448e770925552" + integrity sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw== + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + +needle@^2.2.1: + version "2.2.4" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e" + integrity sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA== + dependencies: + debug "^2.1.2" + iconv-lite "^0.4.4" + sax "^1.2.4" + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + +node-fetch-npm@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz#7258c9046182dca345b4208eda918daf33697ff7" + integrity sha512-nJIxm1QmAj4v3nfCvEeCrYSoVwXyxLnaPBK5W1W5DGEJwjlKuC2VEUycGw5oxk+4zZahRrB84PUJJgEmhFTDFw== + dependencies: + encoding "^0.1.11" + json-parse-better-errors "^1.0.0" + safe-buffer "^5.1.1" + +node-gyp@^3.8.0: + version "3.8.0" + resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.8.0.tgz#540304261c330e80d0d5edce253a68cb3964218c" + integrity sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA== + dependencies: + fstream "^1.0.0" + glob "^7.0.3" + graceful-fs "^4.1.2" + mkdirp "^0.5.0" + nopt "2 || 3" + npmlog "0 || 1 || 2 || 3 || 4" + osenv "0" + request "^2.87.0" + rimraf "2" + semver "~5.3.0" + tar "^2.0.0" + which "1" + +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= + +node-notifier@^5.2.1: + version "5.3.0" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.3.0.tgz#c77a4a7b84038733d5fb351aafd8a268bfe19a01" + integrity sha512-AhENzCSGZnZJgBARsUjnQ7DnZbzyP+HxlVXuD0xqAnvL8q+OqtSX7lGg9e8nHzwXkMMXNdVeqq4E2M3EUAqX6Q== + dependencies: + growly "^1.3.0" + semver "^5.5.0" + shellwords "^0.1.1" + which "^1.3.0" + +node-pre-gyp@^0.10.0: + version "0.10.3" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" + integrity sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A== + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.1" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.2.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4" + +"nopt@2 || 3": + version "3.0.6" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" + integrity sha1-xkZdvwirzU2zWTF/eaxopkayj/k= + dependencies: + abbrev "1" + +nopt@^4.0.1, nopt@~4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= + dependencies: + abbrev "1" + osenv "^0.1.4" + +normalize-package-data@^2.0.0, normalize-package-data@^2.3.2, normalize-package-data@^2.4.0, "normalize-package-data@~1.0.1 || ^2.0.0", normalize-package-data@~2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" + integrity sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw== + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.0.1, normalize-path@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= + dependencies: + remove-trailing-separator "^1.0.1" + +npm-audit-report@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/npm-audit-report/-/npm-audit-report-1.3.2.tgz#303bc78cd9e4c226415076a4f7e528c89fc77018" + integrity sha512-abeqS5ONyXNaZJPGAf6TOUMNdSe1Y6cpc9MLBRn+CuUoYbfdca6AxOyXVlfIv9OgKX+cacblbG5w7A6ccwoTPw== + dependencies: + cli-table3 "^0.5.0" + console-control-strings "^1.1.0" + +npm-bundled@^1.0.1: + version "1.0.5" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" + integrity sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g== + +npm-cache-filename@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/npm-cache-filename/-/npm-cache-filename-1.0.2.tgz#ded306c5b0bfc870a9e9faf823bc5f283e05ae11" + integrity sha1-3tMGxbC/yHCp6fr4I7xfKD4FrhE= + +npm-install-checks@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/npm-install-checks/-/npm-install-checks-3.0.0.tgz#d4aecdfd51a53e3723b7b2f93b2ee28e307bc0d7" + integrity sha1-1K7N/VGlPjcjt7L5Oy7ijjB7wNc= + dependencies: + semver "^2.3.0 || 3.x || 4 || 5" + +npm-lifecycle@^2.0.3, npm-lifecycle@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/npm-lifecycle/-/npm-lifecycle-2.1.0.tgz#1eda2eedb82db929e3a0c50341ab0aad140ed569" + integrity sha512-QbBfLlGBKsktwBZLj6AviHC6Q9Y3R/AY4a2PYSIRhSKSS0/CxRyD/PfxEX6tPeOCXQgMSNdwGeECacstgptc+g== + dependencies: + byline "^5.0.0" + graceful-fs "^4.1.11" + node-gyp "^3.8.0" + resolve-from "^4.0.0" + slide "^1.1.6" + uid-number "0.0.6" + umask "^1.1.0" + which "^1.3.1" + +npm-logical-tree@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/npm-logical-tree/-/npm-logical-tree-1.2.1.tgz#44610141ca24664cad35d1e607176193fd8f5b88" + integrity sha512-AJI/qxDB2PWI4LG1CYN579AY1vCiNyWfkiquCsJWqntRu/WwimVrC8yXeILBFHDwxfOejxewlmnvW9XXjMlYIg== + +"npm-package-arg@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0", "npm-package-arg@^4.0.0 || ^5.0.0 || ^6.0.0", "npm-package-arg@^5.1.2 || 6", npm-package-arg@^6.0.0, npm-package-arg@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-6.1.0.tgz#15ae1e2758a5027efb4c250554b85a737db7fcc1" + integrity sha512-zYbhP2k9DbJhA0Z3HKUePUgdB1x7MfIfKssC+WLPFMKTBZKpZh5m13PgexJjCq6KW7j17r0jHWcCpxEqnnncSA== + dependencies: + hosted-git-info "^2.6.0" + osenv "^0.1.5" + semver "^5.5.0" + validate-npm-package-name "^3.0.0" + +npm-packlist@^1.1.10, npm-packlist@^1.1.12, npm-packlist@^1.1.6: + version "1.2.0" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.2.0.tgz#55a60e793e272f00862c7089274439a4cc31fc7f" + integrity sha512-7Mni4Z8Xkx0/oegoqlcao/JpPCPEMtUvsmB0q7mgvlMinykJLSRTYuFqoQLYgGY8biuxIeiHO+QNJKbCfljewQ== + dependencies: + ignore-walk "^3.0.1" + npm-bundled "^1.0.1" + +npm-pick-manifest@^2.1.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/npm-pick-manifest/-/npm-pick-manifest-2.2.3.tgz#32111d2a9562638bb2c8f2bf27f7f3092c8fae40" + integrity sha512-+IluBC5K201+gRU85vFlUwX3PFShZAbAgDNp2ewJdWMVSppdo/Zih0ul2Ecky/X7b51J7LrrUAP+XOmOCvYZqA== + dependencies: + figgy-pudding "^3.5.1" + npm-package-arg "^6.0.0" + semver "^5.4.1" + +npm-profile@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/npm-profile/-/npm-profile-3.0.2.tgz#58d568f1b56ef769602fd0aed8c43fa0e0de0f57" + integrity sha512-rEJOFR6PbwOvvhGa2YTNOJQKNuc6RovJ6T50xPU7pS9h/zKPNCJ+VHZY2OFXyZvEi+UQYtHRTp8O/YM3tUD20A== + dependencies: + aproba "^1.1.2 || 2" + make-fetch-happen "^2.5.0 || 3 || 4" + +npm-registry-client@^8.6.0: + version "8.6.0" + resolved "https://registry.yarnpkg.com/npm-registry-client/-/npm-registry-client-8.6.0.tgz#7f1529f91450732e89f8518e0f21459deea3e4c4" + integrity sha512-Qs6P6nnopig+Y8gbzpeN/dkt+n7IyVd8f45NTMotGk6Qo7GfBmzwYx6jRLoOOgKiMnaQfYxsuyQlD8Mc3guBhg== + dependencies: + concat-stream "^1.5.2" + graceful-fs "^4.1.6" + normalize-package-data "~1.0.1 || ^2.0.0" + npm-package-arg "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" + once "^1.3.3" + request "^2.74.0" + retry "^0.10.0" + safe-buffer "^5.1.1" + semver "2 >=2.2.1 || 3.x || 4 || 5" + slide "^1.1.3" + ssri "^5.2.4" + optionalDependencies: + npmlog "2 || ^3.1.0 || ^4.0.0" + +npm-registry-fetch@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-1.1.1.tgz#710bc5947d9ee2c549375072dab6d5d17baf2eb2" + integrity sha512-ev+zxOXsgAqRsR8Rk+ErjgWOlbrXcqGdme94/VNdjDo1q8TSy10Pp8xgDv/ZmMk2jG/KvGtXUNG4GS3+l6xbDw== + dependencies: + bluebird "^3.5.1" + figgy-pudding "^3.0.0" + lru-cache "^4.1.2" + make-fetch-happen "^3.0.0" + npm-package-arg "^6.0.0" + safe-buffer "^5.1.1" + +npm-registry-fetch@^3.0.0: + version "3.8.0" + resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-3.8.0.tgz#aa7d9a7c92aff94f48dba0984bdef4bd131c88cc" + integrity sha512-hrw8UMD+Nob3Kl3h8Z/YjmKamb1gf7D1ZZch2otrIXM3uFLB5vjEY6DhMlq80z/zZet6eETLbOXcuQudCB3Zpw== + dependencies: + JSONStream "^1.3.4" + bluebird "^3.5.1" + figgy-pudding "^3.4.1" + lru-cache "^4.1.3" + make-fetch-happen "^4.0.1" + npm-package-arg "^6.1.0" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= + dependencies: + path-key "^2.0.0" + +npm-user-validate@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/npm-user-validate/-/npm-user-validate-1.0.0.tgz#8ceca0f5cea04d4e93519ef72d0557a75122e951" + integrity sha1-jOyg9c6gTU6TUZ73LQVXp1Ei6VE= + +npm@^6.5.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/npm/-/npm-6.5.0.tgz#30ed48d4cd4d17d68ee04a5fcf9fa2ca9167d819" + integrity sha512-SPq8zG2Kto+Xrq55E97O14Jla13PmQT5kSnvwBj88BmJZ5Nvw++OmlWfhjkB67pcgP5UEXljEtnGFKZtOgt6MQ== + dependencies: + JSONStream "^1.3.4" + abbrev "~1.1.1" + ansicolors "~0.3.2" + ansistyles "~0.1.3" + aproba "~1.2.0" + archy "~1.0.0" + bin-links "^1.1.2" + bluebird "^3.5.3" + byte-size "^4.0.3" + cacache "^11.2.0" + call-limit "~1.1.0" + chownr "~1.0.1" + ci-info "^1.6.0" + cli-columns "^3.1.2" + cli-table3 "^0.5.0" + cmd-shim "~2.0.2" + columnify "~1.5.4" + config-chain "^1.1.12" + detect-indent "~5.0.0" + detect-newline "^2.1.0" + dezalgo "~1.0.3" + editor "~1.0.0" + figgy-pudding "^3.5.1" + find-npm-prefix "^1.0.2" + fs-vacuum "~1.2.10" + fs-write-stream-atomic "~1.0.10" + gentle-fs "^2.0.1" + glob "^7.1.3" + graceful-fs "^4.1.15" + has-unicode "~2.0.1" + hosted-git-info "^2.7.1" + iferr "^1.0.2" + inflight "~1.0.6" + inherits "~2.0.3" + ini "^1.3.5" + init-package-json "^1.10.3" + is-cidr "^2.0.6" + json-parse-better-errors "^1.0.2" + lazy-property "~1.0.0" + libcipm "^2.0.2" + libnpmhook "^4.0.1" + libnpx "^10.2.0" + lock-verify "^2.0.2" + lockfile "^1.0.4" + lodash._baseuniq "~4.6.0" + lodash.clonedeep "~4.5.0" + lodash.union "~4.6.0" + lodash.uniq "~4.5.0" + lodash.without "~4.4.0" + lru-cache "^4.1.3" + meant "~1.0.1" + mississippi "^3.0.0" + mkdirp "~0.5.1" + move-concurrently "^1.0.1" + node-gyp "^3.8.0" + nopt "~4.0.1" + normalize-package-data "~2.4.0" + npm-audit-report "^1.3.1" + npm-cache-filename "~1.0.2" + npm-install-checks "~3.0.0" + npm-lifecycle "^2.1.0" + npm-package-arg "^6.1.0" + npm-packlist "^1.1.12" + npm-pick-manifest "^2.1.0" + npm-profile "^3.0.2" + npm-registry-client "^8.6.0" + npm-registry-fetch "^1.1.0" + npm-user-validate "~1.0.0" + npmlog "~4.1.2" + once "~1.4.0" + opener "^1.5.1" + osenv "^0.1.5" + pacote "^8.1.6" + path-is-inside "~1.0.2" + promise-inflight "~1.0.1" + qrcode-terminal "^0.12.0" + query-string "^6.1.0" + qw "~1.0.1" + read "~1.0.7" + read-cmd-shim "~1.0.1" + read-installed "~4.0.3" + read-package-json "^2.0.13" + read-package-tree "^5.2.1" + readable-stream "^2.3.6" + request "^2.88.0" + retry "^0.12.0" + rimraf "~2.6.2" + safe-buffer "^5.1.2" + semver "^5.5.1" + sha "~2.0.1" + slide "~1.1.6" + sorted-object "~2.0.1" + sorted-union-stream "~2.1.3" + ssri "^6.0.1" + stringify-package "^1.0.0" + tar "^4.4.8" + text-table "~0.2.0" + tiny-relative-date "^1.3.0" + uid-number "0.0.6" + umask "~1.1.0" + unique-filename "~1.1.0" + unpipe "~1.0.0" + update-notifier "^2.5.0" + uuid "^3.3.2" + validate-npm-package-license "^3.0.4" + validate-npm-package-name "~3.0.0" + which "^1.3.1" + worker-farm "^1.6.0" + write-file-atomic "^2.3.0" + +"npmlog@0 || 1 || 2 || 3 || 4", "npmlog@2 || ^3.1.0 || ^4.0.0", npmlog@^4.0.2, npmlog@~4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + +nwsapi@^2.0.7: + version "2.0.9" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.0.9.tgz#77ac0cdfdcad52b6a1151a84e73254edc33ed016" + integrity sha512-nlWFSCTYQcHk/6A9FFnfhKc14c3aFhfdNBXgo8Qgi9QTBu/qg3Ww+Uiz9wMzXd1T8GFxPc2QIHB6Qtf2XFryFQ== + +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== + +object-assign@^4.0.1, object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-keys@^1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" + integrity sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag== + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= + dependencies: + isobject "^3.0.0" + +object.getownpropertydescriptors@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" + integrity sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY= + dependencies: + define-properties "^1.1.2" + es-abstract "^1.5.1" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= + dependencies: + isobject "^3.0.1" + +once@^1.3.0, once@^1.3.1, once@^1.3.3, once@^1.4.0, once@~1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= + dependencies: + mimic-fn "^1.0.0" + +opener@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.1.tgz#6d2f0e77f1a0af0032aca716c2c1fbb8e7e8abed" + integrity sha512-goYSy5c2UXE4Ra1xixabeVh1guIX/ZV/YokJksb6q2lubWu6UbvPQ20p542/sFIll1nl8JnCyK9oBaOcCWXwvA== + +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +optionator@^0.8.1, optionator@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +ora@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ora/-/ora-3.0.0.tgz#8179e3525b9aafd99242d63cc206fd64732741d0" + integrity sha512-LBS97LFe2RV6GJmXBi6OKcETKyklHNMV0xw7BtsVn2MlsgsydyZetSCbCANr+PFLmDyv4KV88nn0eCKza665Mg== + dependencies: + chalk "^2.3.1" + cli-cursor "^2.1.0" + cli-spinners "^1.1.0" + log-symbols "^2.2.0" + strip-ansi "^4.0.0" + wcwidth "^1.0.1" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= + +os-locale@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" + integrity sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA== + dependencies: + execa "^0.7.0" + lcid "^1.0.0" + mem "^1.1.0" + +os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + +osenv@0, osenv@^0.1.4, osenv@^0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" + integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= + +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + dependencies: + p-limit "^1.1.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + +package-json@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/package-json/-/package-json-4.0.1.tgz#8869a0401253661c4c4ca3da6c2121ed555f5eed" + integrity sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0= + dependencies: + got "^6.7.1" + registry-auth-token "^3.0.1" + registry-url "^3.0.3" + semver "^5.1.0" + +pacote@^8.1.6: + version "8.1.6" + resolved "https://registry.yarnpkg.com/pacote/-/pacote-8.1.6.tgz#8e647564d38156367e7a9dc47a79ca1ab278d46e" + integrity sha512-wTOOfpaAQNEQNtPEx92x9Y9kRWVu45v583XT8x2oEV2xRB74+xdqMZIeGW4uFvAyZdmSBtye+wKdyyLaT8pcmw== + dependencies: + bluebird "^3.5.1" + cacache "^11.0.2" + get-stream "^3.0.0" + glob "^7.1.2" + lru-cache "^4.1.3" + make-fetch-happen "^4.0.1" + minimatch "^3.0.4" + minipass "^2.3.3" + mississippi "^3.0.0" + mkdirp "^0.5.1" + normalize-package-data "^2.4.0" + npm-package-arg "^6.1.0" + npm-packlist "^1.1.10" + npm-pick-manifest "^2.1.0" + osenv "^0.1.5" + promise-inflight "^1.0.1" + promise-retry "^1.1.1" + protoduck "^5.0.0" + rimraf "^2.6.2" + safe-buffer "^5.1.2" + semver "^5.5.0" + ssri "^6.0.0" + tar "^4.4.3" + unique-filename "^1.1.0" + which "^1.3.0" + +parallel-transform@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/parallel-transform/-/parallel-transform-1.1.0.tgz#d410f065b05da23081fcd10f28854c29bda33b06" + integrity sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY= + dependencies: + cyclist "~0.2.2" + inherits "^2.0.3" + readable-stream "^2.1.5" + +parent-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.0.tgz#df250bdc5391f4a085fb589dad761f5ad6b865b5" + integrity sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA== + dependencies: + callsites "^3.0.0" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= + dependencies: + error-ex "^1.2.0" + +parse5@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" + integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA== + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= + dependencies: + pinkie-promise "^2.0.0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-is-inside@^1.0.1, path-is-inside@^1.0.2, path-is-inside@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= + +path-key@^2.0.0, path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + +path-parse@^1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + integrity sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE= + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= + +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= + +pkg-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= + dependencies: + find-up "^2.1.0" + +pluralize@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" + integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow== + +pn@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" + integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= + +prepend-http@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" + integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= + +prettier@^1.15.3: + version "1.15.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.15.3.tgz#1feaac5bdd181237b54dbe65d874e02a1472786a" + integrity sha512-gAU9AGAPMaKb3NNSUUuhhFAS7SCO4ALTN4nRIn6PJ075Qd28Yn2Ig2ahEJWdJwJmlEBTUfC7mMUSFy8MwsOCfg== + +pretty-format@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.6.0.tgz#5eaac8eeb6b33b987b7fe6097ea6a8a146ab5760" + integrity sha512-zf9NV1NSlDLDjycnwm6hpFATCGl/K1lt0R/GdkAK2O5LN/rwJoB+Mh93gGJjut4YbmecbfgLWVGSTCr0Ewvvbw== + dependencies: + ansi-regex "^3.0.0" + ansi-styles "^3.2.0" + +private@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== + +process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== + +progress@^2.0.0, progress@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + +promise-inflight@^1.0.1, promise-inflight@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" + integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM= + +promise-retry@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/promise-retry/-/promise-retry-1.1.1.tgz#6739e968e3051da20ce6497fb2b50f6911df3d6d" + integrity sha1-ZznpaOMFHaIM5kl/srUPaRHfPW0= + dependencies: + err-code "^1.0.0" + retry "^0.10.0" + +prompts@^0.1.9: + version "0.1.14" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-0.1.14.tgz#a8e15c612c5c9ec8f8111847df3337c9cbd443b2" + integrity sha512-rxkyiE9YH6zAz/rZpywySLKkpaj0NMVyNw1qhsubdbjjSgcayjTShDreZGlFMcGSu5sab3bAKPfFk78PB90+8w== + dependencies: + kleur "^2.0.1" + sisteransi "^0.1.1" + +promzard@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/promzard/-/promzard-0.3.0.tgz#26a5d6ee8c7dee4cb12208305acfb93ba382a9ee" + integrity sha1-JqXW7ox97kyxIggwWs+5O6OCqe4= + dependencies: + read "1" + +proto-list@~1.2.1: + version "1.2.4" + resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" + integrity sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk= + +protoduck@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/protoduck/-/protoduck-5.0.1.tgz#03c3659ca18007b69a50fd82a7ebcc516261151f" + integrity sha512-WxoCeDCoCBY55BMvj4cAEjdVUFGRWed9ZxPlqTKYyw1nDDTQ4pqmnIMAGfJlg7Dx35uB/M+PHJPTmGOvaCaPTg== + dependencies: + genfun "^5.0.0" + +prr@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" + integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= + +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= + +psl@^1.1.24, psl@^1.1.28: + version "1.1.31" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" + integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw== + +pump@^2.0.0, pump@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" + integrity sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pumpify@^1.3.3: + version "1.5.1" + resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" + integrity sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ== + dependencies: + duplexify "^3.6.0" + inherits "^2.0.3" + pump "^2.0.0" + +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= + +punycode@^2.1.0, punycode@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +qrcode-terminal@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz#bb5b699ef7f9f0505092a3748be4464fe71b5819" + integrity sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ== + +qs@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + +query-string@^6.1.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.2.0.tgz#468edeb542b7e0538f9f9b1aeb26f034f19c86e1" + integrity sha512-5wupExkIt8RYL4h/FE+WTg3JHk62e6fFPWtAZA9J5IWK1PfTfKkMS93HBUHcFpeYi9KsY5pFbh+ldvEyaz5MyA== + dependencies: + decode-uri-component "^0.2.0" + strict-uri-encode "^2.0.0" + +qw@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/qw/-/qw-1.0.1.tgz#efbfdc740f9ad054304426acb183412cc8b996d4" + integrity sha1-77/cdA+a0FQwRCassYNBLMi5ltQ= + +randomatic@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" + integrity sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw== + dependencies: + is-number "^4.0.0" + kind-of "^6.0.0" + math-random "^1.0.1" + +rc@^1.0.1, rc@^1.1.6, rc@^1.2.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +read-cmd-shim@^1.0.1, read-cmd-shim@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.1.tgz#2d5d157786a37c055d22077c32c53f8329e91c7b" + integrity sha1-LV0Vd4ajfAVdIgd8MsU/gynpHHs= + dependencies: + graceful-fs "^4.1.2" + +read-installed@~4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/read-installed/-/read-installed-4.0.3.tgz#ff9b8b67f187d1e4c29b9feb31f6b223acd19067" + integrity sha1-/5uLZ/GH0eTCm5/rMfayI6zRkGc= + dependencies: + debuglog "^1.0.1" + read-package-json "^2.0.0" + readdir-scoped-modules "^1.0.0" + semver "2 || 3 || 4 || 5" + slide "~1.1.3" + util-extend "^1.0.1" + optionalDependencies: + graceful-fs "^4.1.2" + +"read-package-json@1 || 2", read-package-json@^2.0.0, read-package-json@^2.0.13: + version "2.0.13" + resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-2.0.13.tgz#2e82ebd9f613baa6d2ebe3aa72cefe3f68e41f4a" + integrity sha512-/1dZ7TRZvGrYqE0UAfN6qQb5GYBsNcqS1C0tNK601CFOJmtHI7NIGXwetEPU/OtoFHZL3hDxm4rolFFVE9Bnmg== + dependencies: + glob "^7.1.1" + json-parse-better-errors "^1.0.1" + normalize-package-data "^2.0.0" + slash "^1.0.0" + optionalDependencies: + graceful-fs "^4.1.2" + +read-package-tree@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/read-package-tree/-/read-package-tree-5.2.1.tgz#6218b187d6fac82289ce4387bbbaf8eef536ad63" + integrity sha512-2CNoRoh95LxY47LvqrehIAfUVda2JbuFE/HaGYs42bNrGG+ojbw1h3zOcPcQ+1GQ3+rkzNndZn85u1XyZ3UsIA== + dependencies: + debuglog "^1.0.1" + dezalgo "^1.0.0" + once "^1.3.0" + read-package-json "^2.0.0" + readdir-scoped-modules "^1.0.0" + +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + integrity sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI= + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + integrity sha1-9f+qXs0pyzHAR0vKfXVra7KePyg= + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +read@1, read@~1.0.1, read@~1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" + integrity sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ= + dependencies: + mute-stream "~0.0.4" + +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.6, readable-stream@~2.3.6: + version "2.3.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@~1.1.10: + version "1.1.14" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" + integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readdir-scoped-modules@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.0.2.tgz#9fafa37d286be5d92cbaebdee030dc9b5f406747" + integrity sha1-n6+jfShr5dksuuve4DDcm19AZ0c= + dependencies: + debuglog "^1.0.1" + dezalgo "^1.0.0" + graceful-fs "^4.1.2" + once "^1.3.0" + +realpath-native@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.0.2.tgz#cd51ce089b513b45cf9b1516c82989b51ccc6560" + integrity sha512-+S3zTvVt9yTntFrBpm7TQmQ3tzpCrnA1a/y+3cUHAc9ZR6aIjG0WNLR+Rj79QpJktY+VeW/TQtFlQ1bzsehI8g== + dependencies: + util.promisify "^1.0.0" + +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== + +regex-cache@^0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== + dependencies: + is-equal-shallow "^0.1.3" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +regexpp@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== + +registry-auth-token@^3.0.1: + version "3.3.2" + resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.3.2.tgz#851fd49038eecb586911115af845260eec983f20" + integrity sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ== + dependencies: + rc "^1.1.6" + safe-buffer "^5.0.1" + +registry-url@^3.0.3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-3.1.0.tgz#3d4ef870f73dde1d77f0cf9a381432444e174942" + integrity sha1-PU74cPc93h138M+aOBQyRE4XSUI= + dependencies: + rc "^1.0.1" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= + +repeat-element@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== + +repeat-string@^1.5.2, repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= + dependencies: + is-finite "^1.0.0" + +request-promise-core@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6" + integrity sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY= + dependencies: + lodash "^4.13.1" + +request-promise-native@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.5.tgz#5281770f68e0c9719e5163fd3fab482215f4fda5" + integrity sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU= + dependencies: + request-promise-core "1.1.1" + stealthy-require "^1.1.0" + tough-cookie ">=2.3.3" + +request@^2.74.0, request@^2.87.0, request@^2.88.0: + version "2.88.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.0" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.4.3" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= + +resolve-cwd@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" + integrity sha1-AKn3OHVW4nA46uIyyqNypqWbZlo= + dependencies: + resolve-from "^3.0.0" + +resolve-from@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" + integrity sha1-six699nWiBvItuZTM17rywoYh0g= + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= + +resolve@1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= + +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== + +retry@^0.10.0: + version "0.10.1" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4" + integrity sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q= + +retry@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" + integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs= + +rimraf@2, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@~2.6.2: + version "2.6.3" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== + dependencies: + glob "^7.1.3" + +rsvp@^3.3.3: + version "3.6.2" + resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-3.6.2.tgz#2e96491599a96cde1b515d5674a8f7a91452926a" + integrity sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw== + +run-async@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" + integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= + dependencies: + is-promise "^2.1.0" + +run-queue@^1.0.0, run-queue@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" + integrity sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec= + dependencies: + aproba "^1.1.1" + +rxjs@^6.1.0: + version "6.3.3" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.3.tgz#3c6a7fa420e844a81390fb1158a9ec614f4bad55" + integrity sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw== + dependencies: + tslib "^1.9.0" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= + dependencies: + ret "~0.1.10" + +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +sane@^2.0.0: + version "2.5.2" + resolved "https://registry.yarnpkg.com/sane/-/sane-2.5.2.tgz#b4dc1861c21b427e929507a3e751e2a2cb8ab3fa" + integrity sha1-tNwYYcIbQn6SlQej51HiosuKs/o= + dependencies: + anymatch "^2.0.0" + capture-exit "^1.2.0" + exec-sh "^0.2.0" + fb-watchman "^2.0.0" + micromatch "^3.1.4" + minimist "^1.1.1" + walker "~1.0.5" + watch "~0.18.0" + optionalDependencies: + fsevents "^1.2.3" + +sax@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== + +semver-diff@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" + integrity sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY= + dependencies: + semver "^5.0.3" + +"semver@2 >=2.2.1 || 3.x || 4 || 5", "semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", "semver@^2.3.0 || 3.x || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + +semver@~5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" + integrity sha1-myzl094C0XxgEq0yaqa00M9U+U8= + +set-blocking@^2.0.0, set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + +set-value@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.1" + to-object-path "^0.3.0" + +set-value@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +sha@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/sha/-/sha-2.0.1.tgz#6030822fbd2c9823949f8f72ed6411ee5cf25aae" + integrity sha1-YDCCL70smCOUn49y7WQR7lzyWq4= + dependencies: + graceful-fs "^4.1.2" + readable-stream "^2.0.2" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + +shellwords@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" + integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== + +signal-exit@^3.0.0, signal-exit@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= + +sisteransi@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-0.1.1.tgz#5431447d5f7d1675aac667ccd0b865a4994cb3ce" + integrity sha512-PmGOd02bM9YO5ifxpw36nrNMBTptEtfRl4qUYl9SndkolplkrZZOW7PGHjrZL53QvMVj9nQ+TKqUnRsw4tJa4g== + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= + +slice-ansi@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.0.0.tgz#5373bdb8559b45676e8541c66916cdd6251612e7" + integrity sha512-4j2WTWjp3GsZ+AOagyzVbzp4vWGtZ0hEZ/gDY/uTvm6MTxUfTUIsnMIFb1bn8o0RuXiqUw15H1bue8f22Vw2oQ== + dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" + is-fullwidth-code-point "^2.0.0" + +slide@^1.1.3, slide@^1.1.6, slide@~1.1.3, slide@~1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" + integrity sha1-VusCfWW00tzmyy4tMsTUr8nh1wc= + +smart-buffer@^1.0.13: + version "1.1.15" + resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-1.1.15.tgz#7f114b5b65fab3e2a35aa775bb12f0d1c649bf16" + integrity sha1-fxFLW2X6s+KjWqd1uxLw0cZJvxY= + +smart-buffer@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.0.1.tgz#07ea1ca8d4db24eb4cac86537d7d18995221ace3" + integrity sha512-RFqinRVJVcCAL9Uh1oVqE6FZkqsyLiVOYEZ20TqIOjuX7iFVJ+zsbs4RIghnw/pTs7mZvt8ZHhvm1ZUrR4fykg== + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +socks-proxy-agent@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-3.0.1.tgz#2eae7cf8e2a82d34565761539a7f9718c5617659" + integrity sha512-ZwEDymm204mTzvdqyUqOdovVr2YRd2NYskrYrF2LXyZ9qDiMAoFESGK8CRphiO7rtbo2Y757k2Nia3x2hGtalA== + dependencies: + agent-base "^4.1.0" + socks "^1.1.10" + +socks-proxy-agent@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-4.0.1.tgz#5936bf8b707a993079c6f37db2091821bffa6473" + integrity sha512-Kezx6/VBguXOsEe5oU3lXYyKMi4+gva72TwJ7pQY5JfqUx2nMk7NXA6z/mpNqIlfQjWYVfeuNvQjexiTaTn6Nw== + dependencies: + agent-base "~4.2.0" + socks "~2.2.0" + +socks@^1.1.10: + version "1.1.10" + resolved "https://registry.yarnpkg.com/socks/-/socks-1.1.10.tgz#5b8b7fc7c8f341c53ed056e929b7bf4de8ba7b5a" + integrity sha1-W4t/x8jzQcU+0FbpKbe/Tei6e1o= + dependencies: + ip "^1.1.4" + smart-buffer "^1.0.13" + +socks@~2.2.0: + version "2.2.2" + resolved "https://registry.yarnpkg.com/socks/-/socks-2.2.2.tgz#f061219fc2d4d332afb4af93e865c84d3fa26e2b" + integrity sha512-g6wjBnnMOZpE0ym6e0uHSddz9p3a+WsBaaYQaBaSCJYvrC4IXykQR9MNGjLQf38e9iIIhp3b1/Zk8YZI3KGJ0Q== + dependencies: + ip "^1.1.5" + smart-buffer "^4.0.1" + +sorted-object@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/sorted-object/-/sorted-object-2.0.1.tgz#7d631f4bd3a798a24af1dffcfbfe83337a5df5fc" + integrity sha1-fWMfS9OnmKJK8d/8+/6DM3pd9fw= + +sorted-union-stream@~2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/sorted-union-stream/-/sorted-union-stream-2.1.3.tgz#c7794c7e077880052ff71a8d4a2dbb4a9a638ac7" + integrity sha1-x3lMfgd4gAUv9xqNSi27Sppjisc= + dependencies: + from2 "^1.3.0" + stream-iterate "^1.1.0" + +source-map-resolve@^0.5.0: + version "0.5.2" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" + integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== + dependencies: + atob "^2.1.1" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-support@^0.4.15: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + integrity sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA== + dependencies: + source-map "^0.5.6" + +source-map-support@^0.5.6: + version "0.5.9" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" + integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= + +source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +spdx-correct@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" + integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" + integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== + +spdx-expression-parse@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz#81c0ce8f21474756148bbb5f3bfc0f36bf15d76e" + integrity sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g== + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== + dependencies: + extend-shallow "^3.0.0" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + +sshpk@^1.7.0: + version "1.16.0" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.0.tgz#1d4963a2fbffe58050aa9084ca20be81741c07de" + integrity sha512-Zhev35/y7hRMcID/upReIvRse+I9SVhyVre/KTJSJQWMz3C3+G+HpO7m1wK/yckEtujKZ7dS4hkVxAnmHaIGVQ== + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + +ssri@^5.2.4: + version "5.3.0" + resolved "https://registry.yarnpkg.com/ssri/-/ssri-5.3.0.tgz#ba3872c9c6d33a0704a7d71ff045e5ec48999d06" + integrity sha512-XRSIPqLij52MtgoQavH/x/dU1qVKtWUAAZeOHsR9c2Ddi4XerFy3mc1alf+dLJKl9EUIm/Ht+EowFkTUOA6GAQ== + dependencies: + safe-buffer "^5.1.1" + +ssri@^6.0.0, ssri@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.1.tgz#2a3c41b28dd45b62b63676ecb74001265ae9edd8" + integrity sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA== + dependencies: + figgy-pudding "^3.5.1" + +stack-utils@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8" + integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA== + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +stealthy-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= + +stream-each@^1.1.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae" + integrity sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw== + dependencies: + end-of-stream "^1.1.0" + stream-shift "^1.0.0" + +stream-iterate@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/stream-iterate/-/stream-iterate-1.2.0.tgz#2bd7c77296c1702a46488b8ad41f79865eecd4e1" + integrity sha1-K9fHcpbBcCpGSIuK1B95hl7s1OE= + dependencies: + readable-stream "^2.1.5" + stream-shift "^1.0.0" + +stream-shift@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" + integrity sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI= + +strict-uri-encode@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" + integrity sha1-ucczDHBChi9rFC3CdLvMWGbONUY= + +string-length@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" + integrity sha1-1A27aGo6zpYMHP/KVivyxF+DY+0= + dependencies: + astral-regex "^1.0.0" + strip-ansi "^4.0.0" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +stringify-package@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/stringify-package/-/stringify-package-1.0.0.tgz#e02828089333d7d45cd8c287c30aa9a13375081b" + integrity sha512-JIQqiWmLiEozOC0b0BtxZ/AOUtdUZHCBPgqIZ2kSJJqGwgb9neo44XdTHUC4HZSGqi03hOeB7W/E8rAlKnGe9g== + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + +strip-ansi@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.0.0.tgz#f78f68b5d0866c20b2c9b8c61b5298508dc8756f" + integrity sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow== + dependencies: + ansi-regex "^4.0.0" + +strip-bom@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= + dependencies: + is-utf8 "^0.2.0" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= + +strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= + +supports-color@^3.1.2: + version "3.2.3" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" + integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY= + dependencies: + has-flag "^1.0.0" + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +symbol-tree@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" + integrity sha1-rifbOPZgp64uHDt9G8KQgZuFGeY= + +table@^5.0.2: + version "5.1.1" + resolved "https://registry.yarnpkg.com/table/-/table-5.1.1.tgz#92030192f1b7b51b6eeab23ed416862e47b70837" + integrity sha512-NUjapYb/qd4PeFW03HnAuOJ7OMcBkJlqeClWxeNlQ0lXGSb52oZXGzkO0/I0ARegQ2eUT1g2VDJH0eUxDRcHmw== + dependencies: + ajv "^6.6.1" + lodash "^4.17.11" + slice-ansi "2.0.0" + string-width "^2.1.1" + +tar@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" + integrity sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE= + dependencies: + block-stream "*" + fstream "^1.0.2" + inherits "2" + +tar@^4, tar@^4.4.3, tar@^4.4.8: + version "4.4.8" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" + integrity sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ== + dependencies: + chownr "^1.1.1" + fs-minipass "^1.2.5" + minipass "^2.3.4" + minizlib "^1.1.1" + mkdirp "^0.5.0" + safe-buffer "^5.1.2" + yallist "^3.0.2" + +term-size@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/term-size/-/term-size-1.2.0.tgz#458b83887f288fc56d6fffbfad262e26638efa69" + integrity sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk= + dependencies: + execa "^0.7.0" + +test-exclude@^4.2.1: + version "4.2.3" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.3.tgz#a9a5e64474e4398339245a0a769ad7c2f4a97c20" + integrity sha512-SYbXgY64PT+4GAL2ocI3HwPa4Q4TBKm0cwAVeKOt/Aoc0gSpNRjJX8w0pA1LMKZ3LBmd8pYBqApFNQLII9kavA== + dependencies: + arrify "^1.0.1" + micromatch "^2.3.11" + object-assign "^4.1.0" + read-pkg-up "^1.0.1" + require-main-filename "^1.0.1" + +text-table@^0.2.0, text-table@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= + +throat@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" + integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo= + +through2@^2.0.0: + version "2.0.5" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" + integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== + dependencies: + readable-stream "~2.3.6" + xtend "~4.0.1" + +"through@>=2.2.7 <3", through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + +timed-out@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" + integrity sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8= + +tiny-relative-date@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/tiny-relative-date/-/tiny-relative-date-1.3.0.tgz#fa08aad501ed730f31cc043181d995c39a935e07" + integrity sha512-MOQHpzllWxDCHHaDno30hhLfbouoYlOI8YlMNtvKe1zXbjEVhbcEovQxvZrPvtiYW630GQDoMMarCnjfyfHA+A== + +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + +tmpl@1.0.x: + version "1.0.4" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= + +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +tough-cookie@>=2.3.3, tough-cookie@^2.3.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + +tough-cookie@~2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== + dependencies: + psl "^1.1.24" + punycode "^1.4.1" + +tr46@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" + integrity sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk= + dependencies: + punycode "^2.1.0" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= + +tslib@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= + dependencies: + prelude-ls "~1.1.2" + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= + +typescript@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.2.tgz#fe8101c46aa123f8353523ebdcf5730c2ae493e5" + integrity sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg== + +uglify-js@^3.1.4: + version "3.4.9" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.9.tgz#af02f180c1207d76432e473ed24a28f4a782bae3" + integrity sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q== + dependencies: + commander "~2.17.1" + source-map "~0.6.1" + +uid-number@0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" + integrity sha1-DqEOgDXo61uOREnwbaHHMGY7qoE= + +umask@^1.1.0, umask@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/umask/-/umask-1.1.0.tgz#f29cebf01df517912bb58ff9c4e50fde8e33320d" + integrity sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0= + +union-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^0.4.3" + +unique-filename@^1.1.0, unique-filename@^1.1.1, unique-filename@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" + integrity sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ== + dependencies: + unique-slug "^2.0.0" + +unique-slug@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-2.0.1.tgz#5e9edc6d1ce8fb264db18a507ef9bd8544451ca6" + integrity sha512-n9cU6+gITaVu7VGj1Z8feKMmfAjEAQGhwD9fE3zvpRRa0wEIx8ODYkVGfSc94M2OX00tUFV8wH3zYbm1I8mxFg== + dependencies: + imurmurhash "^0.1.4" + +unique-string@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-1.0.0.tgz#9e1057cca851abb93398f8b33ae187b99caec11a" + integrity sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo= + dependencies: + crypto-random-string "^1.0.0" + +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + +unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +unzip-response@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" + integrity sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c= + +update-notifier@^2.3.0, update-notifier@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.5.0.tgz#d0744593e13f161e406acb1d9408b72cad08aff6" + integrity sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw== + dependencies: + boxen "^1.2.1" + chalk "^2.0.1" + configstore "^3.0.0" + import-lazy "^2.1.0" + is-ci "^1.0.10" + is-installed-globally "^0.1.0" + is-npm "^1.0.0" + latest-version "^3.0.0" + semver-diff "^2.0.0" + xdg-basedir "^3.0.0" + +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== + dependencies: + punycode "^2.1.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= + +url-parse-lax@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" + integrity sha1-evjzA2Rem9eaJy56FKxovAYJ2nM= + dependencies: + prepend-http "^1.0.1" + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +util-extend@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/util-extend/-/util-extend-1.0.3.tgz#a7c216d267545169637b3b6edc6ca9119e2ff93f" + integrity sha1-p8IW0mdUUWljeztu3GypEZ4v+T8= + +util.promisify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" + integrity sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA== + dependencies: + define-properties "^1.1.2" + object.getownpropertydescriptors "^2.0.3" + +uuid@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== + +validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +validate-npm-package-name@^3.0.0, validate-npm-package-name@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz#5fa912d81eb7d0c74afc140de7317f0ca7df437e" + integrity sha1-X6kS2B630MdK/BQN5zF/DKffQ34= + dependencies: + builtins "^1.0.3" + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +w3c-hr-time@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" + integrity sha1-gqwr/2PZUOqeMYmlimViX+3xkEU= + dependencies: + browser-process-hrtime "^0.1.2" + +walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= + dependencies: + makeerror "1.0.x" + +watch@~0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/watch/-/watch-0.18.0.tgz#28095476c6df7c90c963138990c0a5423eb4b986" + integrity sha1-KAlUdsbffJDJYxOJkMClQj60uYY= + dependencies: + exec-sh "^0.2.0" + minimist "^1.2.0" + +wcwidth@^1.0.0, wcwidth@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" + integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g= + dependencies: + defaults "^1.0.3" + +webidl-conversions@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" + integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== + +whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: + version "1.0.5" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" + integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== + dependencies: + iconv-lite "0.4.24" + +whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" + integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== + +whatwg-url@^6.4.1: + version "6.5.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" + integrity sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ== + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + +whatwg-url@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd" + integrity sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ== + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + +which@1, which@^1.2.12, which@^1.2.9, which@^1.3.0, which@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +wide-align@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== + dependencies: + string-width "^1.0.2 || 2" + +widest-line@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-2.0.1.tgz#7438764730ec7ef4381ce4df82fb98a53142a3fc" + integrity sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA== + dependencies: + string-width "^2.1.1" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= + +worker-farm@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.6.0.tgz#aecc405976fab5a95526180846f0dba288f3a4a0" + integrity sha512-6w+3tHbM87WnSWnENBUvA2pxJPLhQUg5LKwUQHq3r+XPhIM+Gh2R5ycbwPCyuGbNg+lPgdcnQUhuC02kJCvffQ== + dependencies: + errno "~0.1.7" + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +write-file-atomic@^2.0.0, write-file-atomic@^2.1.0, write-file-atomic@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.3.0.tgz#1ff61575c2e2a4e8e510d6fa4e243cce183999ab" + integrity sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA== + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + signal-exit "^3.0.2" + +write@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" + integrity sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c= + dependencies: + mkdirp "^0.5.1" + +ws@^5.2.0: + version "5.2.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" + integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== + dependencies: + async-limiter "~1.0.0" + +xdg-basedir@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" + integrity sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ= + +xml-name-validator@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" + integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== + +xtend@~4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68= + +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= + +y18n@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" + integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== + +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= + +yallist@^3.0.0, yallist@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" + integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== + +yargs-parser@^9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" + integrity sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc= + dependencies: + camelcase "^4.1.0" + +yargs@^11.0.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" + integrity sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A== + dependencies: + cliui "^4.0.0" + decamelize "^1.1.1" + find-up "^2.1.0" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1" + yargs-parser "^9.0.2" From d0ed60388d4964d76fafdf3b118e4e3cb6de15d0 Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Sat, 5 Jan 2019 16:50:30 -0800 Subject: [PATCH 36/44] logout and list are now working. --- app-cli/built/commands/captainduckduck.js | 16 +++---- app-cli/built/commands/captainduckduck.js.map | 2 +- app-cli/built/commands/list.js | 18 +++++++ app-cli/built/commands/list.js.map | 1 + app-cli/built/commands/login.js | 2 +- app-cli/built/commands/login.js.map | 2 +- app-cli/built/commands/logout.js | 47 +++++++++++++++++++ app-cli/built/commands/logout.js.map | 1 + app-cli/built/utils/CliHelper.js | 23 +++++++++ app-cli/built/utils/CliHelper.js.map | 2 +- app-cli/built/utils/StorageHelper.js | 7 +++ app-cli/built/utils/StorageHelper.js.map | 2 +- app-cli/src/commands/captainduckduck.ts | 20 ++++---- app-cli/src/commands/list.ts | 22 +++++++++ app-cli/src/commands/login.ts | 2 +- app-cli/src/commands/logout.ts | 43 +++++++++++++++++ app-cli/src/utils/CliHelper.ts | 27 +++++++++++ app-cli/src/utils/StorageHelper.ts | 9 ++++ 18 files changed, 222 insertions(+), 24 deletions(-) create mode 100755 app-cli/built/commands/list.js create mode 100755 app-cli/built/commands/list.js.map create mode 100755 app-cli/built/commands/logout.js create mode 100755 app-cli/built/commands/logout.js.map create mode 100644 app-cli/src/commands/list.ts create mode 100644 app-cli/src/commands/logout.ts diff --git a/app-cli/built/commands/captainduckduck.js b/app-cli/built/commands/captainduckduck.js index 5808263..93b7873 100755 --- a/app-cli/built/commands/captainduckduck.js +++ b/app-cli/built/commands/captainduckduck.js @@ -8,10 +8,10 @@ const StdOutUtil_1 = require("../utils/StdOutUtil"); const program = require("commander"); // Command actions const login_1 = require("./login"); +const list_1 = require("./list"); +const logout_1 = require("./logout"); // import serversetup = require('./serversetup'); -// import list = require('./list'); // import deploy = require('./deploy'); -// import logout = require('./logout'); // Setup program.version(packagejson.version).description(packagejson.description); // Commands @@ -21,18 +21,18 @@ program .action(() => { login_1.default(); }); +program.command('list').alias('ls').description('List all Captain machines currently logged in.').action(() => { + list_1.default(); +}); +program.command('logout').description('Logout from a specific Captain machine.').action(() => { + logout_1.default(); +}); // program // .command('serversetup') // .description('Performs necessary actions and prepares your Captain server.') // .action(() => { // serversetup(); // }); -// program.command('logout').description('Logout from a specific Captain machine.').action(() => { -// logout(); -// }); -// program.command('list').alias('ls').description('List all Captain machines currently logged in.').action(() => { -// list(); -// }); // program // .command('deploy') // .description( diff --git a/app-cli/built/commands/captainduckduck.js.map b/app-cli/built/commands/captainduckduck.js.map index 6ace441..0573891 100755 --- a/app-cli/built/commands/captainduckduck.js.map +++ b/app-cli/built/commands/captainduckduck.js.map @@ -1 +1 @@ -{"version":3,"file":"captainduckduck.js","sourceRoot":"","sources":["../../src/commands/captainduckduck.ts"],"names":[],"mappings":";;;AAEA,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAClD,kDAAkD;AAClD,cAAc,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAEhE,oDAA6C;AAC7C,qCAAqC;AAErC,kBAAkB;AAClB,mCAA4B;AAC5B,iDAAiD;AACjD,mCAAmC;AACnC,uCAAuC;AACvC,uCAAuC;AAEvC,QAAQ;AACR,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;AAE1E,WAAW;AAEX,OAAO;KACL,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,+FAA+F,CAAC;KAC5G,MAAM,CAAC,GAAG,EAAE;IACZ,eAAK,EAAE,CAAC;AACT,CAAC,CAAC,CAAC;AAEJ,UAAU;AACV,2BAA2B;AAC3B,gFAAgF;AAChF,mBAAmB;AACnB,mBAAmB;AACnB,OAAO;AAEP,kGAAkG;AAClG,aAAa;AACb,MAAM;AAEN,mHAAmH;AACnH,WAAW;AACX,MAAM;AAEN,UAAU;AACV,sBAAsB;AACtB,iBAAiB;AACjB,4HAA4H;AAC5H,KAAK;AACL,mGAAmG;AACnG,wDAAwD;AACxD,sDAAsD;AACtD,yFAAyF;AACzF,gFAAgF;AAChF,kFAAkF;AAClF,4FAA4F;AAC5F,+BAA+B;AAC/B,qBAAqB;AACrB,OAAO;AAEP,4BAA4B;AAC5B,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;IAC5B,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CA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B,gFAAgF;AAChF,mBAAmB;AACnB,mBAAmB;AACnB,OAAO;AAEP,UAAU;AACV,sBAAsB;AACtB,iBAAiB;AACjB,4HAA4H;AAC5H,KAAK;AACL,mGAAmG;AACnG,wDAAwD;AACxD,sDAAsD;AACtD,yFAAyF;AACzF,gFAAgF;AAChF,kFAAkF;AAClF,4FAA4F;AAC5F,+BAA+B;AAC/B,qBAAqB;AACrB,OAAO;AAEP,4BAA4B;AAC5B,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;IAC5B,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE7C,oBAAU,CAAC,UAAU,CAAC,sBAAsB,aAAa,gDAAgD,EAAE,IAAI,CAAC,CAAC;AAClH,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/list.js b/app-cli/built/commands/list.js new file mode 100755 index 0000000..cd23c01 --- /dev/null +++ b/app-cli/built/commands/list.js @@ -0,0 +1,18 @@ +#!/usr/bin/env node +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const chalk_1 = require("chalk"); +const StdOutUtil_1 = require("../utils/StdOutUtil"); +const StorageHelper_1 = require("../utils/StorageHelper"); +function _displayMachine(machine) { + console.log('>> ' + chalk_1.default.greenBright(machine.name) + ' at ' + chalk_1.default.cyan(machine.baseUrl)); +} +function list() { + StdOutUtil_1.default.printMessage('\nLogged in Captain Machines:\n'); + StorageHelper_1.default.get().getMachines().map((machine) => { + _displayMachine(machine); + }); + StdOutUtil_1.default.printMessage(''); +} +exports.default = list; +//# sourceMappingURL=list.js.map \ No newline at end of file diff --git a/app-cli/built/commands/list.js.map b/app-cli/built/commands/list.js.map new file mode 100755 index 0000000..244b33a --- /dev/null +++ b/app-cli/built/commands/list.js.map @@ -0,0 +1 @@ +{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":";;;AAEA,iCAA0B;AAC1B,oDAA6C;AAC7C,0DAAmD;AAGnD,SAAS,eAAe,CAAC,OAAiB;IACzC,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,eAAK,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,eAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7F,CAAC;AAED,SAAS,IAAI;IACZ,oBAAU,CAAC,YAAY,CAAC,iCAAiC,CAAC,CAAC;IAE3D,uBAAa,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QACjD,eAAe,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,oBAAU,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;AAC7B,CAAC;AAED,kBAAe,IAAI,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/login.js b/app-cli/built/commands/login.js index d0e21a2..c11874f 100755 --- a/app-cli/built/commands/login.js +++ b/app-cli/built/commands/login.js @@ -120,7 +120,7 @@ function login() { baseUrl, name: captainName }).getAuthToken(captainPassword); - StdOutUtil_1.default.printGreenMessage(`Logged in successfully to ${baseUrl}`); + StdOutUtil_1.default.printGreenMessage(`\nLogged in successfully to ${baseUrl}`); StdOutUtil_1.default.printGreenMessage(`Authorization token is now saved as ${captainName} \n`); } catch (error) { diff --git a/app-cli/built/commands/login.js.map b/app-cli/built/commands/login.js.map index 3af487b..cad383c 100755 --- a/app-cli/built/commands/login.js.map +++ b/app-cli/built/commands/login.js.map @@ -1 +1 @@ -{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,qCAAqC;AACrC,oDAA6C;AAC7C,0DAAmD;AACnD,kDAA2C;AAC3C,0CAAmC;AACnC,kDAA2C;AAE3C,wD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CAAC;QACpF,MAAM,UAAU,GAAG,iBAAiB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;QAC9D,MAAM,OAAO,GAAG,GAAG,UAAU,GAAG,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;QAE7D,IAAI;YACH,MAAM,aAAa,GAAG,MAAM,uBAAa,CAAC,GAAG,CAAC;gBAC7C,SAAS,EAAE,EAAE;gBACb,OAAO;gBACP,IAAI,EAAE,WAAW;aACjB,CAAC,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;YAEjC,oBAAU,CAAC,iBAAiB,CAAC,6BAA6B,OAAO,EAAE,CAAC,CAAC;YACrE,oBAAU,CAAC,iBAAiB,CAAC,uCAAuC,WAAW,KAAK,CAAC,CAAC;SACtF;QAAC,OAAO,KAAK,EAAE;YACf,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;YAE3D,oBAAU,CAAC,UAAU,CAAC,wCAAwC,WAAW,OAAO,YAAY,EAAE,CAAC,CAAC;SAChG;IACF,CAAC;CAAA;AAED,kBAAe,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,qCAAqC;AACrC,oDAA6C;AAC7C,0DAAmD;AACnD,kDAA2C;AAC3C,0CAAmC;AACnC,kDAA2C;AAE3C,wDAAiD;AAEjD,MAAM,aAAa,GAAG,mBAAS,CAAC,aAAa,CAAC;AAC9C,MAAM,UAAU,GAAG,eAAK,CAAC,UAAU,CAAC;AAEpC,iDAAiD;AACjD,mFAAmF;AACnF,2DAA2D;AAC3D,+CAA+C;AAE/C,+BAA+B;AAC/B,kCAAkC;AAClC,wDAAwD;AAExD,8EAA8E;AAE9E,uBAAuB;AACvB,MAAM;AACN,uBAAuB;AACvB,8BAA8B;AAC9B,2DAA2D;AAC3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aACjB,CAAC,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;YAEjC,oBAAU,CAAC,iBAAiB,CAAC,+BAA+B,OAAO,EAAE,CAAC,CAAC;YACvE,oBAAU,CAAC,iBAAiB,CAAC,uCAAuC,WAAW,KAAK,CAAC,CAAC;SACtF;QAAC,OAAO,KAAK,EAAE;YACf,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;YAE3D,oBAAU,CAAC,UAAU,CAAC,wCAAwC,WAAW,OAAO,YAAY,EAAE,CAAC,CAAC;SAChG;IACF,CAAC;CAAA;AAED,kBAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/logout.js b/app-cli/built/commands/logout.js new file mode 100755 index 0000000..67e1000 --- /dev/null +++ b/app-cli/built/commands/logout.js @@ -0,0 +1,47 @@ +#!/usr/bin/env node +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const inquirer = require("inquirer"); +const StdOutUtil_1 = require("../utils/StdOutUtil"); +const CliHelper_1 = require("../utils/CliHelper"); +function generateQuestions() { + const listOfMachines = CliHelper_1.default.get().getMachinesAsOptions(); + return [ + { + type: 'list', + name: 'captainNameToLogout', + message: 'Select the Captain Machine you want to logout from:', + choices: listOfMachines + }, + { + type: 'confirm', + name: 'confirmedToLogout', + message: 'Are you sure you want to logout from this Captain machine?', + default: false, + when: (answers) => answers.captainNameToLogout + } + ]; +} +function logout() { + return __awaiter(this, void 0, void 0, function* () { + const questions = generateQuestions(); + StdOutUtil_1.default.printMessage('Logout from a Captain Machine and clear auth info'); + const answers = yield inquirer.prompt(questions); + const { captainNameToLogout, confirmedToLogout } = answers; + if (!captainNameToLogout || !confirmedToLogout) { + StdOutUtil_1.default.printMessage('\nOperation cancelled by the user...\n'); + return; + } + CliHelper_1.default.get().logoutMachine(captainNameToLogout); + }); +} +exports.default = logout; +//# sourceMappingURL=logout.js.map \ No newline at end of file diff --git a/app-cli/built/commands/logout.js.map b/app-cli/built/commands/logout.js.map new file mode 100755 index 0000000..68707c5 --- /dev/null +++ b/app-cli/built/commands/logout.js.map @@ -0,0 +1 @@ +{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../src/commands/logout.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,qCAAqC;AACrC,oDAA6C;AAC7C,kDAA2C;AAE3C,SAAS,iBAAiB;IACzB,MAAM,cAAc,GAAG,mBAAS,CAAC,GAAG,EAAE,CAAC,oBAAoB,EAAE,CAAC;IAE9D,OAAO;QACN;YACC,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,qBAAqB;YAC3B,OAAO,EAAE,qDAAqD;YAC9D,OAAO,EAAE,cAAc;SACvB;QACD;YACC,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,mBAAmB;YACzB,OAAO,EAAE,4DAA4D;YACrE,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,CAAC,OAAY,EAAE,EAAE,CAAC,OAAO,CAAC,mBAAmB;SACnD;KACD,CAAC;AACH,CAAC;AAED,SAAe,MAAM;;QACpB,MAAM,SAAS,GAAG,iBAAiB,EAAE,CAAC;QAEtC,oBAAU,CAAC,YAAY,CAAC,mDAAmD,CAAC,CAAC;QAE7E,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACjD,MAAM,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC;QAE3D,IAAI,CAAC,mBAAmB,IAAI,CAAC,iBAAiB,EAAE;YAC/C,oBAAU,CAAC,YAAY,CAAC,wCAAwC,CAAC,CAAC;YAClE,OAAO;SACP;QAED,mBAAS,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC;IACpD,CAAC;CAAA;AAED,kBAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/app-cli/built/utils/CliHelper.js b/app-cli/built/utils/CliHelper.js index e0269e7..0ba307a 100755 --- a/app-cli/built/utils/CliHelper.js +++ b/app-cli/built/utils/CliHelper.js @@ -1,12 +1,35 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const StorageHelper_1 = require("./StorageHelper"); +const StdOutUtil_1 = require("./StdOutUtil"); class CliHelper { static get() { if (!CliHelper.instance) CliHelper.instance = new CliHelper(); return CliHelper.instance; } + getMachinesAsOptions() { + const machines = StorageHelper_1.default.get().getMachines(); + const firstItemInOption = [ + { + name: '-- CANCEL --', + value: '', + short: '' + } + ]; + const listOfMachines = machines.map((machine) => { + return { + name: `${machine.name} at ${machine.baseUrl}`, + value: `${machine.name}`, + short: `${machine.name} at ${machine.baseUrl}` + }; + }); + return [...firstItemInOption, ...listOfMachines]; + } + logoutMachine(machineName) { + const removedMachine = StorageHelper_1.default.get().removeMachine(machineName); + StdOutUtil_1.default.printMessage(`You are now logged out from ${removedMachine.name} at ${removedMachine.baseUrl}...\n`); + } findDefaultCaptainName() { let currentSuffix = StorageHelper_1.default.get().getMachines().length + 1; const self = this; diff --git a/app-cli/built/utils/CliHelper.js.map b/app-cli/built/utils/CliHelper.js.map index 8a8a684..ed55c3d 100755 --- a/app-cli/built/utils/CliHelper.js.map +++ b/app-cli/built/utils/CliHelper.js.map @@ -1 +1 @@ -{"version":3,"file":"CliHelper.js","sourceRoot":"","sources":["../../src/utils/CliHelper.ts"],"names":[],"mappings":";;AAAA,mDAA4C;AAG5C,MAAqB,SAAS;IAG7B,MAAM,CAAC,GAAG;QACT,IAAI,CAAC,SAAS,CAAC,QAAQ;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G,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;QAEzD,OAAO,WAAW,YAAY,EAAE,CAAC;IAClC,CAAC;IAED,aAAa,CAAC,YAAoB;QACjC,MAAM,IAAI,GAAG,IAAI,CAAC;QAClB,IAAI,KAAK,GAAG,IAAI,CAAC;QACjB,uBAAa,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,CAAC,OAAiB,EAAE,EAAE;YAC3D,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,EAAE;gBAC3D,KAAK,GAAG,KAAK,CAAC;aACd;QACF,CAAC,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACd,CAAC;CACD;AA9DD,4BA8DC"} \ No newline at end of file diff --git a/app-cli/built/utils/StorageHelper.js b/app-cli/built/utils/StorageHelper.js index d0338a2..5c5ce1b 100755 --- a/app-cli/built/utils/StorageHelper.js +++ b/app-cli/built/utils/StorageHelper.js @@ -17,6 +17,13 @@ class StorageHelper { getMachines() { return Utils_1.default.copyObject(this.data.get(CAP_MACHINES) || []); } + removeMachine(machineName) { + const machines = this.getMachines(); + const removedMachine = machines.filter((machine) => machine.name === machineName)[0]; + const newMachines = machines.filter((machine) => machine.name !== machineName); + this.data.set(CAP_MACHINES, newMachines); + return removedMachine; + } saveMachine(machineToSaveOrUpdate) { const currMachines = this.getMachines(); let updatedMachine = false; diff --git a/app-cli/built/utils/StorageHelper.js.map b/app-cli/built/utils/StorageHelper.js.map index 888a4db..725cbaf 100755 --- a/app-cli/built/utils/StorageHelper.js.map +++ b/app-cli/built/utils/StorageHelper.js.map @@ -1 +1 @@ -{"version":3,"file":"StorageHelper.js","sourceRoot":"","sources":["../../src/utils/StorageHelper.ts"],"names":[],"mappings":";;AACA,2CAA2C;AAC3C,mCAA4B;AAE5B,MAAM,YAAY,GAAG,aAAa,CAAC;AACnC,MA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sB,EAAE,CAAC;QAC/C,IAAI,UAAU,GAAG,KAAK,CAAC;QACvB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YACrD,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;YAChC,IAAI,OAAO,CAAC,GAAG,KAAK,uBAAuB,CAAC,GAAG,EAAE;gBAChD,UAAU,GAAG,IAAI,CAAC;gBAClB,QAAQ,CAAC,KAAK,CAAC,GAAG,uBAAuB,CAAC;gBAC1C,MAAM;aACN;SACD;QAED,IAAI,CAAC,UAAU,EAAE;YAChB,QAAQ,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;SACvC;QAED,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC;CACD;AArED,gCAqEC"} \ No newline at end of file diff --git a/app-cli/src/commands/captainduckduck.ts b/app-cli/src/commands/captainduckduck.ts index 1de2c37..d9b9a02 100755 --- a/app-cli/src/commands/captainduckduck.ts +++ b/app-cli/src/commands/captainduckduck.ts @@ -9,10 +9,10 @@ import * as program from 'commander'; // Command actions import login from './login'; +import list from './list'; +import logout from './logout'; // import serversetup = require('./serversetup'); -// import list = require('./list'); // import deploy = require('./deploy'); -// import logout = require('./logout'); // Setup program.version(packagejson.version).description(packagejson.description); @@ -26,6 +26,14 @@ program login(); }); +program.command('list').alias('ls').description('List all Captain machines currently logged in.').action(() => { + list(); +}); + +program.command('logout').description('Logout from a specific Captain machine.').action(() => { + logout(); +}); + // program // .command('serversetup') // .description('Performs necessary actions and prepares your Captain server.') @@ -33,14 +41,6 @@ program // serversetup(); // }); -// program.command('logout').description('Logout from a specific Captain machine.').action(() => { -// logout(); -// }); - -// program.command('list').alias('ls').description('List all Captain machines currently logged in.').action(() => { -// list(); -// }); - // program // .command('deploy') // .description( diff --git a/app-cli/src/commands/list.ts b/app-cli/src/commands/list.ts new file mode 100644 index 0000000..d8677a4 --- /dev/null +++ b/app-cli/src/commands/list.ts @@ -0,0 +1,22 @@ +#!/usr/bin/env node + +import chalk from 'chalk'; +import StdOutUtil from '../utils/StdOutUtil'; +import StorageHelper from '../utils/StorageHelper'; +import { IMachine } from '../models/storage/StoredObjects'; + +function _displayMachine(machine: IMachine) { + console.log('>> ' + chalk.greenBright(machine.name) + ' at ' + chalk.cyan(machine.baseUrl)); +} + +function list() { + StdOutUtil.printMessage('\nLogged in Captain Machines:\n'); + + StorageHelper.get().getMachines().map((machine) => { + _displayMachine(machine); + }); + + StdOutUtil.printMessage(''); +} + +export default list; diff --git a/app-cli/src/commands/login.ts b/app-cli/src/commands/login.ts index f0709be..40a8806 100644 --- a/app-cli/src/commands/login.ts +++ b/app-cli/src/commands/login.ts @@ -130,7 +130,7 @@ async function login() { name: captainName }).getAuthToken(captainPassword); - StdOutUtil.printGreenMessage(`Logged in successfully to ${baseUrl}`); + StdOutUtil.printGreenMessage(`\nLogged in successfully to ${baseUrl}`); StdOutUtil.printGreenMessage(`Authorization token is now saved as ${captainName} \n`); } catch (error) { const errorMessage = error.message ? error.message : error; diff --git a/app-cli/src/commands/logout.ts b/app-cli/src/commands/logout.ts new file mode 100644 index 0000000..8ceb157 --- /dev/null +++ b/app-cli/src/commands/logout.ts @@ -0,0 +1,43 @@ +#!/usr/bin/env node + +import * as inquirer from 'inquirer'; +import StdOutUtil from '../utils/StdOutUtil'; +import CliHelper from '../utils/CliHelper'; + +function generateQuestions() { + const listOfMachines = CliHelper.get().getMachinesAsOptions(); + + return [ + { + type: 'list', + name: 'captainNameToLogout', + message: 'Select the Captain Machine you want to logout from:', + choices: listOfMachines + }, + { + type: 'confirm', + name: 'confirmedToLogout', + message: 'Are you sure you want to logout from this Captain machine?', + default: false, + when: (answers: any) => answers.captainNameToLogout + } + ]; +} + +async function logout() { + const questions = generateQuestions(); + + StdOutUtil.printMessage('Logout from a Captain Machine and clear auth info'); + + const answers = await inquirer.prompt(questions); + const { captainNameToLogout, confirmedToLogout } = answers; + + if (!captainNameToLogout || !confirmedToLogout) { + StdOutUtil.printMessage('\nOperation cancelled by the user...\n'); + return; + } + + CliHelper.get().logoutMachine(captainNameToLogout); +} + +export default logout; diff --git a/app-cli/src/utils/CliHelper.ts b/app-cli/src/utils/CliHelper.ts index 4daf3a0..9fa0cae 100644 --- a/app-cli/src/utils/CliHelper.ts +++ b/app-cli/src/utils/CliHelper.ts @@ -1,5 +1,6 @@ import StorageHelper from './StorageHelper'; import { IMachine } from '../models/storage/StoredObjects'; +import StdOutUtil from './StdOutUtil'; export default class CliHelper { static instance: CliHelper; @@ -9,6 +10,32 @@ export default class CliHelper { return CliHelper.instance; } + getMachinesAsOptions() { + const machines = StorageHelper.get().getMachines() + const firstItemInOption = [ + { + name: '-- CANCEL --', + value: '', + short: '' + } + ]; + const listOfMachines = machines.map((machine) => { + return { + name: `${machine.name} at ${machine.baseUrl}`, + value: `${machine.name}`, + short: `${machine.name} at ${machine.baseUrl}` + }; + }); + + return [ ...firstItemInOption, ...listOfMachines ]; + } + + logoutMachine(machineName: string) { + const removedMachine = StorageHelper.get().removeMachine(machineName); + StdOutUtil. printMessage(`You are now logged out from ${removedMachine.name} at ${removedMachine.baseUrl}...\n`); + } + + findDefaultCaptainName() { let currentSuffix = StorageHelper.get().getMachines().length + 1; const self = this; diff --git a/app-cli/src/utils/StorageHelper.ts b/app-cli/src/utils/StorageHelper.ts index f8f0522..6810dde 100644 --- a/app-cli/src/utils/StorageHelper.ts +++ b/app-cli/src/utils/StorageHelper.ts @@ -24,6 +24,15 @@ export default class StorageHelper { return Utils.copyObject(this.data.get(CAP_MACHINES) || []); } + removeMachine(machineName: string) { + const machines = this.getMachines(); + const removedMachine = machines.filter((machine) => machine.name === machineName)[0]; + const newMachines = machines.filter((machine) => machine.name !== machineName); + this.data.set(CAP_MACHINES, newMachines); + + return removedMachine; + } + saveMachine(machineToSaveOrUpdate: IMachine) { const currMachines = this.getMachines(); let updatedMachine = false; From b85145b16227e6c94931845db4e5890c35820f70 Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Sat, 5 Jan 2019 23:21:29 -0800 Subject: [PATCH 37/44] upload for deploy is working --- app-cli/built/api/ApiManager.js | 8 +- app-cli/built/api/ApiManager.js.map | 2 +- app-cli/built/api/CliApiManager.js | 4 +- app-cli/built/api/CliApiManager.js.map | 2 +- app-cli/built/api/HttpClient.js | 34 ++-- app-cli/built/api/HttpClient.js.map | 2 +- app-cli/built/commands/captainduckduck.js | 30 ++- app-cli/built/commands/captainduckduck.js.map | 2 +- app-cli/built/commands/deploy.js | 135 +++++++++++++ app-cli/built/commands/deploy.js.map | 1 + app-cli/built/commands/login.js | 31 --- app-cli/built/commands/login.js.map | 2 +- app-cli/built/commands/requestLogin.js | 38 ++++ app-cli/built/commands/requestLogin.js.map | 1 + app-cli/built/models/IBuildLogs.js | 4 + app-cli/built/models/IBuildLogs.js.map | 1 + app-cli/built/utils/DeployHelper.js | 162 +++++++++++++++ app-cli/built/utils/DeployHelper.js.map | 1 + app-cli/built/utils/SpinnerHelper.js | 2 +- app-cli/built/utils/SpinnerHelper.js.map | 2 +- app-cli/built/utils/ValidationsHandler.js | 78 ++++++++ app-cli/built/utils/ValidationsHandler.js.map | 1 + app-cli/package.json | 3 +- app-cli/src/api/ApiManager.ts | 14 +- app-cli/src/api/CliApiManager.ts | 4 +- app-cli/src/api/HttpClient.ts | 46 ++--- app-cli/src/commands/captainduckduck.ts | 32 +-- app-cli/src/commands/deploy.ts | 142 ++++++++++++++ app-cli/src/commands/login.ts | 38 ---- app-cli/src/commands/requestLogin.ts | 29 +++ app-cli/src/models/IBuildLogs.ts | 8 + app-cli/src/utils/DeployHelper.ts | 184 ++++++++++++++++++ app-cli/src/utils/SpinnerHelper.ts | 2 +- app-cli/src/utils/ValidationsHandler.ts | 84 ++++++++ app-cli/yarn.lock | 27 ++- 35 files changed, 975 insertions(+), 181 deletions(-) create mode 100755 app-cli/built/commands/deploy.js create mode 100755 app-cli/built/commands/deploy.js.map create mode 100755 app-cli/built/commands/requestLogin.js create mode 100755 app-cli/built/commands/requestLogin.js.map create mode 100755 app-cli/built/models/IBuildLogs.js create mode 100755 app-cli/built/models/IBuildLogs.js.map create mode 100755 app-cli/built/utils/DeployHelper.js create mode 100755 app-cli/built/utils/DeployHelper.js.map create mode 100755 app-cli/built/utils/ValidationsHandler.js create mode 100755 app-cli/built/utils/ValidationsHandler.js.map create mode 100644 app-cli/src/commands/deploy.ts create mode 100644 app-cli/src/commands/requestLogin.ts create mode 100644 app-cli/src/models/IBuildLogs.ts create mode 100644 app-cli/src/utils/DeployHelper.ts create mode 100644 app-cli/src/utils/ValidationsHandler.ts diff --git a/app-cli/built/api/ApiManager.js b/app-cli/built/api/ApiManager.js index f21679f..80b13bc 100755 --- a/app-cli/built/api/ApiManager.js +++ b/app-cli/built/api/ApiManager.js @@ -59,19 +59,17 @@ class ApiManager { getAllApps() { const http = this.http; return Promise.resolve() // - .then(http.fetch(http.GET, '/user/apps/appDefinitions', {})); + .then(http.fetch(http.GET, '/user/appDefinitions', {})); // TODO user/apps/appDefinitions } fetchBuildLogs(appName) { const http = this.http; return Promise.resolve() // - .then(http.fetch(http.GET, '/user/apps/appData/' + appName, {})); + .then(http.fetch(http.GET, '/user/appData/' + appName, {})); // TODO user/apps/appData } uploadAppData(appName, file) { const http = this.http; - var formData = new FormData(); - formData.append('sourceFile', file); return Promise.resolve() // - .then(http.fetch(http.POST, '/user/apps/appData/' + appName + '?detached=1', formData)); + .then(http.fetch(http.POST, '/user/appData/' + appName + '?detached=1', { sourceFile: file })); // TODO user/apps/appData } uploadCaptainDefinitionContent(appName, captainDefinition, gitHash, detached) { const http = this.http; diff --git a/app-cli/built/api/ApiManager.js.map b/app-cli/built/api/ApiManager.js.map index 19fbda7..4a0c135 100755 --- a/app-cli/built/api/ApiManager.js.map +++ b/app-cli/built/api/ApiManager.js.map @@ -1 +1 @@ -{"version":3,"file":"ApiManager.js","sourceRoot":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;YAC3C,QAAQ;YACR,UAAU;YACV,mBAAmB;YACnB,gBAAgB;SAChB,CAAC,CACF,CAAC;IACJ,CAAC;;AA1Xc,4BAAiB,GAAW,OAAO,CAAC,GAAG,CAAC,0BAA0B;IAChF,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,GAAG,EAAE;IAC7C,CAAC,CAAC,WAAW,CAAC;AACA,oBAAS,GAAW,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB;IAClE,CAAC,CAAC,mPAAmP;IACrP,CAAC,CAAC,EAAE,CAAC;AANP,6BA4XC"} \ No newline at end of file diff --git a/app-cli/built/api/CliApiManager.js b/app-cli/built/api/CliApiManager.js index 0b9f171..be26bee 100755 --- a/app-cli/built/api/CliApiManager.js +++ b/app-cli/built/api/CliApiManager.js @@ -19,9 +19,11 @@ class CliApiManager { if (!CliApiManager.instances[hashKey]) CliApiManager.instances[hashKey] = new ApiManager_1.default(capMachine.baseUrl + '/api/v1', function (token) { capMachine.authToken = token; - StorageHelper_1.default.get().saveMachine(capMachine); + if (capMachine.name) + StorageHelper_1.default.get().saveMachine(capMachine); return Promise.resolve(); }); + CliApiManager.instances[hashKey].setAuthToken(capMachine.authToken); return CliApiManager.instances[hashKey]; } } diff --git a/app-cli/built/api/CliApiManager.js.map b/app-cli/built/api/CliApiManager.js.map index b00d910..a3f3a26 100755 --- a/app-cli/built/api/CliApiManager.js.map +++ b/app-cli/built/api/CliApiManager.js.map @@ -1 +1 @@ -{"version":3,"file":"CliApiManager.js","sourceRoot":"","sources":["../../src/api/CliApiManager.ts"],"names":[],"mappings":";;AAAA,6CAAsC;AAEtC,0DAAmD;AAGnD,SAAS,QAAQ,CAAC,GAAW;IAC5B,IAAI,IAAI,GAAG,CAAC,EACX,CAAC,EACD,GAAG,CAAC;IACL,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAClC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG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E;QAChC,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,GAAG,GAAG,CAAC;QAChC,IAAI,IAAI,CAAC,CAAC,CAAC,2BAA2B;KACtC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAED,MAAqB,aAAa;IAGjC,MAAM,CAAC,GAAG,CAAC,UAAoB;QAC9B,MAAM,OAAO,GAAG,GAAG,GAAG,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACnD,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC;YACpC,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,oBAAU,CAAC,UAAU,CAAC,OAAO,GAAG,SAAS,EAAE,UAAS,KAAK;gBAC/F,UAAU,CAAC,SAAS,GAAG,KAAK,CAAC;gBAC7B,IAAI,UAAU,CAAC,IAAI;oBAAE,uBAAa,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;gBACjE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;YAC1B,CAAC,CAAC,CAAC;QAEJ,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QAEpE,OAAO,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;;AAdM,uBAAS,GAAgC,EAAE,CAAC;AADpD,gCAgBC"} \ No newline at end of file diff --git a/app-cli/built/api/HttpClient.js b/app-cli/built/api/HttpClient.js index b2bcbb8..1be8a37 100755 --- a/app-cli/built/api/HttpClient.js +++ b/app-cli/built/api/HttpClient.js @@ -1,8 +1,8 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const axios_1 = require("axios"); const ErrorFactory_1 = require("../utils/ErrorFactory"); const Logger_1 = require("../utils/Logger"); +const Request = require("request-promise"); var TOKEN_HEADER = 'x-captain-auth'; var NAMESPACE = 'x-namespace'; var CAPTAIN = 'captain'; @@ -44,14 +44,16 @@ class HttpClient { .then(function () { return self.fetchInternal(method, endpoint, variables); // }) - .then(function (axiosResponse) { - const data = axiosResponse.data; // this is an axios thing! + .then(function (requestResponse) { + const data = JSON.parse(requestResponse); if (data.status === ErrorFactory_1.default.STATUS_AUTH_TOKEN_INVALID) { return self .onAuthFailure() // .then(function () { - return self.fetchInternal(method, endpoint, variables).then(function (newAxiosResponse) { - return newAxiosResponse.data; + return self + .fetchInternal(method, endpoint, variables) + .then(function (newRequestResponse) { + return newRequestResponse; }); }); } @@ -78,6 +80,7 @@ class HttpClient { }); }) .catch(function (error) { + Logger_1.default.log(''); Logger_1.default.error(error.message || error); return new Promise(function (resolve, reject) { if (!self.isDestroyed) @@ -96,24 +99,19 @@ class HttpClient { } getReq(endpoint, variables) { const self = this; - return axios_1.default - .get(this.baseUrl + endpoint, { - params: variables, - headers: self.createHeaders() - }) // - .then(function (data) { - //console.log(data); + return Request.get(this.baseUrl + endpoint, { + headers: self.createHeaders(), + qs: variables + }).then(function (data) { return data; }); } postReq(endpoint, variables) { const self = this; - return axios_1.default - .post(this.baseUrl + endpoint, variables, { - headers: self.createHeaders() - }) // - .then(function (data) { - //console.log(data); + return Request.post(this.baseUrl + endpoint, { + headers: self.createHeaders(), + formData: variables + }).then(function (data) { return data; }); } diff --git a/app-cli/built/api/HttpClient.js.map b/app-cli/built/api/HttpClient.js.map index bda4233..fcb3b47 100755 --- a/app-cli/built/api/HttpClient.js.map +++ b/app-cli/built/api/HttpClient.js.map @@ -1 +1 @@ -{"version":3,"file":"HttpClient.js","sourceRoot":"","sources":["../../src/api/HttpClient.ts"],"names":[],"mappings":";;AAAA,iCAA0B;AAC1B,wDAAiD;AACjD,4CAAqC;AAErC,IAAI,YAAY,GAAG,gBAAgB,CAAC;AACpC,IAAI,SAAS,GAAG,aAAa,CAAC;AAC9B,IAAI,OAAO,GAAG,SAAS,CA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C3C,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE;YAC7B,EAAE,EAAE,SAAS;SACb,CAAC,CAAC,IAAI,CAAC,UAAS,IAAI;YACpB,OAAO,IAAI,CAAC;QACb,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,QAAgB,EAAE,SAAc;QACvC,MAAM,IAAI,GAAG,IAAI,CAAC;QAElB,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,QAAQ,EAAE;YAC5C,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE;YAC7B,QAAQ,EAAE,SAAS;SACnB,CAAC,CAAC,IAAI,CAAC,UAAS,IAAI;YACpB,OAAO,IAAI,CAAC;QACb,CAAC,CAAC,CAAC;IACJ,CAAC;CACD;AAnHD,6BAmHC"} \ No newline at end of file diff --git a/app-cli/built/commands/captainduckduck.js b/app-cli/built/commands/captainduckduck.js index 93b7873..7536dda 100755 --- a/app-cli/built/commands/captainduckduck.js +++ b/app-cli/built/commands/captainduckduck.js @@ -10,8 +10,8 @@ const program = require("commander"); const login_1 = require("./login"); const list_1 = require("./list"); const logout_1 = require("./logout"); +const deploy_1 = require("./deploy"); // import serversetup = require('./serversetup'); -// import deploy = require('./deploy'); // Setup program.version(packagejson.version).description(packagejson.description); // Commands @@ -33,21 +33,19 @@ program.command('logout').description('Logout from a specific Captain machine.') // .action(() => { // serversetup(); // }); -// program -// .command('deploy') -// .description( -// "Deploy your app (current directory) to a specific Captain machine. You'll be prompted to choose your Captain machine." -// ) -// .option('-t, --tarFile ', 'Specify file to be uploaded (rather than using git archive)') -// .option('-d, --default', 'Run with default options') -// .option('-s, --stateless', 'Run deploy stateless') -// .option('-h, --host ', 'Only for stateless mode: Host of the captain machine') -// .option('-a, --appName ', 'Only for stateless mode: Name of the app') -// .option('-p, --pass ', 'Only for stateless mode: Password for Captain') -// .option('-b, --branch ', 'Only for stateless mode: Branch name (default master)') -// .action((options: any) => { -// deploy(options); -// }); +program + .command('deploy') + .description("Deploy your app (current directory) to a specific Captain machine. You'll be prompted to choose your Captain machine.") + .option('-t, --tarFile ', 'Specify file to be uploaded (rather than using git archive)') + .option('-d, --default', 'Run with default options') + .option('-s, --stateless', 'Run deploy stateless') + .option('-h, --host ', 'Only for stateless mode: Host of the captain machine') + .option('-a, --appName ', 'Only for stateless mode: Name of the app') + .option('-p, --pass ', 'Only for stateless mode: Password for Captain') + .option('-b, --branch ', 'Only for stateless mode: Branch name (default master)') + .action((options) => { + deploy_1.default(options); +}); // Error on unknown commands program.on('command:*', () => { const wrongCommands = program.args.join(' '); diff --git a/app-cli/built/commands/captainduckduck.js.map b/app-cli/built/commands/captainduckduck.js.map index 0573891..0eb581d 100755 --- a/app-cli/built/commands/captainduckduck.js.map +++ b/app-cli/built/commands/captainduckduck.js.map @@ -1 +1 @@ -{"version":3,"file":"captainduckduck.js","sourceRoot":"","sources":["../../src/commands/captainduckduck.ts"],"names":[],"mappings":";;;AAEA,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAClD,kDAAkD;AAClD,cAAc,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAEhE,oDAA6C;AAC7C,qCAAqC;AAErC,kBAAkB;AAClB,mCAA4B;AAC5B,iCAA0B;AAC1B,qCAA8B;AAC9B,iDAAiD;AACjD,uCAAuC;AAEvC,QAAQ;AACR,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;AAE1E,WAAW;AAEX,OAAO;KACL,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,+FAA+F,CAAC;KAC5G,MAAM,CAAC,GAAG,EAAE;IACZ,eAAK,EAAE,CAAC;AACT,CAAC,CAAC,CAAC;AAEJ,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,gDAAgD,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE;IAC7G,cAAI,EAAE,CAAC;AACR,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,yCAAyC,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE;IAC5F,gBAAM,EAAE,CAAC;AACV,CAAC,CAAC,CAAC;AAEH,UAAU;AACV,2BAA2B;AAC3B,gFAAgF;AAChF,mBAAmB;AACnB,mBAAmB;AACnB,OAAO;AAEP,UAAU;AACV,sBAAsB;AACtB,iBAAiB;AACjB,4HAA4H;AAC5H,KAAK;AACL,mGAAmG;AACnG,wDAAwD;AACxD,sDAAsD;AACtD,yFAAyF;AACzF,gFAAgF;AAChF,kFAAkF;AAClF,4FAA4F;AAC5F,+BAA+B;AAC/B,qBAAqB;AACrB,OAAO;AAEP,4BAA4B;AAC5B,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;IAC5B,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE7C,oBAAU,CAAC,UAAU,CAAC,sBAAsB,aAAa,gDAAgD,EAAE,IAAI,CAAC,CAAC;AAClH,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"captainduckduck.js","sourceRoot":"","sources":["../../src/commands/captainduckduck.ts"],"names":[],"mappings":";;;AAEA,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAClD,kDAAkD;AAClD,cAAc,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAEhE,oDAA6C;AAC7C,qCAAqC;AAErC,kBAAkB;AAClB,mCAA4B;AA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AAC,CAAC;AACjB,CAAC,CAAC,CAAC;AAEJ,4BAA4B;AAC5B,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;IAC5B,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE7C,oBAAU,CAAC,UAAU,CAAC,sBAAsB,aAAa,gDAAgD,EAAE,IAAI,CAAC,CAAC;AAClH,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/deploy.js b/app-cli/built/commands/deploy.js new file mode 100755 index 0000000..255f596 --- /dev/null +++ b/app-cli/built/commands/deploy.js @@ -0,0 +1,135 @@ +#!/usr/bin/env node +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const inquirer = require("inquirer"); +const StdOutUtil_1 = require("../utils/StdOutUtil"); +const ValidationsHandler_1 = require("../utils/ValidationsHandler"); +const StorageHelper_1 = require("../utils/StorageHelper"); +const CliHelper_1 = require("../utils/CliHelper"); +const DeployHelper_1 = require("../utils/DeployHelper"); +// async function deployAsStateless(host: string, appName: string, branch: string, pass: string) { +// const isStateless = host && appName && branch && pass; +// if (isStateless) { +// // login first +// StdOutUtil.printMessage(`Trying to login to ${host}\n`); +// const { name } = DeployApi.machineToDeploy; +// const response = await LoginApi.loginMachine(host, pass); +// const data = JSON.parse(response); +// const newToken = data.token; +// // Update the token to the machine that corresponds (if needed) +// MachineHelper.updateMachineAuthToken(name, newToken); +// if (data) { +// StdOutUtil.printMessage(`Starting stateless deploy to\n${host}\n${branch}\n${appName}`); +// deployFromGitProject(); +// } +// } else { +// StdOutUtil.printError( +// 'You are missing parameters for deploying on stateless. ' +// ); +// } +// } +// async function deployFromTarFile(tarFile: string) { +// try { +// const isValidAuthentication = await validateAuthentication(); +// if (isValidAuthentication) { +// // Send from tar file +// const filePath = tarFile; +// const gitHash = 'sendviatarfile'; +// await uploadFile(filePath, gitHash); +// } else { +// StdOutUtil.printError('Incorrect login details', true); +// } +// } catch (e) { +// StdOutUtil.printError(e.message, true); +// } +// } +function deploy(options) { + return __awaiter(this, void 0, void 0, function* () { + const possibleApp = StorageHelper_1.default.get() + .getDeployedDirectories() + .find((dir) => dir.cwd === process.cwd()); + if (!options.tarFile) { + if (!ValidationsHandler_1.validateIsGitRepository() || !ValidationsHandler_1.validateDefinitionFile()) { + return; + } + } + StdOutUtil_1.default.printMessage('Preparing deployment to Captain...\n'); + let deployParams = possibleApp + ? { + captainNameToDeploy: possibleApp.machineNameToDeploy, + branchToPush: possibleApp.branchToPush, + appName: possibleApp.appName + } + : {}; + if (options.default) { + //deployAsDefaultValues(); + //} + // else if (options.stateless) { + // deployAsStateless(options.host, options.appName, options.branch, options.pass); + // } + // else if (options.tarFile) { + // deployFromTarFile(options.tarFile); + } + else { + const questions = [ + { + type: 'list', + name: 'captainNameToDeploy', + default: possibleApp ? possibleApp.machineNameToDeploy : '', + message: 'Select the Captain Machine you want to deploy to:', + choices: CliHelper_1.default.get().getMachinesAsOptions() + }, + { + type: 'input', + default: possibleApp ? possibleApp.branchToPush : 'master', + name: 'branchToPush', + message: "Enter the 'git' branch you would like to deploy:", + when: (answers) => !!answers.captainNameToDeploy + }, + { + type: 'input', + default: possibleApp ? possibleApp.appName : '', + name: 'appName', + message: 'Enter the Captain app name this directory will be deployed to:', + when: (answers) => !!answers.branchToPush + }, + { + type: 'confirm', + name: 'confirmedToDeploy', + message: 'Note that uncommitted files and files in gitignore (if any) will not be pushed to server. Please confirm so that deployment process can start.', + default: true, + when: (answers) => !!answers.appName + } + ]; + const answers = (yield inquirer.prompt(questions)); + if (!answers.confirmedToDeploy) { + StdOutUtil_1.default.printMessage('\nOperation cancelled by the user...\n'); + process.exit(0); + return; + } + deployParams = answers; + } + const branchToPush = deployParams.branchToPush; + const appName = deployParams.appName; + const capMachine = StorageHelper_1.default.get() + .getMachines() + .find((machine) => machine.name === deployParams.captainNameToDeploy); + try { + yield new DeployHelper_1.default(capMachine, appName, branchToPush) // + .deployFromGitProject(); + } + catch (e) { + StdOutUtil_1.default.printError(e.message, true); + } + }); +} +exports.default = deploy; +//# sourceMappingURL=deploy.js.map \ No newline at end of file diff --git a/app-cli/built/commands/deploy.js.map b/app-cli/built/commands/deploy.js.map new file mode 100755 index 0000000..868a463 --- /dev/null +++ b/app-cli/built/commands/deploy.js.map @@ -0,0 +1 @@ +{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,qCAAqC;AACrC,oDAA6C;AAC7C,oEAAoH;AAEpH,0DAAmD;AACnD,kDAA2C;AAE3C,wDAAiD;AAEjD,kGAAkG;AAClG,0DAA0D;AAE1D,sBAAsB;AACtB,mBAAmB;AACnB,6DAA6D;AAE7D,gDAAgD;AAChD,8DAA8D;AAC9D,uCAAuC;AACvC,iCAAiC;AAEjC,oEAAoE;AACpE,0DAA0D;AAE1D,gBAAgB;AAChB,8FAA8F;AAE9F,6BAA6B;AAC7B,MAAM;AACN,YAAY;AACZ,2BAA2B;AAC3B,oGAAoG;AACpG,OAAO;AACP,KAAK;AACL,IAAI;AAEJ,sDAAsD;AACtD,SAAS;AACT,kEAAkE;AAElE,iCAAiC;AACjC,2BAA2B;AAC3B,+BAA+B;AAC/B,uCAAuC;AAEvC,0CAA0C;AAC1C,aAAa;AACb,6DAA6D;AAC7D,MAAM;AACN,iBAAiB;AACjB,4CAA4C;AAC5C,KAAK;AACL,IAAI;AAEJ,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AAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;SACvC;IACF,CAAC;CAAA;AAED,kBAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/login.js b/app-cli/built/commands/login.js index c11874f..d413184 100755 --- a/app-cli/built/commands/login.js +++ b/app-cli/built/commands/login.js @@ -18,37 +18,6 @@ const CliHelper_1 = require("../utils/CliHelper"); const CliApiManager_1 = require("../api/CliApiManager"); const SAMPLE_DOMAIN = Constants_1.default.SAMPLE_DOMAIN; const cleanUpUrl = Utils_1.default.cleanUpUrl; -// const DeployApi = require('../api/DeployApi'); -// const { cleanUpUrl, findDefaultCaptainName } = require('../utils/loginHelpers'); -// const { SAMPLE_DOMAIN } = require('../utils/constants'); -// const LoginApi = require('../api/LoginApi'); -// In case the token is expired -// async function requestLogin() { -// const { baseUrl, name } = DeployApi.machineToDeploy; -// printMessage('Your auth token is not valid anymore. Try to login again.'); -// const questions = [ -// { -// type: 'password', -// name: 'captainPassword', -// message: 'Please enter your password for ' + baseUrl, -// validate: (value: string) => { -// if (value && value.trim()) { -// return true; -// } -// return 'Please enter your password for ' + baseUrl; -// } -// } -// ]; -// const loginPassword = await inquirer.prompt(questions); -// const password = loginPassword.captainPassword; -// const response = await LoginApi.loginMachine(baseUrl, password); -// const data = JSON.parse(response); -// const newToken = data.token; -// if (!newToken) return false; -// // Update the token to the machine that corresponds -// MachineHelper.updateMachineAuthToken(name, newToken); -// return true; -// } function login() { return __awaiter(this, void 0, void 0, function* () { StdOutUtil_1.default.printMessage('Login to a Captain Machine'); diff --git a/app-cli/built/commands/login.js.map b/app-cli/built/commands/login.js.map index cad383c..76e531a 100755 --- a/app-cli/built/commands/login.js.map +++ b/app-cli/built/commands/login.js.map @@ -1 +1 @@ -{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,qCAAqC;AACrC,oDAA6C;AAC7C,0DAAmD;AACnD,kDAA2C;AAC3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AAC;CAAA;AAED,kBAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/requestLogin.js b/app-cli/built/commands/requestLogin.js new file mode 100755 index 0000000..58550cf --- /dev/null +++ b/app-cli/built/commands/requestLogin.js @@ -0,0 +1,38 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const StdOutUtil_1 = require("../utils/StdOutUtil"); +const inquirer = require("inquirer"); +const CliApiManager_1 = require("../api/CliApiManager"); +// In case the token is expired +function requestLogin(machine) { + return __awaiter(this, void 0, void 0, function* () { + const { baseUrl } = machine; + StdOutUtil_1.default.printMessage('Your auth token is not valid anymore. Try to login again.'); + const questions = [ + { + type: 'password', + name: 'captainPassword', + message: 'Please enter your password for ' + baseUrl, + validate: (value) => { + if (value && value.trim()) { + return true; + } + return 'Please enter your password for ' + baseUrl; + } + } + ]; + const loginPassword = (yield inquirer.prompt(questions)); + const password = loginPassword.captainPassword; + const responseIgnore = yield CliApiManager_1.default.get(machine).getAuthToken(password); + }); +} +exports.default = requestLogin; +//# sourceMappingURL=requestLogin.js.map \ No newline at end of file diff --git a/app-cli/built/commands/requestLogin.js.map b/app-cli/built/commands/requestLogin.js.map new file mode 100755 index 0000000..63b8de8 --- /dev/null +++ b/app-cli/built/commands/requestLogin.js.map @@ -0,0 +1 @@ +{"version":3,"file":"requestLogin.js","sourceRoot":"","sources":["../../src/commands/requestLogin.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,oDAA6C;AAC7C,qCAAqC;AAErC,wDAAiD;AAEjD,+BAA+B;AAC/B,SAA8B,YAAY,CAAC,OAAiB;;QAC3D,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;QAE5B,oBAAU,CAAC,YAAY,CAAC,2DAA2D,CAAC,CAAC;QAErF,MAAM,SAAS,GAAG;YACjB;gBACC,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,iBAAiB;gBACvB,OAAO,EAAE,iCAAiC,GAAG,OAAO;gBACpD,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE;oBAC3B,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,EAAE;wBAC1B,OAAO,IAAI,CAAC;qBACZ;oBAED,OAAO,iCAAiC,GAAG,OAAO,CAAC;gBACpD,CAAC;aACD;SACD,CAAC;QACF,MAAM,aAAa,GAAG,CAAC,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAQ,CAAC;QAChE,MAAM,QAAQ,GAAG,aAAa,CAAC,eAAe,CAAC;QAC/C,MAAM,cAAc,GAAG,MAAM,uBAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAChF,CAAC;CAAA;AAtBD,+BAsBC"} \ No newline at end of file diff --git a/app-cli/built/models/IBuildLogs.js b/app-cli/built/models/IBuildLogs.js new file mode 100755 index 0000000..620b484 --- /dev/null +++ b/app-cli/built/models/IBuildLogs.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +; +//# sourceMappingURL=IBuildLogs.js.map \ No newline at end of file diff --git a/app-cli/built/models/IBuildLogs.js.map b/app-cli/built/models/IBuildLogs.js.map new file mode 100755 index 0000000..3af7874 --- /dev/null +++ b/app-cli/built/models/IBuildLogs.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IBuildLogs.js","sourceRoot":"","sources":["../../src/models/IBuildLogs.ts"],"names":[],"mappings":";;AAOC,CAAC"} \ No newline at end of file diff --git a/app-cli/built/utils/DeployHelper.js b/app-cli/built/utils/DeployHelper.js new file mode 100755 index 0000000..610858e --- /dev/null +++ b/app-cli/built/utils/DeployHelper.js @@ -0,0 +1,162 @@ +#!/usr/bin/env node +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const fs = require("fs-extra"); +const path = require("path"); +const child_process_1 = require("child_process"); +const StdOutUtil_1 = require("../utils/StdOutUtil"); +const ProgressBar = require('progress'); +const commandExistsSync = require('command-exists').sync; +const ValidationsHandler_1 = require("../utils/ValidationsHandler"); +const CliApiManager_1 = require("../api/CliApiManager"); +const SpinnerHelper_1 = require("../utils/SpinnerHelper"); +class DeployHelper { + constructor(machineToDeploy, appName, branchToPush) { + this.machineToDeploy = machineToDeploy; + this.appName = appName; + this.branchToPush = branchToPush; + this.lastLineNumberPrinted = -10000; // we want to show all lines to begin with! + // + } + gitArchiveFile(zipFileFullPath) { + const self = this; + return new Promise(function (resolve, reject) { + child_process_1.exec(`git archive --format tar --output "${zipFileFullPath}" ${self.branchToPush}`, (err, stdout, stderr) => { + if (err) { + StdOutUtil_1.default.printError(`TAR file failed\n${err}\n`); + fs.removeSync(zipFileFullPath); + reject(new Error('TAR file failed')); + return; + } + child_process_1.exec(`git rev-parse ${self.branchToPush}`, (err, stdout, stderr) => { + const gitHash = (stdout || '').trim(); + if (err || !/^[a-f0-9]{40}$/.test(gitHash)) { + StdOutUtil_1.default.printError(`Cannot find hash of last commit on this branch: ${self.branchToPush}\n${gitHash}\n${err}\n`); + reject(new Error('rev-parse failed')); + return; + } + StdOutUtil_1.default.printMessage(`Pushing last commit on ${self.branchToPush}: ${gitHash}`); + resolve(); + }); + }); + }); + } + getFileStream(zipFileFullPath) { + const fileSize = fs.statSync(zipFileFullPath).size; + const fileStream = fs.createReadStream(zipFileFullPath); + const barOpts = { + width: 20, + total: fileSize, + clear: false + }; + const bar = new ProgressBar(' uploading [:bar] :percent (ETA :etas)', barOpts); + fileStream.on('data', (chunk) => { + bar.tick(chunk.length); + }); + fileStream.on('end', () => { + StdOutUtil_1.default.printMessage('This might take several minutes. PLEASE BE PATIENT...'); + SpinnerHelper_1.default.start('Building your source code...'); + SpinnerHelper_1.default.setColor('yellow'); + }); + return fileStream; + } + deployFromGitProject() { + return __awaiter(this, void 0, void 0, function* () { + const appName = this.appName; + const branchToPush = this.branchToPush; + const machineToDeploy = this.machineToDeploy; + if (!appName || !branchToPush || !machineToDeploy) { + StdOutUtil_1.default.printError('Default deploy failed. Missing appName or branchToPush or machineToDeploy.', true); + return; + } + if (!commandExistsSync('git')) { + StdOutUtil_1.default.printError("'git' command not found..."); + StdOutUtil_1.default.printError("Captain needs 'git' to create tar file of your source files...", true); + return; + } + StdOutUtil_1.default.printMessage(`Deploying ${appName} to ${machineToDeploy.name}`); + yield ValidationsHandler_1.ensureAuthentication(machineToDeploy); + const zipFileNameToDeploy = 'temporary-captain-to-deploy.tar'; + const zipFileFullPath = path.join(process.cwd(), zipFileNameToDeploy); + StdOutUtil_1.default.printMessage(`Saving tar file to:\n${zipFileFullPath}\n`); + // Removes the temporary file created + if (fs.pathExistsSync(zipFileFullPath)) + fs.removeSync(zipFileFullPath); + yield this.gitArchiveFile(zipFileFullPath); + try { + StdOutUtil_1.default.printMessage(`Uploading the file to ${machineToDeploy.baseUrl}`); + yield CliApiManager_1.default.get(machineToDeploy).uploadAppData(appName, this.getFileStream(zipFileFullPath)); + StdOutUtil_1.default.printMessage(`Upload done.`); + fs.removeSync(zipFileFullPath); + this.startFetchingBuildLogs(machineToDeploy, appName); + } + catch (e) { + if (fs.pathExistsSync(zipFileFullPath)) + fs.removeSync(zipFileFullPath); + throw e; + } + }); + } + onLogRetrieved(data, machineToDeploy, appName) { + return __awaiter(this, void 0, void 0, function* () { + if (data) { + const lines = data.logs.lines; + const firstLineNumberOfLogs = data.logs.firstLineNumber; + let firstLinesToPrint = 0; + if (firstLineNumberOfLogs > this.lastLineNumberPrinted) { + if (firstLineNumberOfLogs < 0) { + // This is the very first fetch, probably firstLineNumberOfLogs is around -50 + firstLinesToPrint = -firstLineNumberOfLogs; + } + else { + StdOutUtil_1.default.printMessage('[[ TRUNCATED ]]'); + } + } + else { + firstLinesToPrint = this.lastLineNumberPrinted - firstLineNumberOfLogs; + } + this.lastLineNumberPrinted = firstLineNumberOfLogs + lines.length; + for (let i = firstLinesToPrint; i < lines.length; i++) { + StdOutUtil_1.default.printMessage((lines[i] || '').trim()); + } + } + if (data && !data.isAppBuilding) { + if (!data.isBuildFailed) { + StdOutUtil_1.default.printGreenMessage(`Deployed successfully: ${appName}`); + StdOutUtil_1.default.printMagentaMessage(`App is available`, true); // TODO add url + } + else { + StdOutUtil_1.default.printError(`\nSomething bad happened. Cannot deploy "${appName}"\n`, true); + } + } + else { + setTimeout(() => { + this.startFetchingBuildLogs(machineToDeploy, appName); + }, 2000); + } + }); + } + startFetchingBuildLogs(machineToDeploy, appName) { + return __awaiter(this, void 0, void 0, function* () { + const self = this; + try { + const data = yield CliApiManager_1.default.get(machineToDeploy).fetchBuildLogs(appName); + this.onLogRetrieved(data, machineToDeploy, appName); + } + catch (error) { + StdOutUtil_1.default.printError(`\nSomething while retrieving app build logs.. ${error}\n`); + this.onLogRetrieved(undefined, machineToDeploy, appName); + } + }); + } +} +exports.default = DeployHelper; +//# sourceMappingURL=DeployHelper.js.map \ No newline at end of file diff --git a/app-cli/built/utils/DeployHelper.js.map b/app-cli/built/utils/DeployHelper.js.map new file mode 100755 index 0000000..233f620 --- /dev/null +++ b/app-cli/built/utils/DeployHelper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"DeployHelper.js","sourceRoot":"","sources":["../../src/utils/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AiB,CAAC,0BAA0B,OAAO,EAAE,CAAC,CAAC;oBAElE,oBAAU,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC,CAAC,eAAe;iBACzE;qBAAM;oBACN,oBAAU,CAAC,UAAU,CAAC,4CAA4C,OAAO,KAAK,EAAE,IAAI,CAAC,CAAC;iBACtF;aACD;iBAAM;gBACN,UAAU,CAAC,GAAG,EAAE;oBACf,IAAI,CAAC,sBAAsB,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;gBACvD,CAAC,EAAE,IAAI,CAAC,CAAC;aACT;QACF,CAAC;KAAA;IAEa,sBAAsB,CAAC,eAAyB,EAAE,OAAe;;YAC9E,MAAM,IAAI,GAAG,IAAI,CAAC;YAClB,IAAI;gBACH,MAAM,IAAI,GAAG,MAAM,uBAAa,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;gBAC9E,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;aACpD;YAAC,OAAO,KAAK,EAAE;gBACf,oBAAU,CAAC,UAAU,CAAC,iDAAiD,KAAK,IAAI,CAAC,CAAC;gBAClF,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;aACzD;QACF,CAAC;KAAA;CACD;AApKD,+BAoKC"} \ No newline at end of file diff --git a/app-cli/built/utils/SpinnerHelper.js b/app-cli/built/utils/SpinnerHelper.js index b0d8568..54251fb 100755 --- a/app-cli/built/utils/SpinnerHelper.js +++ b/app-cli/built/utils/SpinnerHelper.js @@ -18,5 +18,5 @@ class SpinnerHelper { this.spinner.fail(); } } -exports.default = SpinnerHelper; +exports.default = new SpinnerHelper(); //# sourceMappingURL=SpinnerHelper.js.map \ No newline at end of file diff --git a/app-cli/built/utils/SpinnerHelper.js.map b/app-cli/built/utils/SpinnerHelper.js.map index af82a33..b726486 100755 --- a/app-cli/built/utils/SpinnerHelper.js.map +++ b/app-cli/built/utils/SpinnerHelper.js.map @@ -1 +1 @@ -{"version":3,"file":"SpinnerHelper.js","sourceRoot":"","sources":["../../src/utils/SpinnerHelper.ts"],"names":[],"mappings":";;AAAA,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAE3B,MAAM,aAAa;IAGlB,KAAK,CAAC,OAAe;QACpB,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC;IACrC,CAAC;IAED,QAAQ,CAAC,KAAa;QACrB,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IAC5B,CAAC;IAED,IAAI;QACH,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;IAED,OAAO;QACN,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,IAAI;QACH,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;CACD;AAED,kBAAe,aAAa,CAAC"} \ No newline at end of file +{"version":3,"file":"SpinnerHelper.js","sourceRoot":"","sources":["../../src/utils/SpinnerHelper.ts"],"names":[],"mappings":";;AAAA,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAE3B,MAAM,aAAa;IAGlB,KAAK,CAAC,OAAe;QACpB,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC;IACrC,CAAC;IAED,QAAQ,CAAC,KAAa;QACrB,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IAC5B,CAAC;IAED,IAAI;QACH,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;IAED,OAAO;QACN,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,IAAI;QACH,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;CACD;AAED,kBAAe,IAAI,aAAa,EAAE,CAAC"} \ No newline at end of file diff --git a/app-cli/built/utils/ValidationsHandler.js b/app-cli/built/utils/ValidationsHandler.js new file mode 100755 index 0000000..6cb5850 --- /dev/null +++ b/app-cli/built/utils/ValidationsHandler.js @@ -0,0 +1,78 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const StdOutUtil_1 = require("./StdOutUtil"); +const CliApiManager_1 = require("../api/CliApiManager"); +const requestLogin_1 = require("../commands/requestLogin"); +const fs = require('fs-extra'); +function validateIsGitRepository() { + const gitFolderExists = fs.pathExistsSync('./.git'); + if (!gitFolderExists) { + StdOutUtil_1.default.printError('\n**** ERROR: You are not in a git root directory. This command will only deploys the current directory ****\n', true); + } + return !!gitFolderExists; +} +exports.validateIsGitRepository = validateIsGitRepository; +function validateDefinitionFile() { + const captainDefinitionExists = fs.pathExistsSync('./captain-definition'); + if (!captainDefinitionExists) { + StdOutUtil_1.default.printError('\n**** ERROR: captain-definition file cannot be found. Please see docs! ****\n', true); + } + else { + const contents = fs.readFileSync('./captain-definition', 'utf8'); + let contentsJson = null; + try { + contentsJson = JSON.parse(contents); + } + catch (e) { + StdOutUtil_1.default.printError(`**** ERROR: captain-definition file is not a valid JSON! ****\n Error:${e}`, true); + } + if (contentsJson) { + if (!contentsJson.schemaVersion) { + StdOutUtil_1.default.printError('**** ERROR: captain-definition needs schemaVersion. Please see docs! ****', true); + } + else if (!contentsJson.templateId && !contentsJson.dockerfileLines) { + StdOutUtil_1.default.printError('**** ERROR: captain-definition needs templateId or dockerfileLines. Please see docs! ****', true); + } + else if (contentsJson.templateId && contentsJson.dockerfileLines) { + StdOutUtil_1.default.printError('**** ERROR: captain-definition needs templateId or dockerfileLines, NOT BOTH! Please see docs! ****', true); + } + else { + return true; + } + } + } + return false; +} +exports.validateDefinitionFile = validateDefinitionFile; +function isIpAddress(ipaddress) { + if (/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(ipaddress)) { + return true; + } + return false; +} +exports.isIpAddress = isIpAddress; +function ensureAuthentication(machine) { + return __awaiter(this, void 0, void 0, function* () { + let isAuthenticated = false; + try { + let ignoreVal = yield CliApiManager_1.default.get(machine).getAllApps(); + isAuthenticated = true; + } + catch (e) { + // ignore + } + if (!isAuthenticated) { + const loggedInStatus = yield requestLogin_1.default(machine); + } + }); +} +exports.ensureAuthentication = ensureAuthentication; +//# sourceMappingURL=ValidationsHandler.js.map \ No newline at end of file diff --git a/app-cli/built/utils/ValidationsHandler.js.map b/app-cli/built/utils/ValidationsHandler.js.map new file mode 100755 index 0000000..342f56f --- /dev/null +++ b/app-cli/built/utils/ValidationsHandler.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ValidationsHandler.js","sourceRoot":"","sources":["../../src/utils/ValidationsHandler.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,6CAAsC;AAEtC,wDAAiD;AACjD,2DAAoD;AAEpD,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAE/B,SAAgB,uBAAuB;IACtC,MAAM,eAAe,GAAG,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAEpD,IAAI,CAAC,eAAe,EAAE;QACrB,oBAAU,CAAC,UAAU,CACpB,gHAAgH,EAChH,IAAI,CACJ,CAAC;KACF;IAED,OAA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AAsB,oBAAoB,CAAC,OAAiB;;QAC3D,IAAI,eAAe,GAAG,KAAK,CAAC;QAC5B,IAAI;YACH,IAAI,SAAS,GAAG,MAAM,uBAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,CAAC;YAC9D,eAAe,GAAG,IAAI,CAAC;SACvB;QAAC,OAAO,CAAC,EAAE;YACX,SAAS;SACT;QAED,IAAI,CAAC,eAAe,EAAE;YACrB,MAAM,cAAc,GAAG,MAAM,sBAAY,CAAC,OAAO,CAAC,CAAC;SACnD;IACF,CAAC;CAAA;AAZD,oDAYC"} \ No newline at end of file diff --git a/app-cli/package.json b/app-cli/package.json index ddb9ca5..71c48b8 100644 --- a/app-cli/package.json +++ b/app-cli/package.json @@ -46,7 +46,6 @@ "@types/inquirer": "^0.0.43", "@types/request-promise": "^4.1.42", "@types/update-notifier": "^2.5.0", - "axios": "^0.18.0", "chalk": "^2.4.1", "command-exists": "^1.2.8", "commander": "^2.19.0", @@ -56,6 +55,8 @@ "npm": "^6.5.0", "ora": "^3.0.0", "progress": "^2.0.3", + "request": "^2.88.0", + "request-promise": "^4.2.2", "typescript": "^3.2.2", "update-notifier": "^2.5.0" }, diff --git a/app-cli/src/api/ApiManager.ts b/app-cli/src/api/ApiManager.ts index b3fef6c..1b07518 100644 --- a/app-cli/src/api/ApiManager.ts +++ b/app-cli/src/api/ApiManager.ts @@ -4,6 +4,8 @@ import { IRegistryInfo } from '../models/IRegistryInfo'; import { ICaptainDefinition } from '../models/ICaptainDefinition'; import { IVersionInfo } from '../models/IVersionInfo'; import { IAppDef } from '../models/AppDef'; +import * as fs from 'fs-extra'; +import IBuildLogs from '../models/IBuildLogs'; export default class ApiManager { private static lastKnownPassword: string = process.env.REACT_APP_DEFAULT_PASSWORD @@ -87,22 +89,20 @@ export default class ApiManager { const http = this.http; return Promise.resolve() // - .then(http.fetch(http.GET, '/user/apps/appDefinitions', {})); + .then(http.fetch(http.GET, '/user/appDefinitions', {})); // TODO user/apps/appDefinitions } - fetchBuildLogs(appName: string) { + fetchBuildLogs(appName: string): Promise { const http = this.http; return Promise.resolve() // - .then(http.fetch(http.GET, '/user/apps/appData/' + appName, {})); + .then(http.fetch(http.GET, '/user/appData/' + appName, {})); // TODO user/apps/appData } - uploadAppData(appName: string, file: File) { + uploadAppData(appName: string, file: fs.ReadStream) { const http = this.http; - var formData = new FormData(); - formData.append('sourceFile', file); return Promise.resolve() // - .then(http.fetch(http.POST, '/user/apps/appData/' + appName + '?detached=1', formData)); + .then(http.fetch(http.POST, '/user/appData/' + appName + '?detached=1', { sourceFile: file })); // TODO user/apps/appData } uploadCaptainDefinitionContent( diff --git a/app-cli/src/api/CliApiManager.ts b/app-cli/src/api/CliApiManager.ts index bfbef63..f6795c7 100644 --- a/app-cli/src/api/CliApiManager.ts +++ b/app-cli/src/api/CliApiManager.ts @@ -24,10 +24,12 @@ export default class CliApiManager { if (!CliApiManager.instances[hashKey]) CliApiManager.instances[hashKey] = new ApiManager(capMachine.baseUrl + '/api/v1', function(token) { capMachine.authToken = token; - StorageHelper.get().saveMachine(capMachine); + if (capMachine.name) StorageHelper.get().saveMachine(capMachine); return Promise.resolve(); }); + CliApiManager.instances[hashKey].setAuthToken(capMachine.authToken); + return CliApiManager.instances[hashKey]; } } diff --git a/app-cli/src/api/HttpClient.ts b/app-cli/src/api/HttpClient.ts index 1f7f947..9b7e716 100644 --- a/app-cli/src/api/HttpClient.ts +++ b/app-cli/src/api/HttpClient.ts @@ -1,6 +1,6 @@ -import axios from 'axios'; import ErrorFactory from '../utils/ErrorFactory'; import Logger from '../utils/Logger'; +import * as Request from 'request-promise'; var TOKEN_HEADER = 'x-captain-auth'; var NAMESPACE = 'x-namespace'; @@ -45,15 +45,17 @@ export default class HttpClient { .then(function() { return self.fetchInternal(method, endpoint, variables); // }) - .then(function(axiosResponse) { - const data = axiosResponse.data; // this is an axios thing! + .then(function(requestResponse) { + const data = JSON.parse(requestResponse); if (data.status === ErrorFactory.STATUS_AUTH_TOKEN_INVALID) { return self .onAuthFailure() // .then(function() { - return self.fetchInternal(method, endpoint, variables).then(function(newAxiosResponse) { - return newAxiosResponse.data; - }); + return self + .fetchInternal(method, endpoint, variables) + .then(function(newRequestResponse) { + return newRequestResponse; + }); }); } else { return data; @@ -80,6 +82,7 @@ export default class HttpClient { }); }) .catch(function(error) { + Logger.log(''); Logger.error(error.message || error); return new Promise(function(resolve, reject) { if (!self.isDestroyed) return reject(error); @@ -99,26 +102,23 @@ export default class HttpClient { getReq(endpoint: string, variables: any) { const self = this; - return axios - .get(this.baseUrl + endpoint, { - params: variables, - headers: self.createHeaders() - }) // - .then(function(data) { - //console.log(data); - return data; - }); + + return Request.get(this.baseUrl + endpoint, { + headers: self.createHeaders(), + qs: variables + }).then(function(data) { + return data; + }); } postReq(endpoint: string, variables: any) { const self = this; - return axios - .post(this.baseUrl + endpoint, variables, { - headers: self.createHeaders() - }) // - .then(function(data) { - //console.log(data); - return data; - }); + + return Request.post(this.baseUrl + endpoint, { + headers: self.createHeaders(), + formData: variables + }).then(function(data) { + return data; + }); } } diff --git a/app-cli/src/commands/captainduckduck.ts b/app-cli/src/commands/captainduckduck.ts index d9b9a02..7099cd8 100755 --- a/app-cli/src/commands/captainduckduck.ts +++ b/app-cli/src/commands/captainduckduck.ts @@ -11,8 +11,8 @@ import * as program from 'commander'; import login from './login'; import list from './list'; import logout from './logout'; +import deploy from './deploy'; // import serversetup = require('./serversetup'); -// import deploy = require('./deploy'); // Setup program.version(packagejson.version).description(packagejson.description); @@ -41,21 +41,21 @@ program.command('logout').description('Logout from a specific Captain machine.') // serversetup(); // }); -// program -// .command('deploy') -// .description( -// "Deploy your app (current directory) to a specific Captain machine. You'll be prompted to choose your Captain machine." -// ) -// .option('-t, --tarFile ', 'Specify file to be uploaded (rather than using git archive)') -// .option('-d, --default', 'Run with default options') -// .option('-s, --stateless', 'Run deploy stateless') -// .option('-h, --host ', 'Only for stateless mode: Host of the captain machine') -// .option('-a, --appName ', 'Only for stateless mode: Name of the app') -// .option('-p, --pass ', 'Only for stateless mode: Password for Captain') -// .option('-b, --branch ', 'Only for stateless mode: Branch name (default master)') -// .action((options: any) => { -// deploy(options); -// }); +program + .command('deploy') + .description( + "Deploy your app (current directory) to a specific Captain machine. You'll be prompted to choose your Captain machine." + ) + .option('-t, --tarFile ', 'Specify file to be uploaded (rather than using git archive)') + .option('-d, --default', 'Run with default options') + .option('-s, --stateless', 'Run deploy stateless') + .option('-h, --host ', 'Only for stateless mode: Host of the captain machine') + .option('-a, --appName ', 'Only for stateless mode: Name of the app') + .option('-p, --pass ', 'Only for stateless mode: Password for Captain') + .option('-b, --branch ', 'Only for stateless mode: Branch name (default master)') + .action((options: any) => { + deploy(options); + }); // Error on unknown commands program.on('command:*', () => { diff --git a/app-cli/src/commands/deploy.ts b/app-cli/src/commands/deploy.ts new file mode 100644 index 0000000..ed92266 --- /dev/null +++ b/app-cli/src/commands/deploy.ts @@ -0,0 +1,142 @@ +#!/usr/bin/env node + +import * as inquirer from 'inquirer'; +import StdOutUtil from '../utils/StdOutUtil'; +import { validateIsGitRepository, validateDefinitionFile, ensureAuthentication } from '../utils/ValidationsHandler'; +import { IMachine, IDeployedDirectory } from '../models/storage/StoredObjects'; +import StorageHelper from '../utils/StorageHelper'; +import CliHelper from '../utils/CliHelper'; +import { IHashMapGeneric } from '../models/IHashMapGeneric'; +import DeployHelper from '../utils/DeployHelper'; + +// async function deployAsStateless(host: string, appName: string, branch: string, pass: string) { +// const isStateless = host && appName && branch && pass; + +// if (isStateless) { +// // login first +// StdOutUtil.printMessage(`Trying to login to ${host}\n`); + +// const { name } = DeployApi.machineToDeploy; +// const response = await LoginApi.loginMachine(host, pass); +// const data = JSON.parse(response); +// const newToken = data.token; + +// // Update the token to the machine that corresponds (if needed) +// MachineHelper.updateMachineAuthToken(name, newToken); + +// if (data) { +// StdOutUtil.printMessage(`Starting stateless deploy to\n${host}\n${branch}\n${appName}`); + +// deployFromGitProject(); +// } +// } else { +// StdOutUtil.printError( +// 'You are missing parameters for deploying on stateless. ' +// ); +// } +// } + +// async function deployFromTarFile(tarFile: string) { +// try { +// const isValidAuthentication = await validateAuthentication(); + +// if (isValidAuthentication) { +// // Send from tar file +// const filePath = tarFile; +// const gitHash = 'sendviatarfile'; + +// await uploadFile(filePath, gitHash); +// } else { +// StdOutUtil.printError('Incorrect login details', true); +// } +// } catch (e) { +// StdOutUtil.printError(e.message, true); +// } +// } + +async function deploy(options: any) { + const possibleApp = StorageHelper.get() + .getDeployedDirectories() + .find((dir: IDeployedDirectory) => dir.cwd === process.cwd()); + + if (!options.tarFile) { + if (!validateIsGitRepository() || !validateDefinitionFile()) { + return; + } + } + + StdOutUtil.printMessage('Preparing deployment to Captain...\n'); + + let deployParams: IHashMapGeneric = possibleApp + ? { + captainNameToDeploy: possibleApp.machineNameToDeploy, + branchToPush: possibleApp.branchToPush, + appName: possibleApp.appName + } + : {}; + + if (options.default) { // TODO + //deployAsDefaultValues(); + //} + // else if (options.stateless) { + // deployAsStateless(options.host, options.appName, options.branch, options.pass); + // } + // else if (options.tarFile) { + // deployFromTarFile(options.tarFile); + } else { + const questions = [ + { + type: 'list', + name: 'captainNameToDeploy', + default: possibleApp ? possibleApp.machineNameToDeploy : '', + message: 'Select the Captain Machine you want to deploy to:', + choices: CliHelper.get().getMachinesAsOptions() + }, + { + type: 'input', + default: possibleApp ? possibleApp.branchToPush : 'master', + name: 'branchToPush', + message: "Enter the 'git' branch you would like to deploy:", + when: (answers: IHashMapGeneric) => !!answers.captainNameToDeploy + }, + { + type: 'input', + default: possibleApp ? possibleApp.appName : '', + name: 'appName', + message: 'Enter the Captain app name this directory will be deployed to:', + when: (answers: IHashMapGeneric) => !!answers.branchToPush + }, + { + type: 'confirm', + name: 'confirmedToDeploy', + message: + 'Note that uncommitted files and files in gitignore (if any) will not be pushed to server. Please confirm so that deployment process can start.', + default: true, + when: (answers: IHashMapGeneric) => !!answers.appName + } + ]; + const answers = (await inquirer.prompt(questions)) as IHashMapGeneric; + + if (!answers.confirmedToDeploy) { + StdOutUtil.printMessage('\nOperation cancelled by the user...\n'); + process.exit(0); + return; + } + deployParams = answers; + } + + const branchToPush = deployParams.branchToPush; + const appName = deployParams.appName; + const capMachine = StorageHelper.get() + .getMachines() + .find((machine) => machine.name === deployParams.captainNameToDeploy)!; + + try { + await new DeployHelper(capMachine, appName, branchToPush) // + .deployFromGitProject(); + } catch (e) { + StdOutUtil.printError(e.message, true); + } +} + +export default deploy; diff --git a/app-cli/src/commands/login.ts b/app-cli/src/commands/login.ts index 40a8806..a6dc5c6 100644 --- a/app-cli/src/commands/login.ts +++ b/app-cli/src/commands/login.ts @@ -12,44 +12,6 @@ import CliApiManager from '../api/CliApiManager'; const SAMPLE_DOMAIN = Constants.SAMPLE_DOMAIN; const cleanUpUrl = Utils.cleanUpUrl; -// const DeployApi = require('../api/DeployApi'); -// const { cleanUpUrl, findDefaultCaptainName } = require('../utils/loginHelpers'); -// const { SAMPLE_DOMAIN } = require('../utils/constants'); -// const LoginApi = require('../api/LoginApi'); - -// In case the token is expired -// async function requestLogin() { -// const { baseUrl, name } = DeployApi.machineToDeploy; - -// printMessage('Your auth token is not valid anymore. Try to login again.'); - -// const questions = [ -// { -// type: 'password', -// name: 'captainPassword', -// message: 'Please enter your password for ' + baseUrl, -// validate: (value: string) => { -// if (value && value.trim()) { -// return true; -// } - -// return 'Please enter your password for ' + baseUrl; -// } -// } -// ]; -// const loginPassword = await inquirer.prompt(questions); -// const password = loginPassword.captainPassword; -// const response = await LoginApi.loginMachine(baseUrl, password); -// const data = JSON.parse(response); -// const newToken = data.token; - -// if (!newToken) return false; - -// // Update the token to the machine that corresponds -// MachineHelper.updateMachineAuthToken(name, newToken); - -// return true; -// } async function login() { StdOutUtil.printMessage('Login to a Captain Machine'); diff --git a/app-cli/src/commands/requestLogin.ts b/app-cli/src/commands/requestLogin.ts new file mode 100644 index 0000000..bb7fd75 --- /dev/null +++ b/app-cli/src/commands/requestLogin.ts @@ -0,0 +1,29 @@ +import StdOutUtil from '../utils/StdOutUtil'; +import * as inquirer from 'inquirer'; +import { IMachine } from '../models/storage/StoredObjects'; +import CliApiManager from '../api/CliApiManager'; + +// In case the token is expired +export default async function requestLogin(machine: IMachine) { + const { baseUrl } = machine; + + StdOutUtil.printMessage('Your auth token is not valid anymore. Try to login again.'); + + const questions = [ + { + type: 'password', + name: 'captainPassword', + message: 'Please enter your password for ' + baseUrl, + validate: (value: string) => { + if (value && value.trim()) { + return true; + } + + return 'Please enter your password for ' + baseUrl; + } + } + ]; + const loginPassword = (await inquirer.prompt(questions)) as any; + const password = loginPassword.captainPassword; + const responseIgnore = await CliApiManager.get(machine).getAuthToken(password); +} diff --git a/app-cli/src/models/IBuildLogs.ts b/app-cli/src/models/IBuildLogs.ts new file mode 100644 index 0000000..b4ffca7 --- /dev/null +++ b/app-cli/src/models/IBuildLogs.ts @@ -0,0 +1,8 @@ +export default interface IBuildLogs { + isAppBuilding: boolean; + isBuildFailed: boolean; + logs: { + firstLineNumber: number; + lines: string[]; + }; +}; diff --git a/app-cli/src/utils/DeployHelper.ts b/app-cli/src/utils/DeployHelper.ts new file mode 100644 index 0000000..61115e5 --- /dev/null +++ b/app-cli/src/utils/DeployHelper.ts @@ -0,0 +1,184 @@ +#!/usr/bin/env node + +import * as inquirer from 'inquirer'; +import * as fs from 'fs-extra'; +import * as path from 'path'; +import { exec } from 'child_process'; +import StdOutUtil from '../utils/StdOutUtil'; +const ProgressBar = require('progress'); +const commandExistsSync = require('command-exists').sync; +import { validateIsGitRepository, validateDefinitionFile, ensureAuthentication } from '../utils/ValidationsHandler'; +import { IMachine, IDeployedDirectory } from '../models/storage/StoredObjects'; +import CliApiManager from '../api/CliApiManager'; +import SpinnerHelper from '../utils/SpinnerHelper'; +import IBuildLogs from '../models/IBuildLogs'; + +export default class DeployHelper { + private lastLineNumberPrinted = -10000; // we want to show all lines to begin with! + + constructor(private machineToDeploy: IMachine, private appName: string, private branchToPush: string) { + // + } + + private gitArchiveFile(zipFileFullPath: string) { + const self = this; + return new Promise(function(resolve, reject) { + exec( + `git archive --format tar --output "${zipFileFullPath}" ${self.branchToPush}`, + (err, stdout, stderr) => { + if (err) { + StdOutUtil.printError(`TAR file failed\n${err}\n`); + + fs.removeSync(zipFileFullPath); + + reject(new Error('TAR file failed')); + return; + } + + exec(`git rev-parse ${self.branchToPush}`, (err, stdout, stderr) => { + const gitHash = (stdout || '').trim(); + + if (err || !/^[a-f0-9]{40}$/.test(gitHash)) { + StdOutUtil.printError( + `Cannot find hash of last commit on this branch: ${self.branchToPush}\n${gitHash}\n${err}\n` + ); + reject(new Error('rev-parse failed')); + + return; + } + + StdOutUtil.printMessage(`Pushing last commit on ${self.branchToPush}: ${gitHash}`); + resolve(); + }); + } + ); + }); + } + + private getFileStream(zipFileFullPath: string) { + const fileSize = fs.statSync(zipFileFullPath).size; + const fileStream = fs.createReadStream(zipFileFullPath); + const barOpts = { + width: 20, + total: fileSize, + clear: false + }; + const bar = new ProgressBar(' uploading [:bar] :percent (ETA :etas)', barOpts); + + fileStream.on('data', (chunk) => { + bar.tick(chunk.length); + }); + + fileStream.on('end', () => { + StdOutUtil.printMessage('This might take several minutes. PLEASE BE PATIENT...'); + + SpinnerHelper.start('Building your source code...'); + + SpinnerHelper.setColor('yellow'); + }); + + return fileStream; + } + + async deployFromGitProject() { + const appName = this.appName; + const branchToPush = this.branchToPush; + const machineToDeploy = this.machineToDeploy; + + if (!appName || !branchToPush || !machineToDeploy) { + StdOutUtil.printError('Default deploy failed. Missing appName or branchToPush or machineToDeploy.', true); + return; + } + + if (!commandExistsSync('git')) { + StdOutUtil.printError("'git' command not found..."); + + StdOutUtil.printError("Captain needs 'git' to create tar file of your source files...", true); + return; + } + + StdOutUtil.printMessage(`Deploying ${appName} to ${machineToDeploy.name}`); + + await ensureAuthentication(machineToDeploy); + + const zipFileNameToDeploy = 'temporary-captain-to-deploy.tar'; + const zipFileFullPath = path.join(process.cwd(), zipFileNameToDeploy); + + StdOutUtil.printMessage(`Saving tar file to:\n${zipFileFullPath}\n`); + + // Removes the temporary file created + if (fs.pathExistsSync(zipFileFullPath)) fs.removeSync(zipFileFullPath); + + await this.gitArchiveFile(zipFileFullPath); + + try { + StdOutUtil.printMessage(`Uploading the file to ${machineToDeploy.baseUrl}`); + + await CliApiManager.get(machineToDeploy).uploadAppData(appName, this.getFileStream(zipFileFullPath)); + + StdOutUtil.printMessage(`Upload done.`); + + fs.removeSync(zipFileFullPath); + + this.startFetchingBuildLogs(machineToDeploy, appName); + } catch (e) { + if (fs.pathExistsSync(zipFileFullPath)) fs.removeSync(zipFileFullPath); + + throw e; + } + } + + private async onLogRetrieved(data: IBuildLogs | undefined, machineToDeploy: IMachine, appName: string) { + const self = this; + if (data) { + const lines = data.logs.lines; + const firstLineNumberOfLogs = data.logs.firstLineNumber; + let firstLinesToPrint = 0; + + if (firstLineNumberOfLogs > this.lastLineNumberPrinted) { + if (firstLineNumberOfLogs < 0) { + // This is the very first fetch, probably firstLineNumberOfLogs is around -50 + firstLinesToPrint = -firstLineNumberOfLogs; + } else { + StdOutUtil.printMessage('[[ TRUNCATED ]]'); + } + } else { + firstLinesToPrint = this.lastLineNumberPrinted - firstLineNumberOfLogs; + } + + this.lastLineNumberPrinted = firstLineNumberOfLogs + lines.length; + + for (let i = firstLinesToPrint; i < lines.length; i++) { + StdOutUtil.printMessage((lines[i] || '').trim()); + } + } + + if (data && !data.isAppBuilding) { + if (!data.isBuildFailed) { + const appUrl = self.machineToDeploy.baseUrl + .replace('https://', 'http://') + .replace('//captain.', '//' + appName + '.'); + StdOutUtil.printGreenMessage(`Deployed successfully: ${appName}`); + + StdOutUtil.printMagentaMessage(`App is available at ${appUrl}`, true); + } else { + StdOutUtil.printError(`\nSomething bad happened. Cannot deploy "${appName}"\n`, true); + } + } else { + setTimeout(() => { + this.startFetchingBuildLogs(machineToDeploy, appName); + }, 2000); + } + } + + private async startFetchingBuildLogs(machineToDeploy: IMachine, appName: string) { + const self = this; + try { + const data = await CliApiManager.get(machineToDeploy).fetchBuildLogs(appName); + this.onLogRetrieved(data, machineToDeploy, appName); + } catch (error) { + StdOutUtil.printError(`\nSomething while retrieving app build logs.. ${error}\n`); + this.onLogRetrieved(undefined, machineToDeploy, appName); + } + } +} diff --git a/app-cli/src/utils/SpinnerHelper.ts b/app-cli/src/utils/SpinnerHelper.ts index e2db6d4..dc002d7 100644 --- a/app-cli/src/utils/SpinnerHelper.ts +++ b/app-cli/src/utils/SpinnerHelper.ts @@ -24,4 +24,4 @@ class SpinnerHelper { } } -export default SpinnerHelper; +export default new SpinnerHelper(); diff --git a/app-cli/src/utils/ValidationsHandler.ts b/app-cli/src/utils/ValidationsHandler.ts new file mode 100644 index 0000000..7d5043d --- /dev/null +++ b/app-cli/src/utils/ValidationsHandler.ts @@ -0,0 +1,84 @@ +import StdOutUtil from './StdOutUtil'; +import { IMachine } from '../models/storage/StoredObjects'; +import CliApiManager from '../api/CliApiManager'; +import requestLogin from '../commands/requestLogin'; + +const fs = require('fs-extra'); + +export function validateIsGitRepository() { + const gitFolderExists = fs.pathExistsSync('./.git'); + + if (!gitFolderExists) { + StdOutUtil.printError( + '\n**** ERROR: You are not in a git root directory. This command will only deploys the current directory ****\n', + true + ); + } + + return !!gitFolderExists; +} + +export function validateDefinitionFile() { + const captainDefinitionExists = fs.pathExistsSync('./captain-definition'); + + if (!captainDefinitionExists) { + StdOutUtil.printError('\n**** ERROR: captain-definition file cannot be found. Please see docs! ****\n', true); + } else { + const contents = fs.readFileSync('./captain-definition', 'utf8'); + let contentsJson = null; + + try { + contentsJson = JSON.parse(contents); + } catch (e) { + StdOutUtil.printError(`**** ERROR: captain-definition file is not a valid JSON! ****\n Error:${e}`, true); + } + + if (contentsJson) { + if (!contentsJson.schemaVersion) { + StdOutUtil.printError( + '**** ERROR: captain-definition needs schemaVersion. Please see docs! ****', + true + ); + } else if (!contentsJson.templateId && !contentsJson.dockerfileLines) { + StdOutUtil.printError( + '**** ERROR: captain-definition needs templateId or dockerfileLines. Please see docs! ****', + true + ); + } else if (contentsJson.templateId && contentsJson.dockerfileLines) { + StdOutUtil.printError( + '**** ERROR: captain-definition needs templateId or dockerfileLines, NOT BOTH! Please see docs! ****', + true + ); + } else { + return true; + } + } + } + + return false; +} + +export function isIpAddress(ipaddress: string) { + if ( + /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test( + ipaddress + ) + ) { + return true; + } + + return false; +} +export async function ensureAuthentication(machine: IMachine) { + let isAuthenticated = false; + try { + let ignoreVal = await CliApiManager.get(machine).getAllApps(); + isAuthenticated = true; + } catch (e) { + // ignore + } + + if (!isAuthenticated) { + const loggedInStatus = await requestLogin(machine); + } +} diff --git a/app-cli/yarn.lock b/app-cli/yarn.lock index 3888fe9..dca898b 100644 --- a/app-cli/yarn.lock +++ b/app-cli/yarn.lock @@ -461,14 +461,6 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== -axios@^0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.18.0.tgz#32d53e4851efdc0a11993b6cd000789d70c05102" - integrity sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI= - dependencies: - follow-redirects "^1.3.0" - is-buffer "^1.1.5" - babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" @@ -1204,7 +1196,7 @@ data-urls@^1.0.0: whatwg-mimetype "^2.2.0" whatwg-url "^7.0.0" -debug@3.1.0, debug@=3.1.0: +debug@3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== @@ -1829,13 +1821,6 @@ flush-write-stream@^1.0.0: inherits "^2.0.1" readable-stream "^2.0.4" -follow-redirects@^1.3.0: - version "1.6.1" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.6.1.tgz#514973c44b5757368bad8bddfe52f81f015c94cb" - integrity sha512-t2JCjbzxQpWvbhts3l6SH1DKzSrx8a+SsaVf4h6bG4kOXUuPYS/kg2Lr4gQSb7eemaHqJkOThF1BGyjlUkO1GQ== - dependencies: - debug "=3.1.0" - for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -4716,6 +4701,16 @@ request-promise-native@^1.0.5: stealthy-require "^1.1.0" tough-cookie ">=2.3.3" +request-promise@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/request-promise/-/request-promise-4.2.2.tgz#d1ea46d654a6ee4f8ee6a4fea1018c22911904b4" + integrity sha1-0epG1lSm7k+O5qT+oQGMIpEZBLQ= + dependencies: + bluebird "^3.5.0" + request-promise-core "1.1.1" + stealthy-require "^1.1.0" + tough-cookie ">=2.3.3" + request@^2.74.0, request@^2.87.0, request@^2.88.0: version "2.88.0" resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" From ea3305f72a46bec94d8d564f59ea043565c21264 Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Sun, 6 Jan 2019 12:27:09 -0800 Subject: [PATCH 38/44] deploy working --- app-cli/built/commands/deploy.js | 142 +++++++-------- app-cli/built/commands/deploy.js.map | 2 +- app-cli/built/utils/CliHelper.js | 17 ++ app-cli/built/utils/CliHelper.js.map | 2 +- app-cli/built/utils/DeployHelper.js | 81 +++++---- app-cli/built/utils/DeployHelper.js.map | 2 +- app-cli/built/utils/StorageHelper.js | 3 + app-cli/built/utils/StorageHelper.js.map | 2 +- app-cli/built/utils/ValidationsHandler.js | 8 +- app-cli/built/utils/ValidationsHandler.js.map | 2 +- app-cli/src/commands/deploy.ts | 165 +++++++++--------- app-cli/src/models/storage/StoredObjects.ts | 13 +- app-cli/src/utils/CliHelper.ts | 26 ++- app-cli/src/utils/DeployHelper.ts | 128 ++++++++------ app-cli/src/utils/StorageHelper.ts | 4 + app-cli/src/utils/ValidationsHandler.ts | 9 +- 16 files changed, 349 insertions(+), 257 deletions(-) diff --git a/app-cli/built/commands/deploy.js b/app-cli/built/commands/deploy.js index 255f596..e364537 100755 --- a/app-cli/built/commands/deploy.js +++ b/app-cli/built/commands/deploy.js @@ -15,116 +15,120 @@ const ValidationsHandler_1 = require("../utils/ValidationsHandler"); const StorageHelper_1 = require("../utils/StorageHelper"); const CliHelper_1 = require("../utils/CliHelper"); const DeployHelper_1 = require("../utils/DeployHelper"); -// async function deployAsStateless(host: string, appName: string, branch: string, pass: string) { -// const isStateless = host && appName && branch && pass; -// if (isStateless) { -// // login first -// StdOutUtil.printMessage(`Trying to login to ${host}\n`); -// const { name } = DeployApi.machineToDeploy; -// const response = await LoginApi.loginMachine(host, pass); -// const data = JSON.parse(response); -// const newToken = data.token; -// // Update the token to the machine that corresponds (if needed) -// MachineHelper.updateMachineAuthToken(name, newToken); -// if (data) { -// StdOutUtil.printMessage(`Starting stateless deploy to\n${host}\n${branch}\n${appName}`); -// deployFromGitProject(); -// } -// } else { -// StdOutUtil.printError( -// 'You are missing parameters for deploying on stateless. ' -// ); -// } -// } -// async function deployFromTarFile(tarFile: string) { -// try { -// const isValidAuthentication = await validateAuthentication(); -// if (isValidAuthentication) { -// // Send from tar file -// const filePath = tarFile; -// const gitHash = 'sendviatarfile'; -// await uploadFile(filePath, gitHash); -// } else { -// StdOutUtil.printError('Incorrect login details', true); -// } -// } catch (e) { -// StdOutUtil.printError(e.message, true); -// } -// } +const CliApiManager_1 = require("../api/CliApiManager"); function deploy(options) { return __awaiter(this, void 0, void 0, function* () { const possibleApp = StorageHelper_1.default.get() .getDeployedDirectories() .find((dir) => dir.cwd === process.cwd()); - if (!options.tarFile) { + StdOutUtil_1.default.printMessage('Preparing deployment to Captain...\n'); + let deployParams = { deploySource: {} }; + if (options.default) { + deployParams = { + captainMachine: possibleApp ? StorageHelper_1.default.get().findMachine(possibleApp.machineNameToDeploy) : undefined, + deploySource: possibleApp ? possibleApp.deploySource : {}, + appName: possibleApp ? possibleApp.appName : undefined + }; + } + if (options.appName) { + deployParams.appName = options.appName; + } + if (options.branch) { + deployParams.deploySource.branchToPush = options.branch; + } + if (options.tarFile) { + deployParams.deploySource.tarFilePath = options.tarFile; + } + if (!deployParams.deploySource.tarFilePath) { if (!ValidationsHandler_1.validateIsGitRepository() || !ValidationsHandler_1.validateDefinitionFile()) { return; } } - StdOutUtil_1.default.printMessage('Preparing deployment to Captain...\n'); - let deployParams = possibleApp - ? { - captainNameToDeploy: possibleApp.machineNameToDeploy, - branchToPush: possibleApp.branchToPush, - appName: possibleApp.appName + if (options.pass || options.host) { + if (options.pass && options.host) { + deployParams.captainMachine = { + authToken: '', + baseUrl: options.host, + name: '' + }; + yield CliApiManager_1.default.get(deployParams.captainMachine).getAuthToken(options.pass); + } + else { + StdOutUtil_1.default.printError('host and pass should be either both defined or both undefined', true); + return; } - : {}; - if (options.default) { - //deployAsDefaultValues(); - //} - // else if (options.stateless) { - // deployAsStateless(options.host, options.appName, options.branch, options.pass); - // } - // else if (options.tarFile) { - // deployFromTarFile(options.tarFile); } - else { + // Show questions for what is being missing in deploy params + let allApps = undefined; + if (deployParams.captainMachine) { + allApps = yield ValidationsHandler_1.ensureAuthentication(deployParams.captainMachine); + } + { const questions = [ { type: 'list', name: 'captainNameToDeploy', default: possibleApp ? possibleApp.machineNameToDeploy : '', message: 'Select the Captain Machine you want to deploy to:', - choices: CliHelper_1.default.get().getMachinesAsOptions() + choices: CliHelper_1.default.get().getMachinesAsOptions(), + when: () => !deployParams.captainMachine, + filter: (capName) => __awaiter(this, void 0, void 0, function* () { + deployParams.captainMachine = StorageHelper_1.default.get().findMachine(capName); + if (deployParams.captainMachine) + allApps = yield ValidationsHandler_1.ensureAuthentication(deployParams.captainMachine); + return capName; + }) }, { type: 'input', - default: possibleApp ? possibleApp.branchToPush : 'master', + default: possibleApp && possibleApp.deploySource.branchToPush + ? possibleApp.deploySource.branchToPush + : 'master', name: 'branchToPush', message: "Enter the 'git' branch you would like to deploy:", - when: (answers) => !!answers.captainNameToDeploy + filter: (branchToPushEntered) => __awaiter(this, void 0, void 0, function* () { + deployParams.deploySource.branchToPush = branchToPushEntered; + return branchToPushEntered; + }), + when: (answers) => !deployParams.deploySource.branchToPush && + !deployParams.deploySource.tarFilePath && + !!deployParams.captainMachine }, { - type: 'input', + type: 'list', default: possibleApp ? possibleApp.appName : '', name: 'appName', message: 'Enter the Captain app name this directory will be deployed to:', - when: (answers) => !!answers.branchToPush + choices: (answers) => { + return CliHelper_1.default.get().getAppsAsOptions(allApps); + }, + filter: (appNameEntered) => __awaiter(this, void 0, void 0, function* () { + deployParams.appName = appNameEntered; + return appNameEntered; + }), + when: (answers) => (!!deployParams.deploySource.branchToPush || !!deployParams.deploySource.tarFilePath) && + !deployParams.appName }, { type: 'confirm', name: 'confirmedToDeploy', message: 'Note that uncommitted files and files in gitignore (if any) will not be pushed to server. Please confirm so that deployment process can start.', default: true, - when: (answers) => !!answers.appName + when: (answers) => !!deployParams.appName && + !!deployParams.captainMachine && + (!!deployParams.deploySource.branchToPush || !!deployParams.deploySource.tarFilePath) } ]; - const answers = (yield inquirer.prompt(questions)); - if (!answers.confirmedToDeploy) { + const answersToIgnore = (yield inquirer.prompt(questions)); + if (!answersToIgnore.confirmedToDeploy) { StdOutUtil_1.default.printMessage('\nOperation cancelled by the user...\n'); process.exit(0); return; } - deployParams = answers; } - const branchToPush = deployParams.branchToPush; - const appName = deployParams.appName; - const capMachine = StorageHelper_1.default.get() - .getMachines() - .find((machine) => machine.name === deployParams.captainNameToDeploy); try { - yield new DeployHelper_1.default(capMachine, appName, branchToPush) // - .deployFromGitProject(); + yield new DeployHelper_1.default(deployParams) // + .startDeploy(); } catch (e) { StdOutUtil_1.default.printError(e.message, true); diff --git a/app-cli/built/commands/deploy.js.map b/app-cli/built/commands/deploy.js.map index 868a463..653f173 100755 --- a/app-cli/built/commands/deploy.js.map +++ b/app-cli/built/commands/deploy.js.map @@ -1 +1 @@ -{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,qCAAqC;AACrC,oDAA6C;AAC7C,oEAAoH;AAEpH,0DAAmD;AACnD,kDAA2C;AAE3C,wDAAiD;AAEjD,kGAAkG;AAClG,0DAA0D;AAE1D,sBAAsB;AACtB,mBAAmB;AACnB,6DAA6D;AAE7D,gDAAgD;AAChD,8DAA8D;AAC9D,uCAAuC;AACvC,iCAAiC;AAEjC,oEAAoE;AACpE,0DAA0D;AAE1D,gBAAgB;AAChB,8FAA8F;AAE9F,6BAA6B;AAC7B,MAAM;AACN,YAAY;AACZ,2BAA2B;AAC3B,oGAAoG;AACpG,OAAO;AACP,KAAK;AACL,IAAI;AAEJ,sDAAsD;AACtD,SAAS;AACT,kEAAkE;AAElE,iCAAiC;AACjC,2BAA2B;AAC3B,+BAA+B;AAC/B,uCAAuC;AAEvC,0CAA0C;AAC1C,aAAa;AACb,6DAA6D;AAC7D,MAAM;AACN,iBAAiB;AACjB,4CAA4C;AAC5C,KAAK;AACL,IAAI;AAEJ,SAAe,MAAM,CAAC,OAAY;;QACjC,MAAM,WAAW,GAAG,uBAAa,CAAC,GAAG,EAAE;aACrC,sBAAsB,EAAE;a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AC,YAAY,CAAC,YAAY,CAAC,WAAW,CAAC;wBACrF,CAAC,YAAY,CAAC,OAAO;iBACtB;gBACD;oBACC,IAAI,EAAE,SAAS;oBACf,IAAI,EAAE,mBAAmB;oBACzB,OAAO,EACN,gJAAgJ;oBACjJ,OAAO,EAAE,IAAI;oBACb,IAAI,EAAE,CAAC,OAAgC,EAAE,EAAE,CAC1C,CAAC,CAAC,YAAY,CAAC,OAAO;wBACtB,CAAC,CAAC,YAAY,CAAC,cAAc;wBAC7B,CAAC,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,YAAY,IAAI,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,WAAW,CAAC;iBACtF;aACD,CAAC;YACF,MAAM,eAAe,GAAG,CAAC,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAA4B,CAAC;YAEtF,IAAI,CAAC,eAAe,CAAC,iBAAiB,EAAE;gBACvC,oBAAU,CAAC,YAAY,CAAC,wCAAwC,CAAC,CAAC;gBAClE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAChB,OAAO;aACP;SACD;QAED,IAAI;YACH,MAAM,IAAI,sBAAY,CAAC,YAAY,CAAC,CAAC,EAAE;iBACrC,WAAW,EAAE,CAAC;SAChB;QAAC,OAAO,CAAC,EAAE;YACX,oBAAU,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;SACvC;IACF,CAAC;CAAA;AAED,kBAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/app-cli/built/utils/CliHelper.js b/app-cli/built/utils/CliHelper.js index 0ba307a..f31c5a8 100755 --- a/app-cli/built/utils/CliHelper.js +++ b/app-cli/built/utils/CliHelper.js @@ -8,6 +8,23 @@ class CliHelper { CliHelper.instance = new CliHelper(); return CliHelper.instance; } + getAppsAsOptions(apps) { + const firstItemInOption = [ + { + name: '-- CANCEL --', + value: '', + short: '' + } + ]; + const listOfApps = apps.map((app) => { + return { + name: `${app.appName}`, + value: `${app.appName}`, + short: `${app.appName}` + }; + }); + return [...firstItemInOption, ...listOfApps]; + } getMachinesAsOptions() { const machines = StorageHelper_1.default.get().getMachines(); const firstItemInOption = [ diff --git a/app-cli/built/utils/CliHelper.js.map b/app-cli/built/utils/CliHelper.js.map index ed55c3d..b968ed8 100755 --- a/app-cli/built/utils/CliHelper.js.map +++ b/app-cli/built/utils/CliHelper.js.map @@ -1 +1 @@ -{"version":3,"file":"CliHelper.js","sourceRoot":"","sources":["../../src/utils/CliHelper.ts"],"names":[],"mappings":";;AAAA,mDAA4C;AAE5C,6CAAsC;AAEtC,MAAqB,SAAS;IAG7B,MAAM,CAAC,GAAG;QACT,IAAI,CAAC,SAAS,CAAC,QAAQ;YAAE,SAAS,CAAC,QAAQ,GAAG,IAAI,SAAS,EAAE,CAAC;QAC9D,OAAO,SAAS,CAAC,QAAQ,CAAC;IAC3B,CAAC;IAED,oBAAoB;QACnB,MAAM,QAAQ,GAAG,uBAAa,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAA;QAClD,MAAM,iBAAiB,GAAG;YACzB;gBACC,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE,EAAE;gBACT,KAAK,EAAE,EAAE;aACT;SACD,CAAC;QACF,MAAM,cAAc,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;YAC/C,OAAO;gBACN,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,OAAO,OAAO,CAAC,OAAO,EAAE;gBAC7C,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE;gBACxB,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,OAAO,OAAO,CAAC,OAAO,EAAE;aAC9C,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,CAAE,GAAG,iBAAiB,EAAE,GAAG,cAAc,CAAE,CAAC;IACpD,CAAC;IAED,aAAa,CAAC,WAAmB;QAChC,MAAM,cAAc,GAAI,uBAAa,CAAC,GAAG,E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,GAAG,uBAAa,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;QACtE,oBAAU,CAAC,YAAY,CAAC,+BAA+B,cAAc,CAAC,IAAI,OAAO,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC;IACjH,CAAC;IAED,sBAAsB;QACrB,IAAI,aAAa,GAAG,uBAAa,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;QACjE,MAAM,IAAI,GAAG,IAAI,CAAC;QAElB,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE;YAC1C,aAAa,EAAE,CAAC;SAChB;QAED,OAAO,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAC/C,CAAC;IAED,kBAAkB,CAAC,MAAc;QAChC,MAAM,YAAY,GAAG,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;QAEzD,OAAO,WAAW,YAAY,EAAE,CAAC;IAClC,CAAC;IAED,aAAa,CAAC,YAAoB;QACjC,MAAM,IAAI,GAAG,IAAI,CAAC;QAClB,IAAI,KAAK,GAAG,IAAI,CAAC;QACjB,uBAAa,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,CAAC,OAAiB,EAAE,EAAE;YAC3D,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,EAAE;gBAC3D,KAAK,GAAG,KAAK,CAAC;aACd;QACF,CAAC,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACd,CAAC;CACD;AAhFD,4BAgFC"} \ No newline at end of file diff --git a/app-cli/built/utils/DeployHelper.js b/app-cli/built/utils/DeployHelper.js index 610858e..280bb9d 100755 --- a/app-cli/built/utils/DeployHelper.js +++ b/app-cli/built/utils/DeployHelper.js @@ -15,36 +15,41 @@ const child_process_1 = require("child_process"); const StdOutUtil_1 = require("../utils/StdOutUtil"); const ProgressBar = require('progress'); const commandExistsSync = require('command-exists').sync; -const ValidationsHandler_1 = require("../utils/ValidationsHandler"); const CliApiManager_1 = require("../api/CliApiManager"); const SpinnerHelper_1 = require("../utils/SpinnerHelper"); class DeployHelper { - constructor(machineToDeploy, appName, branchToPush) { - this.machineToDeploy = machineToDeploy; - this.appName = appName; - this.branchToPush = branchToPush; + constructor(deployParams) { + this.deployParams = deployParams; this.lastLineNumberPrinted = -10000; // we want to show all lines to begin with! // } - gitArchiveFile(zipFileFullPath) { + gitArchiveFile(zipFileFullPath, branchToPush) { const self = this; return new Promise(function (resolve, reject) { - child_process_1.exec(`git archive --format tar --output "${zipFileFullPath}" ${self.branchToPush}`, (err, stdout, stderr) => { + // Removes the temporary file created + if (fs.pathExistsSync(zipFileFullPath)) + fs.removeSync(zipFileFullPath); + if (!commandExistsSync('git')) { + StdOutUtil_1.default.printError("'git' command not found...\nCaptain needs 'git' to create tar file of your source files...", true); + reject("Captain needs 'git' to create tar file of your source files..."); + return; + } + child_process_1.exec(`git archive --format tar --output "${zipFileFullPath}" ${branchToPush}`, (err, stdout, stderr) => { if (err) { StdOutUtil_1.default.printError(`TAR file failed\n${err}\n`); fs.removeSync(zipFileFullPath); reject(new Error('TAR file failed')); return; } - child_process_1.exec(`git rev-parse ${self.branchToPush}`, (err, stdout, stderr) => { + child_process_1.exec(`git rev-parse ${branchToPush}`, (err, stdout, stderr) => { const gitHash = (stdout || '').trim(); if (err || !/^[a-f0-9]{40}$/.test(gitHash)) { - StdOutUtil_1.default.printError(`Cannot find hash of last commit on this branch: ${self.branchToPush}\n${gitHash}\n${err}\n`); + StdOutUtil_1.default.printError(`Cannot find hash of last commit on this branch: ${branchToPush}\n${gitHash}\n${err}\n`); reject(new Error('rev-parse failed')); return; } - StdOutUtil_1.default.printMessage(`Pushing last commit on ${self.branchToPush}: ${gitHash}`); - resolve(); + StdOutUtil_1.default.printMessage(`Pushing last commit on ${branchToPush}: ${gitHash}`); + resolve(gitHash); }); }); }); @@ -63,50 +68,55 @@ class DeployHelper { }); fileStream.on('end', () => { StdOutUtil_1.default.printMessage('This might take several minutes. PLEASE BE PATIENT...'); - SpinnerHelper_1.default.start('Building your source code...'); + SpinnerHelper_1.default.start('Building your source code...\n'); SpinnerHelper_1.default.setColor('yellow'); }); return fileStream; } - deployFromGitProject() { + startDeploy() { return __awaiter(this, void 0, void 0, function* () { - const appName = this.appName; - const branchToPush = this.branchToPush; - const machineToDeploy = this.machineToDeploy; - if (!appName || !branchToPush || !machineToDeploy) { - StdOutUtil_1.default.printError('Default deploy failed. Missing appName or branchToPush or machineToDeploy.', true); + const appName = this.deployParams.appName; + const branchToPush = this.deployParams.deploySource.branchToPush; + const tarFilePath = this.deployParams.deploySource.tarFilePath; + const machineToDeploy = this.deployParams.captainMachine; + if (!appName || (!branchToPush && !tarFilePath) || !machineToDeploy) { + StdOutUtil_1.default.printError('Default deploy failed. Missing appName or branchToPush/tarFilePath or machineToDeploy.', true); return; } - if (!commandExistsSync('git')) { - StdOutUtil_1.default.printError("'git' command not found..."); - StdOutUtil_1.default.printError("Captain needs 'git' to create tar file of your source files...", true); + if (branchToPush && tarFilePath) { + StdOutUtil_1.default.printError('Default deploy failed. branchToPush/tarFilePath cannot both be present.', true); return; } + let tarFileCreatedByCli = false; + const tarFileNameToDeploy = tarFilePath ? tarFilePath : 'temporary-captain-to-deploy.tar'; + const tarFileFullPath = tarFileNameToDeploy.startsWith('/') + ? tarFileNameToDeploy // absolute path + : path.join(process.cwd(), tarFileNameToDeploy); // relative path + let gitHash = ''; + if (branchToPush) { + tarFileCreatedByCli = true; + StdOutUtil_1.default.printMessage(`Saving tar file to:\n${tarFileFullPath}\n`); + gitHash = yield this.gitArchiveFile(tarFileFullPath, branchToPush); + } StdOutUtil_1.default.printMessage(`Deploying ${appName} to ${machineToDeploy.name}`); - yield ValidationsHandler_1.ensureAuthentication(machineToDeploy); - const zipFileNameToDeploy = 'temporary-captain-to-deploy.tar'; - const zipFileFullPath = path.join(process.cwd(), zipFileNameToDeploy); - StdOutUtil_1.default.printMessage(`Saving tar file to:\n${zipFileFullPath}\n`); - // Removes the temporary file created - if (fs.pathExistsSync(zipFileFullPath)) - fs.removeSync(zipFileFullPath); - yield this.gitArchiveFile(zipFileFullPath); try { StdOutUtil_1.default.printMessage(`Uploading the file to ${machineToDeploy.baseUrl}`); - yield CliApiManager_1.default.get(machineToDeploy).uploadAppData(appName, this.getFileStream(zipFileFullPath)); + yield CliApiManager_1.default.get(machineToDeploy).uploadAppData(appName, this.getFileStream(tarFileFullPath)); StdOutUtil_1.default.printMessage(`Upload done.`); - fs.removeSync(zipFileFullPath); + if (tarFileCreatedByCli && fs.pathExistsSync(tarFileFullPath)) + fs.removeSync(tarFileFullPath); this.startFetchingBuildLogs(machineToDeploy, appName); } catch (e) { - if (fs.pathExistsSync(zipFileFullPath)) - fs.removeSync(zipFileFullPath); + if (tarFileCreatedByCli && fs.pathExistsSync(tarFileFullPath)) + fs.removeSync(tarFileFullPath); throw e; } }); } onLogRetrieved(data, machineToDeploy, appName) { return __awaiter(this, void 0, void 0, function* () { + const self = this; if (data) { const lines = data.logs.lines; const firstLineNumberOfLogs = data.logs.firstLineNumber; @@ -130,8 +140,11 @@ class DeployHelper { } if (data && !data.isAppBuilding) { if (!data.isBuildFailed) { + const appUrl = self.deployParams.captainMachine.baseUrl + .replace('https://', 'http://') + .replace('//captain.', '//' + appName + '.'); StdOutUtil_1.default.printGreenMessage(`Deployed successfully: ${appName}`); - StdOutUtil_1.default.printMagentaMessage(`App is available`, true); // TODO add url + StdOutUtil_1.default.printMagentaMessage(`App is available at ${appUrl}`, true); } else { StdOutUtil_1.default.printError(`\nSomething bad happened. Cannot deploy "${appName}"\n`, true); diff --git a/app-cli/built/utils/DeployHelper.js.map b/app-cli/built/utils/DeployHelper.js.map index 233f620..c368780 100755 --- a/app-cli/built/utils/DeployHelper.js.map +++ b/app-cli/built/utils/DeployHelper.js.map @@ -1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I,CAAC,IAAI,CAAC,aAAa,EAAE;oBACxB,oBAAU,CAAC,iBAAiB,CAAC,0BAA0B,OAAO,EAAE,CAAC,CAAC;oBAElE,oBAAU,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC,CAAC,eAAe;iBACzE;qBAAM;oBACN,oBAAU,CAAC,UAAU,CAAC,4CAA4C,OAAO,KAAK,EAAE,IAAI,CAAC,CAAC;iBACtF;aACD;iBAAM;gBACN,UAAU,CAAC,GAAG,EAAE;oBACf,IAAI,CAAC,sBAAsB,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;gBACvD,CAAC,EAAE,IAAI,CAAC,CAAC;aACT;QACF,CAAC;KAAA;IAEa,sBAAsB,CAAC,eAAyB,EAAE,OAAe;;YAC9E,MAAM,IAAI,GAAG,IAAI,CAAC;YAClB,IAAI;gBACH,MAAM,IAAI,GAAG,MAAM,uBAAa,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;gBAC9E,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;aACpD;YAAC,OAAO,KAAK,EAAE;gBACf,oBAAU,CAAC,UAAU,CAAC,iDAAiD,KAAK,IAAI,CAAC,CAAC;gBAClF,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;aACzD;QACF,CAAC;KAAA;CACD;AApKD,+BAoKC"} \ No newline at end of file +{"version":3,"file":"DeployHelper.js","sourceRoot":"","sources":["../../src/utils/DeployHelper.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,+BAA+B;AAC/B,6BAA6B;AAC7B,iDAAqC;AACrC,oDAA6C;AAC7C,MAAM,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACxC,MAAM,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC;AAEzD,wDAAiD;AACjD,0DAAmD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AAS,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;aACzD;QACF,CAAC;KAAA;CACD;AAxLD,+BAwLC"} \ No newline at end of file diff --git a/app-cli/built/utils/StorageHelper.js b/app-cli/built/utils/StorageHelper.js index 5c5ce1b..64e3a47 100755 --- a/app-cli/built/utils/StorageHelper.js +++ b/app-cli/built/utils/StorageHelper.js @@ -17,6 +17,9 @@ class StorageHelper { getMachines() { return Utils_1.default.copyObject(this.data.get(CAP_MACHINES) || []); } + findMachine(machineName) { + return this.getMachines().find((m) => m.name === machineName); + } removeMachine(machineName) { const machines = this.getMachines(); const removedMachine = machines.filter((machine) => machine.name === machineName)[0]; diff --git a/app-cli/built/utils/StorageHelper.js.map b/app-cli/built/utils/StorageHelper.js.map index 725cbaf..69096c2 100755 --- a/app-cli/built/utils/StorageHelper.js.map +++ b/app-cli/built/utils/StorageHelper.js.map @@ -1 +1 @@ -{"version":3,"file":"StorageHelper.js","sourceRoot":"","sources":["../../src/utils/StorageHelper.ts"],"names":[],"mappings":";;AACA,2CAA2C;AAC3C,mCAA4B;AAE5B,MAAM,YAAY,GAAG,aAAa,CAAC;AACnC,MAAM,aAAa,GAAG,cAAc,CAAC;AAErC,MAAqB,aAAa;IAGjC,MAAM,CAAC,GAAG;QACT,IAAI,CAAC,aAAa,CAAC,QAAQ;YAAE,aAAa,CAAC,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;QAC1E,OAAO,aAAa,CAAC,QAAQ,CAAC;IAC/B,CAAC;IAID;QACC,IAAI,CAAC,IAAI,GAAG,IAAI,WAAW,CAAC,qBAAqB,CAAC,CAAC;QACnD,qBAAqB;IACtB,CAAC;IAED,WAAW;QACV,OAAO,eAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED,aAAa,CAAC,WAAmB;QAChC,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAA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,CAAC;QACvB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YACrD,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;YAChC,IAAI,OAAO,CAAC,GAAG,KAAK,uBAAuB,CAAC,GAAG,EAAE;gBAChD,UAAU,GAAG,IAAI,CAAC;gBAClB,QAAQ,CAAC,KAAK,CAAC,GAAG,uBAAuB,CAAC;gBAC1C,MAAM;aACN;SACD;QAED,IAAI,CAAC,UAAU,EAAE;YAChB,QAAQ,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;SACvC;QAED,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC;CACD;AArED,gCAqEC"} \ No newline at end of file +{"version":3,"file":"StorageHelper.js","sourceRoot":"","sources":["../../src/utils/StorageHelper.ts"],"names":[],"mappings":";;AACA,2CAA2C;AAC3C,mCAA4B;AAE5B,MAAM,YAAY,GAAG,aAAa,CAAC;AACnC,MAAM,aAAa,GAAG,cAAc,CAAC;AAErC,MAAqB,aAAa;IAGjC,MAAM,CAAC,GAAG;QACT,IAAI,CAAC,aAAa,CAAC,QAAQ;YAAE,aAAa,CAAC,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;QAC1E,OAAO,aAAa,CAAC,QAAQ,CAAC;IAC/B,CAAC;IAID;QACC,IAAI,CAAC,IAAI,GAAG,IAAI,WAAW,CAAC,qBAAqB,CAAC,CAAC;QACnD,qBAAqB;IACtB,CAAC;IAED,WAAW;QACV,OAAO,eAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED,WAAW,CAAC,WAAmB;QAC9B,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,C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C,CAAC;IAC7D,CAAC;IAED,qBAAqB,CAAC,uBAA2C;QAChE,MAAM,QAAQ,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC/C,IAAI,UAAU,GAAG,KAAK,CAAC;QACvB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YACrD,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;YAChC,IAAI,OAAO,CAAC,GAAG,KAAK,uBAAuB,CAAC,GAAG,EAAE;gBAChD,UAAU,GAAG,IAAI,CAAC;gBAClB,QAAQ,CAAC,KAAK,CAAC,GAAG,uBAAuB,CAAC;gBAC1C,MAAM;aACN;SACD;QAED,IAAI,CAAC,UAAU,EAAE;YAChB,QAAQ,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;SACvC;QAED,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC;CACD;AAzED,gCAyEC"} \ No newline at end of file diff --git a/app-cli/built/utils/ValidationsHandler.js b/app-cli/built/utils/ValidationsHandler.js index 6cb5850..2186cec 100755 --- a/app-cli/built/utils/ValidationsHandler.js +++ b/app-cli/built/utils/ValidationsHandler.js @@ -62,16 +62,18 @@ exports.isIpAddress = isIpAddress; function ensureAuthentication(machine) { return __awaiter(this, void 0, void 0, function* () { let isAuthenticated = false; + let allApps = undefined; try { - let ignoreVal = yield CliApiManager_1.default.get(machine).getAllApps(); - isAuthenticated = true; + allApps = yield CliApiManager_1.default.get(machine).getAllApps(); } catch (e) { // ignore } - if (!isAuthenticated) { + if (!allApps) { const loggedInStatus = yield requestLogin_1.default(machine); + allApps = yield CliApiManager_1.default.get(machine).getAllApps(); } + return allApps; }); } exports.ensureAuthentication = ensureAuthentication; diff --git a/app-cli/built/utils/ValidationsHandler.js.map b/app-cli/built/utils/ValidationsHandler.js.map index 342f56f..1f736af 100755 --- a/app-cli/built/utils/ValidationsHandler.js.map +++ b/app-cli/built/utils/ValidationsHandler.js.map @@ -1 +1 @@ -{"version":3,"file":"ValidationsHandler.js","sourceRoot":"","sources":["../../src/utils/ValidationsHandler.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,6CAAsC;AAEtC,wDAAiD;AACjD,2DAAoD;AAEpD,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAE/B,SAAgB,uBAAuB;IACtC,MAAM,eAAe,GAAG,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAEpD,IAAI,CAAC,eAAe,EAAE;QACrB,oBAAU,CAAC,UAAU,CACpB,gHAAgH,EAChH,IAAI,CACJ,CAAC;KACF;IAED,OAAO,CAAC,CAAC,eAAe,CAAC;AAC1B,CAAC;AAXD,0DAWC;AAED,SAAgB,sBAAsB;IACrC,MAAM,uBAAuB,GAAG,EAAE,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;IAE1E,IAAI,CAAC,uBAAuB,EAAE;QAC7B,oBAAU,CAAC,UAAU,CAAC,gFAAgF,EAAE,IAAI,CAAC,CAAC;KAC9G;SAAM;QACN,MAAM,QAAQ,GAAG,EAAE,CAAC,YAAY,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;QACjE,IAAI,YAAY,GAAG,IAAI,CAAC;QAExB,IAAI;YACH,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;SACpC;QAAC,OAAO,CAAC,EAAE;YACX,oBAAU,CAAC,UAAU,CAAC,yEAAyE,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;SAC1G;QAED,IAAI,YAAY,EAAE;YACjB,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE;gBAChC,oBAAU,CAAC,UAAU,CACpB,2EAA2E,EAC3E,IAAI,CACJ,CAAC;aACF;iBAAM,IAAI,CAAC,YAAY,CAAC,UAAU,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE;gBACrE,oBAAU,CAAC,UAAU,CACpB,2FAA2F,EAC3F,IAAI,CACJ,CAAC;aACF;iBAAM,IAAI,YAAY,CAAC,UAAU,IAAI,YAAY,CAAC,eAAe,EAAE;gBACnE,oBAAU,CAAC,UAAU,CACpB,qGAAqG,EACrG,IAAI,CACJ,CAAC;aACF;iBAAM;gBACN,OAAO,IAAI,CAAC;aACZ;SACD;KACD;IAED,OAAO,KAAK,CAAC;AACd,CAAC;AAtCD,wDAsCC;AAED,SAAgB,WAAW,CAAC,SAAiB;IAC5C,IACC,kKAAkK,CAAC,IAAI,CACtK,SAAS,CACT,EACA;QACD,OAAO,IAAI,CAAC;KACZ;IAED,OAAO,KAAK,CAAC;AACd,CAAC;AAVD,kCAUC;AACD,SAAsB,oBAAoB,CAAC,OAAiB;;QAC3D,IAAI,eAAe,GAAG,KAAK,CAAC;QAC5B,IAAI;YACH,IAAI,SAAS,GAAG,MAAM,uBAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,CAAC;YAC9D,eAAe,GAAG,IAAI,CAAC;SACvB;QAAC,OAAO,CAAC,EAAE;YACX,SAAS;SACT;QAED,IAAI,CAAC,eAAe,EAAE;YACrB,MAAM,cAAc,GAAG,MAAM,sBAAY,CAAC,OAAO,CAAC,CAAC;SACnD;IACF,CAAC;CAAA;AAZD,oDAYC"} \ No newline at end of file +{"version":3,"file":"ValidationsHandler.js","sourceRoot":"","sources":["../../src/utils/ValidationsHandler.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,6CAAsC;AAEtC,wDAAiD;AACjD,2DAAoD;AAEpD,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAE/B,SAAgB,uBAAuB;IACtC,MAAM,eAAe,GAAG,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAEpD,IAAI,CAAC,eAAe,EAAE;QACrB,oBAAU,CAAC,UAAU,CACpB,gHAAgH,EAChH,IAAI,CACJ,CAAC;KACF;IA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AACD,SAAsB,oBAAoB,CAAC,OAAiB;;QAC3D,IAAI,eAAe,GAAG,KAAK,CAAC;QAC5B,IAAI,OAAO,GAAG,SAAS,CAAC;QACxB,IAAI;YACH,OAAO,GAAG,MAAM,uBAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,CAAC;SACxD;QAAC,OAAO,CAAC,EAAE;YACX,SAAS;SACT;QAED,IAAI,CAAC,OAAO,EAAE;YACb,MAAM,cAAc,GAAG,MAAM,sBAAY,CAAC,OAAO,CAAC,CAAC;YACnD,OAAO,GAAG,MAAM,uBAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,CAAC;SACxD;QAED,OAAO,OAAO,CAAA;IACf,CAAC;CAAA;AAfD,oDAeC"} \ No newline at end of file diff --git a/app-cli/src/commands/deploy.ts b/app-cli/src/commands/deploy.ts index ed92266..5b16719 100644 --- a/app-cli/src/commands/deploy.ts +++ b/app-cli/src/commands/deploy.ts @@ -3,108 +3,115 @@ import * as inquirer from 'inquirer'; import StdOutUtil from '../utils/StdOutUtil'; import { validateIsGitRepository, validateDefinitionFile, ensureAuthentication } from '../utils/ValidationsHandler'; -import { IMachine, IDeployedDirectory } from '../models/storage/StoredObjects'; +import { IMachine, IDeployedDirectory, IDeploySource, IDeployParams } from '../models/storage/StoredObjects'; import StorageHelper from '../utils/StorageHelper'; import CliHelper from '../utils/CliHelper'; import { IHashMapGeneric } from '../models/IHashMapGeneric'; import DeployHelper from '../utils/DeployHelper'; - -// async function deployAsStateless(host: string, appName: string, branch: string, pass: string) { -// const isStateless = host && appName && branch && pass; - -// if (isStateless) { -// // login first -// StdOutUtil.printMessage(`Trying to login to ${host}\n`); - -// const { name } = DeployApi.machineToDeploy; -// const response = await LoginApi.loginMachine(host, pass); -// const data = JSON.parse(response); -// const newToken = data.token; - -// // Update the token to the machine that corresponds (if needed) -// MachineHelper.updateMachineAuthToken(name, newToken); - -// if (data) { -// StdOutUtil.printMessage(`Starting stateless deploy to\n${host}\n${branch}\n${appName}`); - -// deployFromGitProject(); -// } -// } else { -// StdOutUtil.printError( -// 'You are missing parameters for deploying on stateless. ' -// ); -// } -// } - -// async function deployFromTarFile(tarFile: string) { -// try { -// const isValidAuthentication = await validateAuthentication(); - -// if (isValidAuthentication) { -// // Send from tar file -// const filePath = tarFile; -// const gitHash = 'sendviatarfile'; - -// await uploadFile(filePath, gitHash); -// } else { -// StdOutUtil.printError('Incorrect login details', true); -// } -// } catch (e) { -// StdOutUtil.printError(e.message, true); -// } -// } +import CliApiManager from '../api/CliApiManager'; async function deploy(options: any) { const possibleApp = StorageHelper.get() .getDeployedDirectories() .find((dir: IDeployedDirectory) => dir.cwd === process.cwd()); - if (!options.tarFile) { + StdOutUtil.printMessage('Preparing deployment to Captain...\n'); + + let deployParams: IDeployParams = { deploySource: {} }; + + if (options.default) { + deployParams = { + captainMachine: possibleApp ? StorageHelper.get().findMachine(possibleApp.machineNameToDeploy) : undefined, + deploySource: possibleApp ? possibleApp.deploySource : {}, + appName: possibleApp ? possibleApp.appName : undefined + }; + } + + if (options.appName) { + deployParams.appName = options.appName; + } + + if (options.branch) { + deployParams.deploySource.branchToPush = options.branch; + } + + if (options.tarFile) { + deployParams.deploySource.tarFilePath = options.tarFile; + } + + if (!deployParams.deploySource.tarFilePath) { if (!validateIsGitRepository() || !validateDefinitionFile()) { return; } } - StdOutUtil.printMessage('Preparing deployment to Captain...\n'); + if (options.pass || options.host) { + if (options.pass && options.host) { + deployParams.captainMachine = { + authToken: '', + baseUrl: options.host, + name: '' + }; + await CliApiManager.get(deployParams.captainMachine).getAuthToken(options.pass); + } else { + StdOutUtil.printError('host and pass should be either both defined or both undefined', true); + return; + } + } - let deployParams: IHashMapGeneric = possibleApp - ? { - captainNameToDeploy: possibleApp.machineNameToDeploy, - branchToPush: possibleApp.branchToPush, - appName: possibleApp.appName - } - : {}; + // Show questions for what is being missing in deploy params + let allApps: any = undefined; + if (deployParams.captainMachine) { + allApps = await ensureAuthentication(deployParams.captainMachine); + } - if (options.default) { // TODO - //deployAsDefaultValues(); - //} - // else if (options.stateless) { - // deployAsStateless(options.host, options.appName, options.branch, options.pass); - // } - // else if (options.tarFile) { - // deployFromTarFile(options.tarFile); - } else { + { const questions = [ { type: 'list', name: 'captainNameToDeploy', default: possibleApp ? possibleApp.machineNameToDeploy : '', message: 'Select the Captain Machine you want to deploy to:', - choices: CliHelper.get().getMachinesAsOptions() + choices: CliHelper.get().getMachinesAsOptions(), + when: () => !deployParams.captainMachine, + filter: async (capName: string) => { + deployParams.captainMachine = StorageHelper.get().findMachine(capName); + if (deployParams.captainMachine) allApps = await ensureAuthentication(deployParams.captainMachine); + return capName; + } }, { type: 'input', - default: possibleApp ? possibleApp.branchToPush : 'master', + default: + possibleApp && possibleApp.deploySource.branchToPush + ? possibleApp.deploySource.branchToPush + : 'master', name: 'branchToPush', message: "Enter the 'git' branch you would like to deploy:", - when: (answers: IHashMapGeneric) => !!answers.captainNameToDeploy + filter: async (branchToPushEntered: string) => { + deployParams.deploySource.branchToPush = branchToPushEntered; + return branchToPushEntered; + }, + when: (answers: IHashMapGeneric) => + !deployParams.deploySource.branchToPush && + !deployParams.deploySource.tarFilePath && + !!deployParams.captainMachine }, { - type: 'input', + type: 'list', default: possibleApp ? possibleApp.appName : '', name: 'appName', message: 'Enter the Captain app name this directory will be deployed to:', - when: (answers: IHashMapGeneric) => !!answers.branchToPush + choices: (answers: IHashMapGeneric) => { + return CliHelper.get().getAppsAsOptions(allApps); + }, + filter: async (appNameEntered: string) => { + deployParams.appName = appNameEntered; + return appNameEntered; + }, + when: (answers: IHashMapGeneric) => + (!!deployParams.deploySource.branchToPush || !!deployParams.deploySource.tarFilePath) && + !deployParams.appName }, { type: 'confirm', @@ -112,28 +119,24 @@ async function deploy(options: any) { message: 'Note that uncommitted files and files in gitignore (if any) will not be pushed to server. Please confirm so that deployment process can start.', default: true, - when: (answers: IHashMapGeneric) => !!answers.appName + when: (answers: IHashMapGeneric) => + !!deployParams.appName && + !!deployParams.captainMachine && + (!!deployParams.deploySource.branchToPush || !!deployParams.deploySource.tarFilePath) } ]; - const answers = (await inquirer.prompt(questions)) as IHashMapGeneric; + const answersToIgnore = (await inquirer.prompt(questions)) as IHashMapGeneric; - if (!answers.confirmedToDeploy) { + if (!answersToIgnore.confirmedToDeploy) { StdOutUtil.printMessage('\nOperation cancelled by the user...\n'); process.exit(0); return; } - deployParams = answers; } - const branchToPush = deployParams.branchToPush; - const appName = deployParams.appName; - const capMachine = StorageHelper.get() - .getMachines() - .find((machine) => machine.name === deployParams.captainNameToDeploy)!; - try { - await new DeployHelper(capMachine, appName, branchToPush) // - .deployFromGitProject(); + await new DeployHelper(deployParams) // + .startDeploy(); } catch (e) { StdOutUtil.printError(e.message, true); } diff --git a/app-cli/src/models/storage/StoredObjects.ts b/app-cli/src/models/storage/StoredObjects.ts index 8e48527..4916c55 100644 --- a/app-cli/src/models/storage/StoredObjects.ts +++ b/app-cli/src/models/storage/StoredObjects.ts @@ -11,9 +11,20 @@ export interface IOldSavedApp { machineToDeploy: IMachine; } +export interface IDeploySource { + branchToPush?: string; + tarFilePath?: string; +} + export interface IDeployedDirectory { cwd: string; appName: string; - branchToPush: string; + deploySource: IDeploySource; machineNameToDeploy: string; } + +export interface IDeployParams { + deploySource: IDeploySource; + captainMachine?: IMachine; + appName?: string; +} diff --git a/app-cli/src/utils/CliHelper.ts b/app-cli/src/utils/CliHelper.ts index 9fa0cae..ad1a868 100644 --- a/app-cli/src/utils/CliHelper.ts +++ b/app-cli/src/utils/CliHelper.ts @@ -10,8 +10,27 @@ export default class CliHelper { return CliHelper.instance; } + getAppsAsOptions(apps: any[]) { + const firstItemInOption = [ + { + name: '-- CANCEL --', + value: '', + short: '' + } + ]; + const listOfApps = apps.map((app) => { + return { + name: `${app.appName}`, + value: `${app.appName}`, + short: `${app.appName}` + }; + }); + + return [ ...firstItemInOption, ...listOfApps ]; + } + getMachinesAsOptions() { - const machines = StorageHelper.get().getMachines() + const machines = StorageHelper.get().getMachines(); const firstItemInOption = [ { name: '-- CANCEL --', @@ -31,11 +50,10 @@ export default class CliHelper { } logoutMachine(machineName: string) { - const removedMachine = StorageHelper.get().removeMachine(machineName); - StdOutUtil. printMessage(`You are now logged out from ${removedMachine.name} at ${removedMachine.baseUrl}...\n`); + const removedMachine = StorageHelper.get().removeMachine(machineName); + StdOutUtil.printMessage(`You are now logged out from ${removedMachine.name} at ${removedMachine.baseUrl}...\n`); } - findDefaultCaptainName() { let currentSuffix = StorageHelper.get().getMachines().length + 1; const self = this; diff --git a/app-cli/src/utils/DeployHelper.ts b/app-cli/src/utils/DeployHelper.ts index 61115e5..c07d4ff 100644 --- a/app-cli/src/utils/DeployHelper.ts +++ b/app-cli/src/utils/DeployHelper.ts @@ -1,14 +1,12 @@ #!/usr/bin/env node -import * as inquirer from 'inquirer'; import * as fs from 'fs-extra'; import * as path from 'path'; import { exec } from 'child_process'; import StdOutUtil from '../utils/StdOutUtil'; const ProgressBar = require('progress'); const commandExistsSync = require('command-exists').sync; -import { validateIsGitRepository, validateDefinitionFile, ensureAuthentication } from '../utils/ValidationsHandler'; -import { IMachine, IDeployedDirectory } from '../models/storage/StoredObjects'; +import { IMachine, IDeployParams } from '../models/storage/StoredObjects'; import CliApiManager from '../api/CliApiManager'; import SpinnerHelper from '../utils/SpinnerHelper'; import IBuildLogs from '../models/IBuildLogs'; @@ -16,42 +14,51 @@ import IBuildLogs from '../models/IBuildLogs'; export default class DeployHelper { private lastLineNumberPrinted = -10000; // we want to show all lines to begin with! - constructor(private machineToDeploy: IMachine, private appName: string, private branchToPush: string) { + constructor(private deployParams: IDeployParams) { // } - private gitArchiveFile(zipFileFullPath: string) { + private gitArchiveFile(zipFileFullPath: string, branchToPush: string) { const self = this; - return new Promise(function(resolve, reject) { - exec( - `git archive --format tar --output "${zipFileFullPath}" ${self.branchToPush}`, - (err, stdout, stderr) => { - if (err) { - StdOutUtil.printError(`TAR file failed\n${err}\n`); + return new Promise(function(resolve, reject) { + // Removes the temporary file created + if (fs.pathExistsSync(zipFileFullPath)) fs.removeSync(zipFileFullPath); - fs.removeSync(zipFileFullPath); + if (!commandExistsSync('git')) { + StdOutUtil.printError( + "'git' command not found...\nCaptain needs 'git' to create tar file of your source files...", + true + ); + reject("Captain needs 'git' to create tar file of your source files..."); + return; + } + + exec(`git archive --format tar --output "${zipFileFullPath}" ${branchToPush}`, (err, stdout, stderr) => { + if (err) { + StdOutUtil.printError(`TAR file failed\n${err}\n`); + + fs.removeSync(zipFileFullPath); + + reject(new Error('TAR file failed')); + return; + } + + exec(`git rev-parse ${branchToPush}`, (err, stdout, stderr) => { + const gitHash = (stdout || '').trim(); + + if (err || !/^[a-f0-9]{40}$/.test(gitHash)) { + StdOutUtil.printError( + `Cannot find hash of last commit on this branch: ${branchToPush}\n${gitHash}\n${err}\n` + ); + reject(new Error('rev-parse failed')); - reject(new Error('TAR file failed')); return; } - exec(`git rev-parse ${self.branchToPush}`, (err, stdout, stderr) => { - const gitHash = (stdout || '').trim(); - - if (err || !/^[a-f0-9]{40}$/.test(gitHash)) { - StdOutUtil.printError( - `Cannot find hash of last commit on this branch: ${self.branchToPush}\n${gitHash}\n${err}\n` - ); - reject(new Error('rev-parse failed')); - - return; - } - - StdOutUtil.printMessage(`Pushing last commit on ${self.branchToPush}: ${gitHash}`); - resolve(); - }); - } - ); + StdOutUtil.printMessage(`Pushing last commit on ${branchToPush}: ${gitHash}`); + resolve(gitHash); + }); + }); }); } @@ -72,7 +79,7 @@ export default class DeployHelper { fileStream.on('end', () => { StdOutUtil.printMessage('This might take several minutes. PLEASE BE PATIENT...'); - SpinnerHelper.start('Building your source code...'); + SpinnerHelper.start('Building your source code...\n'); SpinnerHelper.setColor('yellow'); }); @@ -80,49 +87,56 @@ export default class DeployHelper { return fileStream; } - async deployFromGitProject() { - const appName = this.appName; - const branchToPush = this.branchToPush; - const machineToDeploy = this.machineToDeploy; + async startDeploy() { + const appName = this.deployParams.appName; + const branchToPush = this.deployParams.deploySource.branchToPush; + const tarFilePath = this.deployParams.deploySource.tarFilePath; + const machineToDeploy = this.deployParams.captainMachine; - if (!appName || !branchToPush || !machineToDeploy) { - StdOutUtil.printError('Default deploy failed. Missing appName or branchToPush or machineToDeploy.', true); + if (!appName || (!branchToPush && !tarFilePath) || !machineToDeploy) { + StdOutUtil.printError( + 'Default deploy failed. Missing appName or branchToPush/tarFilePath or machineToDeploy.', + true + ); return; } - if (!commandExistsSync('git')) { - StdOutUtil.printError("'git' command not found..."); - - StdOutUtil.printError("Captain needs 'git' to create tar file of your source files...", true); + if (branchToPush && tarFilePath) { + StdOutUtil.printError('Default deploy failed. branchToPush/tarFilePath cannot both be present.', true); return; } + let tarFileCreatedByCli = false; + const tarFileNameToDeploy = tarFilePath ? tarFilePath : 'temporary-captain-to-deploy.tar'; + + const tarFileFullPath = tarFileNameToDeploy.startsWith('/') + ? tarFileNameToDeploy // absolute path + : path.join(process.cwd(), tarFileNameToDeploy); // relative path + + let gitHash = ''; + + if (branchToPush) { + tarFileCreatedByCli = true; + + StdOutUtil.printMessage(`Saving tar file to:\n${tarFileFullPath}\n`); + + gitHash = await this.gitArchiveFile(tarFileFullPath, branchToPush); + } + StdOutUtil.printMessage(`Deploying ${appName} to ${machineToDeploy.name}`); - await ensureAuthentication(machineToDeploy); - - const zipFileNameToDeploy = 'temporary-captain-to-deploy.tar'; - const zipFileFullPath = path.join(process.cwd(), zipFileNameToDeploy); - - StdOutUtil.printMessage(`Saving tar file to:\n${zipFileFullPath}\n`); - - // Removes the temporary file created - if (fs.pathExistsSync(zipFileFullPath)) fs.removeSync(zipFileFullPath); - - await this.gitArchiveFile(zipFileFullPath); - try { StdOutUtil.printMessage(`Uploading the file to ${machineToDeploy.baseUrl}`); - await CliApiManager.get(machineToDeploy).uploadAppData(appName, this.getFileStream(zipFileFullPath)); + await CliApiManager.get(machineToDeploy).uploadAppData(appName, this.getFileStream(tarFileFullPath)); StdOutUtil.printMessage(`Upload done.`); - fs.removeSync(zipFileFullPath); + if (tarFileCreatedByCli && fs.pathExistsSync(tarFileFullPath)) fs.removeSync(tarFileFullPath); this.startFetchingBuildLogs(machineToDeploy, appName); } catch (e) { - if (fs.pathExistsSync(zipFileFullPath)) fs.removeSync(zipFileFullPath); + if (tarFileCreatedByCli && fs.pathExistsSync(tarFileFullPath)) fs.removeSync(tarFileFullPath); throw e; } @@ -155,7 +169,7 @@ export default class DeployHelper { if (data && !data.isAppBuilding) { if (!data.isBuildFailed) { - const appUrl = self.machineToDeploy.baseUrl + const appUrl = self.deployParams.captainMachine!.baseUrl .replace('https://', 'http://') .replace('//captain.', '//' + appName + '.'); StdOutUtil.printGreenMessage(`Deployed successfully: ${appName}`); diff --git a/app-cli/src/utils/StorageHelper.ts b/app-cli/src/utils/StorageHelper.ts index 6810dde..8cbae2b 100644 --- a/app-cli/src/utils/StorageHelper.ts +++ b/app-cli/src/utils/StorageHelper.ts @@ -24,6 +24,10 @@ export default class StorageHelper { return Utils.copyObject(this.data.get(CAP_MACHINES) || []); } + findMachine(machineName: string) { + return this.getMachines().find((m) => m.name === machineName); + } + removeMachine(machineName: string) { const machines = this.getMachines(); const removedMachine = machines.filter((machine) => machine.name === machineName)[0]; diff --git a/app-cli/src/utils/ValidationsHandler.ts b/app-cli/src/utils/ValidationsHandler.ts index 7d5043d..d71b6df 100644 --- a/app-cli/src/utils/ValidationsHandler.ts +++ b/app-cli/src/utils/ValidationsHandler.ts @@ -71,14 +71,17 @@ export function isIpAddress(ipaddress: string) { } export async function ensureAuthentication(machine: IMachine) { let isAuthenticated = false; + let allApps = undefined; try { - let ignoreVal = await CliApiManager.get(machine).getAllApps(); - isAuthenticated = true; + allApps = await CliApiManager.get(machine).getAllApps(); } catch (e) { // ignore } - if (!isAuthenticated) { + if (!allApps) { const loggedInStatus = await requestLogin(machine); + allApps = await CliApiManager.get(machine).getAllApps(); } + + return allApps } From d4c1fa5dee2f7856e7c4ace41a00a8ceda56d96e Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Sun, 6 Jan 2019 15:45:57 -0800 Subject: [PATCH 39/44] CLI seems to be working --- app-cli/built/api/ApiManager.js | 2 +- app-cli/built/api/ApiManager.js.map | 2 +- app-cli/built/api/HttpClient.js | 20 +- app-cli/built/api/HttpClient.js.map | 2 +- app-cli/built/commands/captainduckduck.js | 14 +- app-cli/built/commands/captainduckduck.js.map | 2 +- app-cli/built/commands/login.js | 17 +- app-cli/built/commands/login.js.map | 2 +- app-cli/built/commands/serversetup.js | 186 ++++++++++++++++ app-cli/built/commands/serversetup.js.map | 1 + app-cli/built/utils/CliHelper.js | 7 + app-cli/built/utils/CliHelper.js.map | 2 +- app-cli/built/utils/StdOutUtil.js | 7 +- app-cli/built/utils/StdOutUtil.js.map | 2 +- app-cli/src/api/ApiManager.ts | 2 +- app-cli/src/api/HttpClient.ts | 23 +- app-cli/src/commands/captainduckduck.ts | 14 +- app-cli/src/commands/login.ts | 20 +- app-cli/src/commands/serversetup.ts | 202 ++++++++++++++++++ app-cli/src/utils/CliHelper.ts | 8 + app-cli/src/utils/StdOutUtil.ts | 6 +- 21 files changed, 487 insertions(+), 54 deletions(-) create mode 100755 app-cli/built/commands/serversetup.js create mode 100755 app-cli/built/commands/serversetup.js.map create mode 100644 app-cli/src/commands/serversetup.ts diff --git a/app-cli/built/api/ApiManager.js b/app-cli/built/api/ApiManager.js index 80b13bc..9927256 100755 --- a/app-cli/built/api/ApiManager.js +++ b/app-cli/built/api/ApiManager.js @@ -69,7 +69,7 @@ class ApiManager { uploadAppData(appName, file) { const http = this.http; return Promise.resolve() // - .then(http.fetch(http.POST, '/user/appData/' + appName + '?detached=1', { sourceFile: file })); // TODO user/apps/appData + .then(http.fetch(http.POST_DATA, '/user/appData/' + appName + '?detached=1', { sourceFile: file })); // TODO user/apps/appData } uploadCaptainDefinitionContent(appName, captainDefinition, gitHash, detached) { const http = this.http; diff --git a/app-cli/built/api/ApiManager.js.map b/app-cli/built/api/ApiManager.js.map index 4a0c135..6b2a359 100755 --- a/app-cli/built/api/ApiManager.js.map +++ b/app-cli/built/api/ApiManager.js.map @@ -1 +1 @@ -{"version":3,"file":"ApiManager.js","sourceRoot":"","sources":["../../src/api/ApiManager.ts"],"names":[],"mappings":";;AAAA,6CAAsC;AAStC,MAAqB,UAAU;IAU9B,YAAY,OAAe,EAAU,cAAoD;QAApD,mBAAc,GAAd,cAAc,CAAsC;QACxF,MAAM,IAAI,GAAG,IAAI,CAAC;QAElB,IAAI,CAAC,IAAI,GAAG,IAAI,oBAAU,CAAC,OAAO,EAAE,UAAU,CAAC,SAAS,EAAE;YACzD,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,OAAO;QACN,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;IACrB,CAAC;IAED,YAAY,CAAC,SAAiB;QAC7B,UAAU,CAAC,SAAS,GAAG,SAAS,CAAC;QACjC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,UAAU;QAChB,OAAO,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC;IAC/B,CAAC;IAED,YAAY,CAAC,QAAgB;QAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACvB,UAAU,CAAC,iBAAiB,GAAG,QAAQ,CAAC;QACxC,IAAI,gBAAgB,GAAG,EAAE,CAAC;QAE1B,MAAM,IAAI,GAAG,IAAI,CAAC;QAClB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE;aACzB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;aACnD,IAAI,CAAC,UAAS,IAAI;YAClB,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC;YAC9B,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,C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AC,0BAA0B;IAChF,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,GAAG,EAAE;IAC7C,CAAC,CAAC,WAAW,CAAC;AACA,oBAAS,GAAW,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB;IAClE,CAAC,CAAC,mPAAmP;IACrP,CAAC,CAAC,EAAE,CAAC;AANP,6BA4XC"} \ No newline at end of file +{"version":3,"file":"ApiManager.js","sourceRoot":"","sources":["../../src/api/ApiManager.ts"],"names":[],"mappings":";;AAAA,6CAAsC;AAStC,MAAqB,UAAU;IAU9B,YAAY,OAAe,EAAU,cAAoD;QAApD,mBAAc,GAAd,cAAc,CAAsC;QACxF,MAAM,IAAI,GAAG,IAAI,CAAC;QAElB,IAAI,CAAC,IAAI,GAAG,IAAI,oBAAU,CAAC,OAAO,EAAE,UAAU,CAAC,SAAS,EAAE;YACzD,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,OAAO;QACN,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;IACrB,CAAC;IAED,YAAY,CAAC,SAAiB;QAC7B,UAAU,CAAC,SAAS,GAAG,SAAS,CAAC;QACjC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,UAAU;QAChB,OAAO,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC;IAC/B,CAAC;IAED,YAAY,CAAC,QAAgB;QAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACvB,UAAU,CAAC,iBAAiB,GAAG,QAAQ,CAAC;QACxC,IAAI,gBAAgB,GAAG,EAAE,CAAC;QAE1B,MAAM,IAAI,GAAG,IAAI,CAAC;QAClB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE;aACzB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,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KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,oBAAoB,EAAE;YAC3C,QAAQ;YACR,UAAU;YACV,mBAAmB;YACnB,gBAAgB;SAChB,CAAC,CACF,CAAC;IACJ,CAAC;;AA1Xc,4BAAiB,GAAW,OAAO,CAAC,GAAG,CAAC,0BAA0B;IAChF,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,GAAG,EAAE;IAC7C,CAAC,CAAC,WAAW,CAAC;AACA,oBAAS,GAAW,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB;IAClE,CAAC,CAAC,mPAAmP;IACrP,CAAC,CAAC,EAAE,CAAC;AANP,6BA4XC"} \ No newline at end of file diff --git a/app-cli/built/api/HttpClient.js b/app-cli/built/api/HttpClient.js index 1be8a37..132367b 100755 --- a/app-cli/built/api/HttpClient.js +++ b/app-cli/built/api/HttpClient.js @@ -13,6 +13,7 @@ class HttpClient { this.onAuthFailure = onAuthFailure; this.GET = 'GET'; this.POST = 'POST'; + this.POST_DATA = 'POST_DATA'; this.isDestroyed = false; // } @@ -80,8 +81,8 @@ class HttpClient { }); }) .catch(function (error) { - Logger_1.default.log(''); - Logger_1.default.error(error.message || error); + // Logger.log(''); + // Logger.error(error.message || error); return new Promise(function (resolve, reject) { if (!self.isDestroyed) return reject(error); @@ -93,8 +94,8 @@ class HttpClient { fetchInternal(method, endpoint, variables) { if (method === this.GET) return this.getReq(endpoint, variables); - if (method === this.POST) - return this.postReq(endpoint, variables); + if (method === this.POST || method === this.POST_DATA) + return this.postReq(endpoint, variables, method); throw new Error('Unknown method: ' + method); } getReq(endpoint, variables) { @@ -106,11 +107,18 @@ class HttpClient { return data; }); } - postReq(endpoint, variables) { + postReq(endpoint, variables, method) { const self = this; + if (method === this.POST_DATA) + return Request.post(this.baseUrl + endpoint, { + headers: self.createHeaders(), + formData: variables + }).then(function (data) { + return data; + }); return Request.post(this.baseUrl + endpoint, { headers: self.createHeaders(), - formData: variables + form: variables }).then(function (data) { return data; }); diff --git a/app-cli/built/api/HttpClient.js.map b/app-cli/built/api/HttpClient.js.map index fcb3b47..335bd5f 100755 --- a/app-cli/built/api/HttpClient.js.map +++ b/app-cli/built/api/HttpClient.js.map @@ -1 +1 @@ -{"version":3,"file":"HttpClient.js","sourceRoot":"","sources":["../../src/api/HttpClient.ts"],"names":[],"mappings":";;AAAA,wDAAiD;AACjD,4CAAqC;AACrC,2CAA2C;AAE3C,IAAI,YAAY,GAAG,gBAAgB,CAAC;AACpC,IAAI,SAAS,GAAG,aAAa,CAAC;AAC9B,IAAI,OAAO,GAAG,SAAS,CAAC;AAExB,MAAqB,UAAU;IAK9B,YAAoB,OAAe,EAAU,SAAiB,EAAU,aAAiC;QAArF,YAAO,GAAP,OAAO,CAAQ;QAAU,cAAS,GAAT,SAAS,CAAQ;QAAU,kBAAa,GAAb,aAAa,CAAoB;QAJzF,QAAG,GAAG,KAAK,CAAC;QACZ,SAAI,GAAG,MAAM,CAAC;QACvB,gBAAW,GAAG,KAAK,CAAC;QAG1B,EAAE;IACH,CAAC;IAED,aAAa;QACZ,IAAI,OAAO,GAAQ,EAAE,CAAC;QACtB,IAAI,IAAI,CAAC,SAAS;YAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;QAC3D,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC;QAE7B,iFAAiF;QACjF,OAAO,OAAO,CAAC;IAChB,CAAC;IAED,YAAY,CAAC,SAAiB;QAC7B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC5B,CAAC;IAED,OAAO;QACN,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,MAAsB,EAAE,QAAgB,EAAE,SAAc;QAC7D,MAAM,IAAI,GAAG,IAAI,CAAC;QAClB,OAAO;YACN,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE;iBACzB,IAAI,CAAC;gBACL,IAAI,CAAC,OAAO,CAAC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979f0 100755 --- a/app-cli/built/commands/captainduckduck.js +++ b/app-cli/built/commands/captainduckduck.js @@ -11,7 +11,7 @@ const login_1 = require("./login"); const list_1 = require("./list"); const logout_1 = require("./logout"); const deploy_1 = require("./deploy"); -// import serversetup = require('./serversetup'); +const serversetup_1 = require("./serversetup"); // Setup program.version(packagejson.version).description(packagejson.description); // Commands @@ -27,12 +27,12 @@ program.command('list').alias('ls').description('List all Captain machines curre program.command('logout').description('Logout from a specific Captain machine.').action(() => { logout_1.default(); }); -// program -// .command('serversetup') -// .description('Performs necessary actions and prepares your Captain server.') -// .action(() => { -// serversetup(); -// }); +program + .command('serversetup') + .description('Performs necessary actions and prepares your Captain server.') + .action(() => { + serversetup_1.default(); +}); program .command('deploy') .description("Deploy your app (current directory) to a specific Captain machine. You'll be prompted to choose your Captain machine.") diff --git a/app-cli/built/commands/captainduckduck.js.map b/app-cli/built/commands/captainduckduck.js.map index 0eb581d..92d6b76 100755 --- a/app-cli/built/commands/captainduckduck.js.map +++ b/app-cli/built/commands/captainduckduck.js.map @@ -1 +1 @@ -{"version":3,"file":"captainduckduck.js","sourceRoot":"","sources":["../../src/commands/captainduckduck.ts"],"names":[],"mappings":";;;AAEA,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAClD,kDAAkD;AAClD,cAAc,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAEhE,oDAA6C;AAC7C,qCAAqC;AAErC,kBAAkB;AAClB,mCAA4B;AAC5B,iCAA0B;AAC1B,qCAA8B;AAC9B,qCAA8B;AAC9B,iDAAiD;AAEjD,QAAQ;AACR,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;AAE1E,WAAW;AAEX,OAAO;KACL,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,C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,qBAAW,EAAE,CAAC;AACf,CAAC,CAAC,CAAC;AAEJ,OAAO;KACL,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CACX,uHAAuH,CACvH;KACA,MAAM,CAAC,uBAAuB,EAAE,6DAA6D,CAAC;KAC9F,MAAM,CAAC,eAAe,EAAE,0BAA0B,CAAC;KACnD,MAAM,CAAC,iBAAiB,EAAE,sBAAsB,CAAC;KACjD,MAAM,CAAC,oBAAoB,EAAE,sDAAsD,CAAC;KACpF,MAAM,CAAC,uBAAuB,EAAE,0CAA0C,CAAC;KAC3E,MAAM,CAAC,oBAAoB,EAAE,+CAA+C,CAAC;KAC7E,MAAM,CAAC,sBAAsB,EAAE,uDAAuD,CAAC;KACvF,MAAM,CAAC,CAAC,OAAY,EAAE,EAAE;IACxB,gBAAM,CAAC,OAAO,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC;AAEJ,4BAA4B;AAC5B,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;IAC5B,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE7C,oBAAU,CAAC,UAAU,CAAC,sBAAsB,aAAa,gDAAgD,EAAE,IAAI,CAAC,CAAC;AAClH,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/login.js b/app-cli/built/commands/login.js index d413184..c0a6cb4 100755 --- a/app-cli/built/commands/login.js +++ b/app-cli/built/commands/login.js @@ -33,11 +33,15 @@ function login() { } if (!cleanUpUrl(value)) return 'This is an invalid URL: ' + value; + let found = undefined; StorageHelper_1.default.get().getMachines().map((machine) => { if (cleanUpUrl(machine.baseUrl) === cleanUpUrl(value)) { - return `${value} already exist as ${machine.name}. If you want to replace the existing entry, you have to first use command, and then re-login.`; + found = machine.name; } }); + if (found) { + return `${value} already exist as ${found} in your currently logged in machines. If you want to replace the existing entry, you have to first use command, and then re-login.`; + } if (value && value.trim()) { return true; } @@ -67,12 +71,11 @@ function login() { message: 'Enter a name for this Captain machine:', default: CliHelper_1.default.get().findDefaultCaptainName(), validate: (value) => { - StorageHelper_1.default.get().getMachines().map((machine) => { - if (machine.name === value) { - return `${value} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.`; - } - }); - if (value.match(/^[-\d\w]+$/i)) { + value = value.trim(); + if (StorageHelper_1.default.get().findMachine(value)) { + return `${value} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.`; + } + if (CliHelper_1.default.get().isNameValid(value)) { return true; } return 'Please enter a Captain Name.'; diff --git a/app-cli/built/commands/login.js.map b/app-cli/built/commands/login.js.map index 76e531a..39cb9af 100755 --- a/app-cli/built/commands/login.js.map +++ b/app-cli/built/commands/login.js.map @@ -1 +1 @@ -{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,qCAAqC;AACrC,oDAA6C;AAC7C,0DAAmD;AACnD,kDAA2C;AAC3C,0CAAmC;AACnC,kDAA2C;AAE3C,wDAAiD;AAEjD,MAAM,aAAa,GAAG,mBAAS,CAAC,aAAa,CAAC;AAC9C,MAAM,UAAU,GAAG,eAAK,CAAC,UAAU,CAAC;AAGpC,SAAe,KAAK;;QACnB,oBAAU,CAAC,YAAY,CAAC,4BAA4B,CAAC,CAAC;QAEtD,MAAM,SAAS,GAAG;YACjB;gBACC,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,aAAa;gBACtB,IAAI,EAAE,gBAAgB;gBACtB,OAAO,EAAE,sFAAsF;gBAC/F,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE;oBAC3B,IAAI,KAAK,KAAK,aAAa,EAAE;wBAC5B,OAAO,mBAAmB,CAAC;qBAC3B;oBAED,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;wBAAE,OAAO,0BAA0B,GAAG,KAAK,CAAC;oBAElE,uBAAa,CAA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YACvE,oBAAU,CAAC,iBAAiB,CAAC,uCAAuC,WAAW,KAAK,CAAC,CAAC;SACtF;QAAC,OAAO,KAAK,EAAE;YACf,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;YAE3D,oBAAU,CAAC,UAAU,CAAC,wCAAwC,WAAW,OAAO,YAAY,EAAE,CAAC,CAAC;SAChG;IACF,CAAC;CAAA;AAED,kBAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/serversetup.js b/app-cli/built/commands/serversetup.js new file mode 100755 index 0000000..e349594 --- /dev/null +++ b/app-cli/built/commands/serversetup.js @@ -0,0 +1,186 @@ +#!/usr/bin/env node +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const inquirer = require("inquirer"); +const Constants_1 = require("../utils/Constants"); +const StdOutUtil_1 = require("../utils/StdOutUtil"); +const ValidationsHandler_1 = require("../utils/ValidationsHandler"); +const CliApiManager_1 = require("../api/CliApiManager"); +const Utils_1 = require("../utils/Utils"); +const CliHelper_1 = require("../utils/CliHelper"); +const StorageHelper_1 = require("../utils/StorageHelper"); +const ErrorFactory_1 = require("../utils/ErrorFactory"); +const SpinnerHelper_1 = require("../utils/SpinnerHelper"); +let newPasswordFirstTry = undefined; +let lastWorkingPassword = Constants_1.default.DEFAULT_PASSWORD; +let captainMachine = { + authToken: '', + baseUrl: '', + name: '' +}; +const questions = [ + { + type: 'list', + name: 'hasInstalledCaptain', + message: 'Have you already installed Captain on your server by running the following line:' + + '\nmkdir /captain && docker run -p 80:80 -p 443:443 -p 3000:3000 -v /var/run/docker.sock:/var/run/docker.sock dockersaturn/captainduckduck ?', + default: 'Yes', + choices: ['Yes', 'No'], + filter: (value) => { + const answerFromUser = value.trim(); + if (answerFromUser === 'Yes') + return answerFromUser; + StdOutUtil_1.default.printMessage('\n\nCannot start the setup process if Captain is not installed.'); + StdOutUtil_1.default.printMessageAndExit('Please read tutorial on CaptainDuckDuck.com to learn how to install CaptainDuckDuck on a server.'); + } + }, + { + type: 'input', + default: Constants_1.default.SAMPLE_IP, + name: 'captainAddress', + message: 'Enter IP address of your captain server:', + filter: (value) => __awaiter(this, void 0, void 0, function* () { + const ipFromUser = value.trim(); + if (ipFromUser === Constants_1.default.SAMPLE_IP || !ValidationsHandler_1.isIpAddress(ipFromUser)) { + StdOutUtil_1.default.printError(`\nThis is an invalid IP Address: ${ipFromUser}`, true); + } + try { + // login using captain42. and set the ipAddressToServer + captainMachine.baseUrl = `http://${ipFromUser}:3000`; + yield CliApiManager_1.default.get(captainMachine).getAuthToken(lastWorkingPassword); + } + catch (e) { + // User may have used a different default password + if (e.captainStatus === ErrorFactory_1.default.STATUS_WRONG_PASSWORD) + return ''; + StdOutUtil_1.default.errorHandler(e); + } + return ipFromUser; + }) + }, + { + type: 'password', + name: 'captainOriginalPassword', + message: 'Enter your current password:', + when: () => !captainMachine.authToken, + filter: (value) => __awaiter(this, void 0, void 0, function* () { + try { + yield CliApiManager_1.default.get(captainMachine).getAuthToken(value); + lastWorkingPassword = value; + return ''; + } + catch (e) { + StdOutUtil_1.default.errorHandler(e); + } + }) + }, + { + type: 'input', + name: 'captainRootDomain', + message: 'Enter a root domain for this Captain server. For example, enter test.yourdomain.com if you' + + ' setup your DNS to point *.test.yourdomain.com to ip address of your server' + + ': ', + filter: (value) => __awaiter(this, void 0, void 0, function* () { + const captainRootDomainFromUser = value.trim(); + try { + yield CliApiManager_1.default.get(captainMachine).updateRootDomain(captainRootDomainFromUser); + captainMachine = Utils_1.default.copyObject(captainMachine); + captainMachine.baseUrl = `http://captain.${captainRootDomainFromUser}`; + } + catch (e) { + StdOutUtil_1.default.errorHandler(e); + } + return captainRootDomainFromUser; + }) + }, + { + type: 'password', + name: 'newPasswordFirstTry', + message: 'Enter a new password:', + filter: (value) => { + newPasswordFirstTry = value; + return value; + } + }, + { + type: 'password', + name: 'newPassword', + message: 'Enter your new password again:', + filter: (value) => __awaiter(this, void 0, void 0, function* () { + const confirmPasswordValueFromUser = value; + if (newPasswordFirstTry !== confirmPasswordValueFromUser) { + StdOutUtil_1.default.printError('Passwords do not match. Try serversetup again.', true); + throw new Error('Password mismatch'); + } + return ''; + }) + }, + { + type: 'input', + name: 'emailAddress', + message: "Enter your 'valid' email address to enable HTTPS: ", + filter: (value) => __awaiter(this, void 0, void 0, function* () { + const emailAddressFromUser = value.trim(); + let forcedSsl = false; + try { + SpinnerHelper_1.default.start('Enabling SSL... Takes a few seconds...'); + yield CliApiManager_1.default.get(captainMachine).enableRootSsl(emailAddressFromUser); + captainMachine = Utils_1.default.copyObject(captainMachine); + captainMachine.baseUrl = captainMachine.baseUrl.replace('http://', 'https://'); + yield CliApiManager_1.default.get(captainMachine).forceSsl(true); + forcedSsl = true; + yield CliApiManager_1.default.get(captainMachine).changePass(lastWorkingPassword, newPasswordFirstTry); + lastWorkingPassword = newPasswordFirstTry; + yield CliApiManager_1.default.get(captainMachine).getAuthToken(lastWorkingPassword); + SpinnerHelper_1.default.stop(); + } + catch (e) { + if (forcedSsl) { + StdOutUtil_1.default.printError('Server is setup, but password was not changed due to an error. You cannot use serversetup again.'); + StdOutUtil_1.default.printError(`Instead, go to ${captainMachine.baseUrl} and change your password on settings page.`); + StdOutUtil_1.default.printError(`Then, Use captainduckduck login on your local machine to connect to your server.`); + } + SpinnerHelper_1.default.fail(); + StdOutUtil_1.default.errorHandler(e); + } + return emailAddressFromUser; + }) + }, + { + type: 'input', + name: 'captainName', + message: 'Enter a name for this Captain machine:', + default: CliHelper_1.default.get().findDefaultCaptainName(), + validate: (value) => { + const newMachineName = value.trim(); + let errorMessage = undefined; + if (StorageHelper_1.default.get().findMachine(newMachineName)) { + return `${newMachineName} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.`; + } + if (CliHelper_1.default.get().isNameValid(newMachineName)) { + captainMachine.name = newMachineName; + return true; + } + return 'Please enter a valid Captain Name. Small letters, numbers, single hyphen.'; + } + } +]; +function serversetup() { + return __awaiter(this, void 0, void 0, function* () { + StdOutUtil_1.default.printMessage('\nSetup your Captain server\n'); + const answersIgnore = yield inquirer.prompt(questions); + StorageHelper_1.default.get().saveMachine(captainMachine); + StdOutUtil_1.default.printMessage(`\n\nCaptain is available at ${captainMachine.baseUrl}`); + StdOutUtil_1.default.printMessage('\nFor more details and docs see http://www.captainduckduck.com\n\n'); + }); +} +exports.default = serversetup; +//# sourceMappingURL=serversetup.js.map \ No newline at end of file diff --git a/app-cli/built/commands/serversetup.js.map b/app-cli/built/commands/serversetup.js.map new file mode 100755 index 0000000..812606b --- /dev/null +++ b/app-cli/built/commands/serversetup.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serversetup.js","sourceRoot":"","sources":["../../src/commands/serversetup.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,qCAAqC;AACrC,kDAA2C;AAC3C,oDAA6C;AAC7C,oEAA0D;AAE1D,wDAAiD;AACjD,0CAAmC;AACnC,kDAA2C;AAC3C,0DAAmD;AACnD,wDAAiD;AACjD,0DAAmD;AAEnD,IAAI,mBAAmB,GAAuB,SAAS,CAAC;AACxD,IAAI,mBAAmB,GAAW,mBAAS,CAAC,gBAAgB,CAAC;AAE7D,IAAI,cAAc,GAAa;IAC9B,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX,IAAI,EAAE,EAAE;CACR,CAAC;AAEF,MAAM,SAAS,GAAG;IACjB;QACC,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EACN,kFAA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AAC,CAAC;QAEjF,oBAAU,CAAC,YAAY,CAAC,oEAAoE,CAAC,CAAC;IAC/F,CAAC;CAAA;AAED,kBAAe,WAAW,CAAC"} \ No newline at end of file diff --git a/app-cli/built/utils/CliHelper.js b/app-cli/built/utils/CliHelper.js index f31c5a8..85ebc9f 100755 --- a/app-cli/built/utils/CliHelper.js +++ b/app-cli/built/utils/CliHelper.js @@ -8,6 +8,13 @@ class CliHelper { CliHelper.instance = new CliHelper(); return CliHelper.instance; } + isNameValid(value) { + value = value || ''; + if (!!value && value.match(/^[-\d\w]+$/i) && value.indexOf('--') < 0) { + return true; + } + return false; + } getAppsAsOptions(apps) { const firstItemInOption = [ { diff --git a/app-cli/built/utils/CliHelper.js.map b/app-cli/built/utils/CliHelper.js.map index b968ed8..213cb20 100755 --- a/app-cli/built/utils/CliHelper.js.map +++ b/app-cli/built/utils/CliHelper.js.map @@ -1 +1 @@ -{"version":3,"file":"CliHelper.js","sourceRoot":"","sources":["../../src/utils/CliHelper.ts"],"names":[],"mappings":";;AAAA,mDAA4C;AAE5C,6CAAsC;AAEtC,MAAqB,SAAS;IAG7B,MAAM,CAAC,GAAG;QACT,IAAI,CAAC,SAAS,CAAC,QAAQ;YAAE,SAAS,CAAC,QAAQ,GAAG,IAAI,SAAS,EAAE,CAAC;QAC9D,OAAO,SAAS,CAAC,QAAQ,CAAC;IAC3B,CAAC;IAED,gBAAgB,CAAC,IAAW;QAC3B,MAAM,iBAAiB,GAAG;YACzB;gBACC,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE,EAAE;gBACT,KAAK,EAAE,EAAE;aACT;SACD,CAAC;QACF,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YACnC,OAAO;gBACN,IAAI,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE;gBACtB,KAAK,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE;gBACvB,KAAK,EAAE,GAAG,GAAG,CAAC,OAAO,EAA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sB;QACrB,IAAI,aAAa,GAAG,uBAAa,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;QACjE,MAAM,IAAI,GAAG,IAAI,CAAC;QAElB,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE;YAC1C,aAAa,EAAE,CAAC;SAChB;QAED,OAAO,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAC/C,CAAC;IAED,kBAAkB,CAAC,MAAc;QAChC,MAAM,YAAY,GAAG,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;QAEzD,OAAO,WAAW,YAAY,EAAE,CAAC;IAClC,CAAC;IAED,aAAa,CAAC,YAAoB;QACjC,MAAM,IAAI,GAAG,IAAI,CAAC;QAClB,IAAI,KAAK,GAAG,IAAI,CAAC;QACjB,uBAAa,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,CAAC,OAAiB,EAAE,EAAE;YAC3D,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,EAAE;gBAC3D,KAAK,GAAG,KAAK,CAAC;aACd;QACF,CAAC,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACd,CAAC;CACD;AAxFD,4BAwFC"} \ No newline at end of file diff --git a/app-cli/built/utils/StdOutUtil.js b/app-cli/built/utils/StdOutUtil.js index a916a22..d66b10f 100755 --- a/app-cli/built/utils/StdOutUtil.js +++ b/app-cli/built/utils/StdOutUtil.js @@ -22,8 +22,11 @@ class StdOutUtils { exit && process.exit(0); } errorHandler(error) { - if (error.status) { - this.printError(`\nError: ${error.status}\nError: ${error.description}`, true); + if (error.captainStatus) { + this.printError(`\nError Code: ${error.captainStatus} Message: ${error.captainMessage}`, true); + } + else if (error.status) { + this.printError(`\nError status: ${error.status} Message: ${error.description || error.message}`, true); } else { this.printError(`\nError: ${error}`, true); diff --git a/app-cli/built/utils/StdOutUtil.js.map b/app-cli/built/utils/StdOutUtil.js.map index bc1f5d2..950bfd2 100755 --- a/app-cli/built/utils/StdOutUtil.js.map +++ b/app-cli/built/utils/StdOutUtil.js.map @@ -1 +1 @@ -{"version":3,"file":"StdOutUtil.js","sourceRoot":"","sources":["../../src/utils/StdOutUtil.ts"],"names":[],"mappings":";;AAAA,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/B,MAAM,WAAW;IAChB,YAAY,CAAC,OAAe;QAC3B,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC;IAED,mBAAmB,CAAC,OAAe;QAClC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAErB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IAED,iBAAiB,CAAC,OAAe,EAAE,IAAI,GAAG,KAAK;QAC9C,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAEvC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IAED,mBAAmB,CAAC,OAAe,EAAE,IAAI,GAAG,KAAK;QAChD,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAEzC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IAED,UAAU,CAAC,KAAa,EAAE,IAAI,GAAG,KAAK;QACrC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAExC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IAED,YAAY,CAAC,KAAU;QACtB,IAAI,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C;QAExC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IAED,YAAY,CAAC,KAAU;QACtB,IAAI,KAAK,CAAC,aAAa,EAAE;YACxB,IAAI,CAAC,UAAU,CAAC,iBAAiB,KAAK,CAAC,aAAa,eAAe,KAAK,CAAC,cAAc,EAAE,EAAE,IAAI,CAAC,CAAC;SACjG;aAAM,IAAI,KAAK,CAAC,MAAM,EAAE;YACxB,IAAI,CAAC,UAAU,CAAC,mBAAmB,KAAK,CAAC,MAAM,eAAe,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC;SAC1G;aAAM;YACN,IAAI,CAAC,UAAU,CAAC,YAAY,KAAK,EAAE,EAAE,IAAI,CAAC,CAAC;SAC3C;IACF,CAAC;CACD;AACD,kBAAe,IAAI,WAAW,EAAE,CAAC"} \ No newline at end of file diff --git a/app-cli/src/api/ApiManager.ts b/app-cli/src/api/ApiManager.ts index 1b07518..6e86ae4 100644 --- a/app-cli/src/api/ApiManager.ts +++ b/app-cli/src/api/ApiManager.ts @@ -102,7 +102,7 @@ export default class ApiManager { uploadAppData(appName: string, file: fs.ReadStream) { const http = this.http; return Promise.resolve() // - .then(http.fetch(http.POST, '/user/appData/' + appName + '?detached=1', { sourceFile: file })); // TODO user/apps/appData + .then(http.fetch(http.POST_DATA, '/user/appData/' + appName + '?detached=1', { sourceFile: file })); // TODO user/apps/appData } uploadCaptainDefinitionContent( diff --git a/app-cli/src/api/HttpClient.ts b/app-cli/src/api/HttpClient.ts index 9b7e716..496fefc 100644 --- a/app-cli/src/api/HttpClient.ts +++ b/app-cli/src/api/HttpClient.ts @@ -9,6 +9,7 @@ var CAPTAIN = 'captain'; export default class HttpClient { public readonly GET = 'GET'; public readonly POST = 'POST'; + public readonly POST_DATA = 'POST_DATA'; public isDestroyed = false; constructor(private baseUrl: string, private authToken: string, private onAuthFailure: () => Promise) { @@ -32,7 +33,7 @@ export default class HttpClient { this.isDestroyed = true; } - fetch(method: 'GET' | 'POST', endpoint: string, variables: any) { + fetch(method: 'GET' | 'POST' | 'POST_DATA', endpoint: string, variables: any) { const self = this; return function(): Promise { return Promise.resolve() // @@ -82,8 +83,8 @@ export default class HttpClient { }); }) .catch(function(error) { - Logger.log(''); - Logger.error(error.message || error); + // Logger.log(''); + // Logger.error(error.message || error); return new Promise(function(resolve, reject) { if (!self.isDestroyed) return reject(error); Logger.dev('Destroyed catch not called'); @@ -92,10 +93,10 @@ export default class HttpClient { }; } - fetchInternal(method: 'GET' | 'POST', endpoint: string, variables: any) { + fetchInternal(method: 'GET' | 'POST' | 'POST_DATA', endpoint: string, variables: any) { if (method === this.GET) return this.getReq(endpoint, variables); - if (method === this.POST) return this.postReq(endpoint, variables); + if (method === this.POST || method === this.POST_DATA) return this.postReq(endpoint, variables, method); throw new Error('Unknown method: ' + method); } @@ -111,12 +112,20 @@ export default class HttpClient { }); } - postReq(endpoint: string, variables: any) { + postReq(endpoint: string, variables: any, method: 'GET' | 'POST' | 'POST_DATA') { const self = this; + if (method === this.POST_DATA) + return Request.post(this.baseUrl + endpoint, { + headers: self.createHeaders(), + formData: variables + }).then(function(data) { + return data; + }); + return Request.post(this.baseUrl + endpoint, { headers: self.createHeaders(), - formData: variables + form: variables }).then(function(data) { return data; }); diff --git a/app-cli/src/commands/captainduckduck.ts b/app-cli/src/commands/captainduckduck.ts index 7099cd8..a7068b3 100755 --- a/app-cli/src/commands/captainduckduck.ts +++ b/app-cli/src/commands/captainduckduck.ts @@ -12,7 +12,7 @@ import login from './login'; import list from './list'; import logout from './logout'; import deploy from './deploy'; -// import serversetup = require('./serversetup'); +import serversetup from './serversetup'; // Setup program.version(packagejson.version).description(packagejson.description); @@ -34,12 +34,12 @@ program.command('logout').description('Logout from a specific Captain machine.') logout(); }); -// program -// .command('serversetup') -// .description('Performs necessary actions and prepares your Captain server.') -// .action(() => { -// serversetup(); -// }); +program + .command('serversetup') + .description('Performs necessary actions and prepares your Captain server.') + .action(() => { + serversetup(); + }); program .command('deploy') diff --git a/app-cli/src/commands/login.ts b/app-cli/src/commands/login.ts index a6dc5c6..cdc6b61 100644 --- a/app-cli/src/commands/login.ts +++ b/app-cli/src/commands/login.ts @@ -12,7 +12,6 @@ import CliApiManager from '../api/CliApiManager'; const SAMPLE_DOMAIN = Constants.SAMPLE_DOMAIN; const cleanUpUrl = Utils.cleanUpUrl; - async function login() { StdOutUtil.printMessage('Login to a Captain Machine'); @@ -29,12 +28,17 @@ async function login() { if (!cleanUpUrl(value)) return 'This is an invalid URL: ' + value; + let found = undefined; StorageHelper.get().getMachines().map((machine) => { if (cleanUpUrl(machine.baseUrl) === cleanUpUrl(value)) { - return `${value} already exist as ${machine.name}. If you want to replace the existing entry, you have to first use command, and then re-login.`; + found = machine.name; } }); + if (found) { + return `${value} already exist as ${found} in your currently logged in machines. If you want to replace the existing entry, you have to first use command, and then re-login.`; + } + if (value && value.trim()) { return true; } @@ -66,13 +70,13 @@ async function login() { message: 'Enter a name for this Captain machine:', default: CliHelper.get().findDefaultCaptainName(), validate: (value: string) => { - StorageHelper.get().getMachines().map((machine) => { - if (machine.name === value) { - return `${value} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.`; - } - }); + value = value.trim(); - if (value.match(/^[-\d\w]+$/i)) { + if (StorageHelper.get().findMachine(value)) { + return `${value} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.`; + } + + if (CliHelper.get().isNameValid(value)) { return true; } diff --git a/app-cli/src/commands/serversetup.ts b/app-cli/src/commands/serversetup.ts new file mode 100644 index 0000000..f419e56 --- /dev/null +++ b/app-cli/src/commands/serversetup.ts @@ -0,0 +1,202 @@ +#!/usr/bin/env node + +import * as inquirer from 'inquirer'; +import Constants from '../utils/Constants'; +import StdOutUtil from '../utils/StdOutUtil'; +import { isIpAddress } from '../utils/ValidationsHandler'; +import { IMachine } from '../models/storage/StoredObjects'; +import CliApiManager from '../api/CliApiManager'; +import Utils from '../utils/Utils'; +import CliHelper from '../utils/CliHelper'; +import StorageHelper from '../utils/StorageHelper'; +import ErrorFactory from '../utils/ErrorFactory'; +import SpinnerHelper from '../utils/SpinnerHelper'; + +let newPasswordFirstTry: string | undefined = undefined; +let lastWorkingPassword: string = Constants.DEFAULT_PASSWORD; + +let captainMachine: IMachine = { + authToken: '', + baseUrl: '', + name: '' +}; + +const questions = [ + { + type: 'list', + name: 'hasInstalledCaptain', + message: + 'Have you already installed Captain on your server by running the following line:' + + '\nmkdir /captain && docker run -p 80:80 -p 443:443 -p 3000:3000 -v /var/run/docker.sock:/var/run/docker.sock dockersaturn/captainduckduck ?', + default: 'Yes', + choices: [ 'Yes', 'No' ], + filter: (value: string) => { + const answerFromUser = value.trim(); + + if (answerFromUser === 'Yes') return answerFromUser; + + StdOutUtil.printMessage('\n\nCannot start the setup process if Captain is not installed.'); + + StdOutUtil.printMessageAndExit( + 'Please read tutorial on CaptainDuckDuck.com to learn how to install CaptainDuckDuck on a server.' + ); + } + }, + { + type: 'input', + default: Constants.SAMPLE_IP, + name: 'captainAddress', + message: 'Enter IP address of your captain server:', + filter: async (value: string) => { + const ipFromUser = value.trim(); + + if (ipFromUser === Constants.SAMPLE_IP || !isIpAddress(ipFromUser)) { + StdOutUtil.printError(`\nThis is an invalid IP Address: ${ipFromUser}`, true); + } + + try { + // login using captain42. and set the ipAddressToServer + captainMachine.baseUrl = `http://${ipFromUser}:3000`; + await CliApiManager.get(captainMachine).getAuthToken(lastWorkingPassword); + } catch (e) { + // User may have used a different default password + if (e.captainStatus === ErrorFactory.STATUS_WRONG_PASSWORD) return ''; + StdOutUtil.errorHandler(e); + } + + return ipFromUser; + } + }, + { + type: 'password', + name: 'captainOriginalPassword', + message: 'Enter your current password:', + when: () => !captainMachine.authToken, // The default password didn't work + filter: async (value: string) => { + try { + await CliApiManager.get(captainMachine).getAuthToken(value); + lastWorkingPassword = value; + return ''; + } catch (e) { + StdOutUtil.errorHandler(e); + } + } + }, + { + type: 'input', + name: 'captainRootDomain', + message: + 'Enter a root domain for this Captain server. For example, enter test.yourdomain.com if you' + + ' setup your DNS to point *.test.yourdomain.com to ip address of your server' + + ': ', + filter: async (value: string) => { + const captainRootDomainFromUser = value.trim(); + try { + await CliApiManager.get(captainMachine).updateRootDomain(captainRootDomainFromUser); + captainMachine = Utils.copyObject(captainMachine); + captainMachine.baseUrl = `http://captain.${captainRootDomainFromUser}`; + } catch (e) { + StdOutUtil.errorHandler(e); + } + + return captainRootDomainFromUser; + } + }, + { + type: 'password', + name: 'newPasswordFirstTry', + message: 'Enter a new password:', + filter: (value: string) => { + newPasswordFirstTry = value; + return value; + } + }, + { + type: 'password', + name: 'newPassword', + message: 'Enter your new password again:', + filter: async (value: string) => { + const confirmPasswordValueFromUser = value; + + if (newPasswordFirstTry !== confirmPasswordValueFromUser) { + StdOutUtil.printError('Passwords do not match. Try serversetup again.', true); + throw new Error('Password mismatch'); + } + return ''; + } + }, + { + type: 'input', + name: 'emailAddress', + message: "Enter your 'valid' email address to enable HTTPS: ", + filter: async (value: string) => { + const emailAddressFromUser = value.trim(); + let forcedSsl = false; + try { + SpinnerHelper.start('Enabling SSL... Takes a few seconds...'); + await CliApiManager.get(captainMachine).enableRootSsl(emailAddressFromUser); + + captainMachine = Utils.copyObject(captainMachine); + captainMachine.baseUrl = captainMachine.baseUrl.replace('http://', 'https://'); + + await CliApiManager.get(captainMachine).forceSsl(true); + forcedSsl = true; + await CliApiManager.get(captainMachine).changePass(lastWorkingPassword, newPasswordFirstTry!); + lastWorkingPassword = newPasswordFirstTry!; + await CliApiManager.get(captainMachine).getAuthToken(lastWorkingPassword); + SpinnerHelper.stop(); + } catch (e) { + if (forcedSsl) { + StdOutUtil.printError( + 'Server is setup, but password was not changed due to an error. You cannot use serversetup again.' + ); + StdOutUtil.printError( + `Instead, go to ${captainMachine.baseUrl} and change your password on settings page.` + ); + StdOutUtil.printError( + `Then, Use captainduckduck login on your local machine to connect to your server.` + ); + } + SpinnerHelper.fail(); + StdOutUtil.errorHandler(e); + } + + return emailAddressFromUser; + } + }, + { + type: 'input', + name: 'captainName', + message: 'Enter a name for this Captain machine:', + default: CliHelper.get().findDefaultCaptainName(), + validate: (value: string) => { + const newMachineName = value.trim(); + + let errorMessage = undefined; + if (StorageHelper.get().findMachine(newMachineName)) { + return `${newMachineName} already exist. If you want to replace the existing entry, you have to first use command, and then re-login.`; + } + + if (CliHelper.get().isNameValid(newMachineName)) { + captainMachine.name = newMachineName; + return true; + } + + return 'Please enter a valid Captain Name. Small letters, numbers, single hyphen.'; + } + } +]; + +async function serversetup() { + StdOutUtil.printMessage('\nSetup your Captain server\n'); + + const answersIgnore = await inquirer.prompt(questions); + + StorageHelper.get().saveMachine(captainMachine); + + StdOutUtil.printMessage(`\n\nCaptain is available at ${captainMachine.baseUrl}`); + + StdOutUtil.printMessage('\nFor more details and docs see http://www.captainduckduck.com\n\n'); +} + +export default serversetup; diff --git a/app-cli/src/utils/CliHelper.ts b/app-cli/src/utils/CliHelper.ts index ad1a868..191633a 100644 --- a/app-cli/src/utils/CliHelper.ts +++ b/app-cli/src/utils/CliHelper.ts @@ -10,6 +10,14 @@ export default class CliHelper { return CliHelper.instance; } + isNameValid(value: string) { + value = value || ''; + if (!!value && value.match(/^[-\d\w]+$/i) && value.indexOf('--') < 0) { + return true; + } + return false; + } + getAppsAsOptions(apps: any[]) { const firstItemInOption = [ { diff --git a/app-cli/src/utils/StdOutUtil.ts b/app-cli/src/utils/StdOutUtil.ts index b798cf3..0d97ed9 100644 --- a/app-cli/src/utils/StdOutUtil.ts +++ b/app-cli/src/utils/StdOutUtil.ts @@ -29,8 +29,10 @@ class StdOutUtils { } errorHandler(error: any) { - if (error.status) { - this.printError(`\nError: ${error.status}\nError: ${error.description}`, true); + if (error.captainStatus) { + this.printError(`\nError Code: ${error.captainStatus} Message: ${error.captainMessage}`, true); + } else if (error.status) { + this.printError(`\nError status: ${error.status} Message: ${error.description || error.message}`, true); } else { this.printError(`\nError: ${error}`, true); } From 5d6e6c3e9b7f01f6ad5dc817e6f9a14912047483 Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Sun, 6 Jan 2019 16:16:54 -0800 Subject: [PATCH 40/44] final CLI testing --- app-cli/built/commands/captainduckduck.js | 16 ++++----- app-cli/built/commands/captainduckduck.js.map | 2 +- app-cli/built/commands/deploy.js | 10 ++++-- app-cli/built/commands/deploy.js.map | 2 +- app-cli/built/utils/DeployHelper.js | 12 +++++-- app-cli/built/utils/DeployHelper.js.map | 2 +- app-cli/built/utils/StorageHelper.js | 29 ++++++++++++++-- app-cli/built/utils/StorageHelper.js.map | 2 +- app-cli/src/commands/captainduckduck.ts | 16 ++++----- app-cli/src/commands/deploy.ts | 13 +++++-- app-cli/src/utils/DeployHelper.ts | 14 ++++++-- app-cli/src/utils/StorageHelper.ts | 34 +++++++++++++++++-- 12 files changed, 118 insertions(+), 34 deletions(-) diff --git a/app-cli/built/commands/captainduckduck.js b/app-cli/built/commands/captainduckduck.js index 6c979f0..c6f8966 100755 --- a/app-cli/built/commands/captainduckduck.js +++ b/app-cli/built/commands/captainduckduck.js @@ -35,14 +35,14 @@ program }); program .command('deploy') - .description("Deploy your app (current directory) to a specific Captain machine. You'll be prompted to choose your Captain machine.") - .option('-t, --tarFile ', 'Specify file to be uploaded (rather than using git archive)') - .option('-d, --default', 'Run with default options') - .option('-s, --stateless', 'Run deploy stateless') - .option('-h, --host ', 'Only for stateless mode: Host of the captain machine') - .option('-a, --appName ', 'Only for stateless mode: Name of the app') - .option('-p, --pass ', 'Only for stateless mode: Password for Captain') - .option('-b, --branch ', 'Only for stateless mode: Branch name (default master)') + .description("Deploy your app (current directory) to a specific Captain machine. You'll be prompted to choose your Captain machine.\n\n" + + 'For use in scripts, i.e. non-interactive mode, you can use --host --pass --appName and -- branch flags.') + .option('-d, --default', 'Use previously entered values for the current directory, avoid asking.') + .option('-t, --tarFile ', 'Specify the tar file to be uploaded (rather than using git archive)') + .option('-h, --host ', 'Specify th URL of the captain machine in command line') + .option('-a, --appName ', 'Specify Name of the app to be deployed in command line') + .option('-p, --pass ', 'Specify password for Captain in command line') + .option('-b, --branch ', 'Specify branch name (default master)') .action((options) => { deploy_1.default(options); }); diff --git a/app-cli/built/commands/captainduckduck.js.map b/app-cli/built/commands/captainduckduck.js.map index 92d6b76..f9d60bd 100755 --- a/app-cli/built/commands/captainduckduck.js.map +++ b/app-cli/built/commands/captainduckduck.js.map @@ -1 +1 @@ -{"version":3,"file":"captainduckduck.js","sourceRoot":"","sources":["../../src/commands/captainduckduck.ts"],"names":[],"mappings":";;;AAEA,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAClD,kDAAkD;AAClD,cAAc,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;AAEhE,oDAA6C;AAC7C,qCAAqC;AAErC,kBAAkB;AAClB,mCAA4B;AAC5B,iCAA0B;AAC1B,qCAA8B;AAC9B,qCAA8B;AAC9B,+CAAwC;AAExC,QAAQ;AACR,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;AAE1E,WAAW;AAEX,OAAO;KACL,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,+FAA+F,CAAC;KAC5G,MAAM,CAAC,GAAG,EAAE;IACZ,eAAK,EAAE,CAAC;AACT,CAAC,CAAC,CAAC;AAEJ,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,gDAAgD,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE;IAC7G,cAAI,EAAE,CAAC;AACR,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,yCAAyC,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE;IAC5F,gBAAM,EAAE,CAAC;AACV,CAAC,CAAC,CAAC;AAEH,OAAO;KACL,OAAO,CAAC,aAAa,CAAC;KACtB,WAAW,CAAC,8DAA8D,CAAC;KAC3E,MAAM,CAAC,GAAG,EAAE;IACZ,qBAAW,EAAE,CAAC;AACf,CAAC,CAAC,CAAC;AAEJ,OAAO;KACL,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CACX,uHAAuH,CACvH;KACA,MAAM,CAAC,uBAAuB,EAAE,6DAA6D,CAAC;KAC9F,MAAM,CAAC,eAAe,EAAE,0BAA0B,CAAC;KACnD,MAAM,CAAC,iBAAiB,EAAE,sBAAsB,CAAC;KACjD,MAAM,CAAC,oBAAoB,EAAE,sDAAsD,CAAC;KACpF,MAAM,CAAC,uBAAuB,EAAE,0CAA0C,CAAC;KAC3E,MAAM,CAAC,oBAAoB,EAAE,+CAA+C,CAAC;KAC7E,MAAM,CAAC,sBAAsB,EAAE,uDAAuD,CAAC;KACvF,MAAM,CAAC,CAAC,OAAY,EAAE,EAAE;IACxB,gBAAM,CAAC,OAAO,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC;AAEJ,4BAA4B;AAC5B,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;IAC5B,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE7C,oBAAU,CAAC,UAAU,CAAC,sBAAsB,aAAa,gDAAgD,EAAE,IAAI,CAAC,CAAC;AAClH,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"captainduckduck.js","sourceRoot":"","sources":["../../src/commands/captainduckduck.ts"],"names":[],"mappings":";;;AAEA,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAClD,kDAAkD;AAClD,cAAc,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,CAA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;KACzF,MAAM,CAAC,oBAAoB,EAAE,8CAA8C,CAAC;KAC5E,MAAM,CAAC,sBAAsB,EAAE,sCAAsC,CAAC;KACtE,MAAM,CAAC,CAAC,OAAY,EAAE,EAAE;IACxB,gBAAM,CAAC,OAAO,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC;AAEJ,4BAA4B;AAC5B,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;IAC5B,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE7C,oBAAU,CAAC,UAAU,CAAC,sBAAsB,aAAa,gDAAgD,EAAE,IAAI,CAAC,CAAC;AAClH,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/app-cli/built/commands/deploy.js b/app-cli/built/commands/deploy.js index e364537..ee57bee 100755 --- a/app-cli/built/commands/deploy.js +++ b/app-cli/built/commands/deploy.js @@ -30,6 +30,9 @@ function deploy(options) { appName: possibleApp ? possibleApp.appName : undefined }; } + else if (possibleApp) { + StdOutUtil_1.default.printMessage(`\n\n**********\n\nProtip: You seem to have deployed ${possibleApp.appName} from this directory in the past, use --default flag to avoid having to re-enter the information.\n\n**********\n\n`); + } if (options.appName) { deployParams.appName = options.appName; } @@ -63,7 +66,10 @@ function deploy(options) { if (deployParams.captainMachine) { allApps = yield ValidationsHandler_1.ensureAuthentication(deployParams.captainMachine); } - { + const allParametersAreSupplied = !!deployParams.appName && + !!deployParams.captainMachine && + (!!deployParams.deploySource.branchToPush || !!deployParams.deploySource.tarFilePath); + if (!allParametersAreSupplied) { const questions = [ { type: 'list', @@ -112,7 +118,7 @@ function deploy(options) { { type: 'confirm', name: 'confirmedToDeploy', - message: 'Note that uncommitted files and files in gitignore (if any) will not be pushed to server. Please confirm so that deployment process can start.', + message: 'Note that uncommitted files and files in gitignore (if any) will not be pushed to server. \n Please confirm so that deployment process can start.', default: true, when: (answers) => !!deployParams.appName && !!deployParams.captainMachine && diff --git a/app-cli/built/commands/deploy.js.map b/app-cli/built/commands/deploy.js.map index 653f173..e5ae0e2 100755 --- a/app-cli/built/commands/deploy.js.map +++ b/app-cli/built/commands/deploy.js.map @@ -1 +1 @@ -{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,qCAAqC;AACrC,oDAA6C;AAC7C,oEAAoH;AAEpH,0DAAmD;AACnD,kDAA2C;AAE3C,wDAAiD;AACjD,wDAAiD;AAEjD,SAAe,MAAM,CAAC,OAAY;;QACjC,MAAM,WAAW,GAAG,uBAAa,CAAC,GAAG,EAAE;aACrC,sBAAsB,EAAE;aACxB,IAAI,CAAC,CAAC,GAAuB,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAE/D,oBAAU,CAAC,YAAY,CAAC,sCAAsC,CAAC,CAAC;QAEhE,IAAI,YAAY,GAAkB,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;QAEvD,IAAI,OAAO,CAAC,OAAO,EAAE;YACpB,YAAY,GAAG;gBACd,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC,uBAAa,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,SAAS;gBAC1G,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE;gBACzD,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;aACtD,CAAC;SACF;QAED,IAAI,OAAO,CAAC,OAAO,EAAE;YACpB,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;SACvC;QAED,IAAI,OAAO,CAAC,MAAM,EAAE;YACnB,YAAY,CAAC,YAAY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O,GAAG,cAAc,CAAC;wBACtC,OAAO,cAAc,CAAC;oBACvB,CAAC,CAAA;oBACD,IAAI,EAAE,CAAC,OAAgC,EAAE,EAAE,CAC1C,CAAC,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,YAAY,IAAI,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,WAAW,CAAC;wBACrF,CAAC,YAAY,CAAC,OAAO;iBACtB;gBACD;oBACC,IAAI,EAAE,SAAS;oBACf,IAAI,EAAE,mBAAmB;oBACzB,OAAO,EACN,gJAAgJ;oBACjJ,OAAO,EAAE,IAAI;oBACb,IAAI,EAAE,CAAC,OAAgC,EAAE,EAAE,CAC1C,CAAC,CAAC,YAAY,CAAC,OAAO;wBACtB,CAAC,CAAC,YAAY,CAAC,cAAc;wBAC7B,CAAC,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,YAAY,IAAI,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,WAAW,CAAC;iBACtF;aACD,CAAC;YACF,MAAM,eAAe,GAAG,CAAC,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAA4B,CAAC;YAEtF,IAAI,CAAC,eAAe,CAAC,iBAAiB,EAAE;gBACvC,oBAAU,CAAC,YAAY,CAAC,wCAAwC,CAAC,CAAC;gBAClE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAChB,OAAO;aACP;SACD;QAED,IAAI;YACH,MAAM,IAAI,sBAAY,CAAC,YAAY,CAAC,CAAC,EAAE;iBACrC,WAAW,EAAE,CAAC;SAChB;QAAC,OAAO,CAAC,EAAE;YACX,oBAAU,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;SACvC;IACF,CAAC;CAAA;AAED,kBAAe,MAAM,CAAC"} \ No newline at end of file +{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,qCAAqC;AACrC,oDAA6C;AA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..a9d70a2 100755 --- a/app-cli/built/utils/DeployHelper.js +++ b/app-cli/built/utils/DeployHelper.js @@ -17,6 +17,7 @@ const ProgressBar = require('progress'); const commandExistsSync = require('command-exists').sync; const CliApiManager_1 = require("../api/CliApiManager"); const SpinnerHelper_1 = require("../utils/SpinnerHelper"); +const StorageHelper_1 = require("./StorageHelper"); class DeployHelper { constructor(deployParams) { this.deployParams = deployParams; @@ -79,6 +80,7 @@ class DeployHelper { const branchToPush = this.deployParams.deploySource.branchToPush; const tarFilePath = this.deployParams.deploySource.tarFilePath; const machineToDeploy = this.deployParams.captainMachine; + const deploySource = this.deployParams.deploySource; if (!appName || (!branchToPush && !tarFilePath) || !machineToDeploy) { StdOutUtil_1.default.printError('Default deploy failed. Missing appName or branchToPush/tarFilePath or machineToDeploy.', true); return; @@ -103,6 +105,12 @@ class DeployHelper { StdOutUtil_1.default.printMessage(`Uploading the file to ${machineToDeploy.baseUrl}`); yield CliApiManager_1.default.get(machineToDeploy).uploadAppData(appName, this.getFileStream(tarFileFullPath)); StdOutUtil_1.default.printMessage(`Upload done.`); + StorageHelper_1.default.get().saveDeployedDirectory({ + appName: appName, + cwd: process.cwd(), + deploySource: deploySource, + machineNameToDeploy: machineToDeploy.name + }); if (tarFileCreatedByCli && fs.pathExistsSync(tarFileFullPath)) fs.removeSync(tarFileFullPath); this.startFetchingBuildLogs(machineToDeploy, appName); @@ -143,11 +151,11 @@ class DeployHelper { const appUrl = self.deployParams.captainMachine.baseUrl .replace('https://', 'http://') .replace('//captain.', '//' + appName + '.'); - StdOutUtil_1.default.printGreenMessage(`Deployed successfully: ${appName}`); + StdOutUtil_1.default.printGreenMessage(`\n\n\nDeployed successfully: ${appName}`); StdOutUtil_1.default.printMagentaMessage(`App is available at ${appUrl}`, true); } else { - StdOutUtil_1.default.printError(`\nSomething bad happened. Cannot deploy "${appName}"\n`, true); + StdOutUtil_1.default.printError(`\n\nSomething bad happened. Cannot deploy "${appName}"\n`, true); } } else { diff --git a/app-cli/built/utils/DeployHelper.js.map b/app-cli/built/utils/DeployHelper.js.map index c368780..b3d03a8 100755 --- a/app-cli/built/utils/DeployHelper.js.map +++ b/app-cli/built/utils/DeployHelper.js.map @@ -1 +1 @@ -{"version":3,"file":"DeployHelper.js","sourceRoot":"","sources":["../../src/utils/DeployHelper.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,+BAA+B;AAC/B,6BAA6B;AAC7B,iDAAqC;AACrC,oDAA6C;AAC7C,MAAM,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACxC,MAAM,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC;AAEzD,wDAAiD;AACjD,0DAAmD;AAGnD,MAAqB,YAAY;IAGhC,YAAoB,YAA2B;QAA3B,iBAAY,GAAZ,YAAY,CAAe;QAFvC,0BAAqB,GAAG,CAAC,KAAK,CAAC,CAAC,2CAA2C;QAGlF,EAAE;IACH,CAAC;IAEO,cAAc,CAAC,eAAuB,EAAE,YAAoB;QACnE,MAAM,IAAI,GAAG,IAAI,CAAC;QAClB,OAAO,IAAI,OAAO,CAAS,UAAS,OAAO,EAAE,MAAM;YAClD,qCAAqC;YACrC,IAAI,EAAE,CAAC,cAAc,CAAC,eAAe,CAAC;gBAAE,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;YAEvE,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE;gBAC9B,oBAAU,CAAC,UAAU,CACpB,4FAA4F,EAC5F,IAAI,CACJ,CAAC;gBACF,MAAM,CAAC,gEAAgE,CAAC,CAAC;gBACzE,OAAO;aACP;YAED,oBAAI,CAAC,sCAAsC,eAAe,KAAK,YAAY,EAAE,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;gBACtG,IAAI,GAAG,EAAE;oBACR,oBAAU,CAAC,UAAU,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;oBAEnD,EAAE,CAAC,UAAU,CA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ils/StorageHelper.js b/app-cli/built/utils/StorageHelper.js index 64e3a47..9670285 100755 --- a/app-cli/built/utils/StorageHelper.js +++ b/app-cli/built/utils/StorageHelper.js @@ -11,8 +11,33 @@ class StorageHelper { return StorageHelper.instance; } constructor() { - this.data = new ConfigStore('new-captainduckduck'); - // migrate data! TODO + this.data = new ConfigStore('captainduckduck'); + this.migrateData(); + } + migrateData() { + const self = this; + const data = this.data; + const oldMachines = data.get('captainMachines') || []; + const oldApps = data.get('apps') || []; + oldMachines.forEach((m) => { + self.saveMachine({ + authToken: m.authToken, + baseUrl: m.baseUrl, + name: m.name + }); + }); + oldApps.forEach((app) => { + self.saveDeployedDirectory({ + appName: app.appName, + cwd: app.cwd, + machineNameToDeploy: app.machineToDeploy.name, + deploySource: { + branchToPush: app.branchToPush + } + }); + }); + data.delete('captainMachines'); + data.delete('apps'); } getMachines() { return Utils_1.default.copyObject(this.data.get(CAP_MACHINES) || []); diff --git a/app-cli/built/utils/StorageHelper.js.map b/app-cli/built/utils/StorageHelper.js.map index 69096c2..e6de24b 100755 --- a/app-cli/built/utils/StorageHelper.js.map +++ b/app-cli/built/utils/StorageHelper.js.map @@ -1 +1 @@ -{"version":3,"file":"StorageHelper.js","sourceRoot":"","sources":["../../src/utils/StorageHelper.ts"],"names":[],"mappings":";;AACA,2CAA2C;AAC3C,mCAA4B;AAE5B,MAAM,YAAY,GAAG,aAAa,CAAC;AACnC,MAAM,aAAa,GAAG,cAAc,CAAC;AAErC,MAAqB,aAAa;IAGjC,MAAM,CAAC,GAAG;QACT,IAAI,CAAC,aAAa,CAAC,QAAQ;YAAE,aAAa,CAAC,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;QAC1E,OAAO,aAAa,CAAC,QAAQ,CAAC;IAC/B,CAAC;IAID;QACC,IAAI,CAAC,IAAI,GAAG,IAAI,WAAW,CAAC,qBAAqB,CAAC,CAAC;QACnD,qBAAqB;IACtB,CAAC;IAED,WAAW;QACV,OAAO,eAAK,CAAC,UAA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,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED,qBAAqB,CAAC,uBAA2C;QAChE,MAAM,QAAQ,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC/C,IAAI,UAAU,GAAG,KAAK,CAAC;QACvB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YACrD,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;YAChC,IAAI,OAAO,CAAC,GAAG,KAAK,uBAAuB,CAAC,GAAG,EAAE;gBAChD,UAAU,GAAG,IAAI,CAAC;gBAClB,QAAQ,CAAC,KAAK,CAAC,GAAG,uBAAuB,CAAC;gBAC1C,MAAM;aACN;SACD;QAED,IAAI,CAAC,UAAU,EAAE;YAChB,QAAQ,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;SACvC;QAED,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC;CACD;AArGD,gCAqGC"} \ No newline at end of file diff --git a/app-cli/src/commands/captainduckduck.ts b/app-cli/src/commands/captainduckduck.ts index a7068b3..23ae401 100755 --- a/app-cli/src/commands/captainduckduck.ts +++ b/app-cli/src/commands/captainduckduck.ts @@ -44,15 +44,15 @@ program program .command('deploy') .description( - "Deploy your app (current directory) to a specific Captain machine. You'll be prompted to choose your Captain machine." + "Deploy your app (current directory) to a specific Captain machine. You'll be prompted to choose your Captain machine.\n\n" + + 'For use in scripts, i.e. non-interactive mode, you can use --host --pass --appName and -- branch flags.' ) - .option('-t, --tarFile ', 'Specify file to be uploaded (rather than using git archive)') - .option('-d, --default', 'Run with default options') - .option('-s, --stateless', 'Run deploy stateless') - .option('-h, --host ', 'Only for stateless mode: Host of the captain machine') - .option('-a, --appName ', 'Only for stateless mode: Name of the app') - .option('-p, --pass ', 'Only for stateless mode: Password for Captain') - .option('-b, --branch ', 'Only for stateless mode: Branch name (default master)') + .option('-d, --default', 'Use previously entered values for the current directory, avoid asking.') + .option('-t, --tarFile ', 'Specify the tar file to be uploaded (rather than using git archive)') + .option('-h, --host ', 'Specify th URL of the captain machine in command line') + .option('-a, --appName ', 'Specify Name of the app to be deployed in command line') + .option('-p, --pass ', 'Specify password for Captain in command line') + .option('-b, --branch ', 'Specify branch name (default master)') .action((options: any) => { deploy(options); }); diff --git a/app-cli/src/commands/deploy.ts b/app-cli/src/commands/deploy.ts index 5b16719..e542705 100644 --- a/app-cli/src/commands/deploy.ts +++ b/app-cli/src/commands/deploy.ts @@ -25,6 +25,10 @@ async function deploy(options: any) { deploySource: possibleApp ? possibleApp.deploySource : {}, appName: possibleApp ? possibleApp.appName : undefined }; + } else if (possibleApp) { + StdOutUtil.printMessage( + `\n\n**********\n\nProtip: You seem to have deployed ${possibleApp.appName} from this directory in the past, use --default flag to avoid having to re-enter the information.\n\n**********\n\n` + ); } if (options.appName) { @@ -65,7 +69,12 @@ async function deploy(options: any) { allApps = await ensureAuthentication(deployParams.captainMachine); } - { + const allParametersAreSupplied = + !!deployParams.appName && + !!deployParams.captainMachine && + (!!deployParams.deploySource.branchToPush || !!deployParams.deploySource.tarFilePath); + + if (!allParametersAreSupplied) { const questions = [ { type: 'list', @@ -117,7 +126,7 @@ async function deploy(options: any) { type: 'confirm', name: 'confirmedToDeploy', message: - 'Note that uncommitted files and files in gitignore (if any) will not be pushed to server. Please confirm so that deployment process can start.', + 'Note that uncommitted files and files in gitignore (if any) will not be pushed to server. \n Please confirm so that deployment process can start.', default: true, when: (answers: IHashMapGeneric) => !!deployParams.appName && diff --git a/app-cli/src/utils/DeployHelper.ts b/app-cli/src/utils/DeployHelper.ts index c07d4ff..e27ad43 100644 --- a/app-cli/src/utils/DeployHelper.ts +++ b/app-cli/src/utils/DeployHelper.ts @@ -10,6 +10,7 @@ import { IMachine, IDeployParams } from '../models/storage/StoredObjects'; import CliApiManager from '../api/CliApiManager'; import SpinnerHelper from '../utils/SpinnerHelper'; import IBuildLogs from '../models/IBuildLogs'; +import StorageHelper from './StorageHelper'; export default class DeployHelper { private lastLineNumberPrinted = -10000; // we want to show all lines to begin with! @@ -92,6 +93,7 @@ export default class DeployHelper { const branchToPush = this.deployParams.deploySource.branchToPush; const tarFilePath = this.deployParams.deploySource.tarFilePath; const machineToDeploy = this.deployParams.captainMachine; + const deploySource = this.deployParams.deploySource; if (!appName || (!branchToPush && !tarFilePath) || !machineToDeploy) { StdOutUtil.printError( @@ -132,6 +134,13 @@ export default class DeployHelper { StdOutUtil.printMessage(`Upload done.`); + StorageHelper.get().saveDeployedDirectory({ + appName: appName, + cwd: process.cwd(), + deploySource: deploySource, + machineNameToDeploy: machineToDeploy.name + }); + if (tarFileCreatedByCli && fs.pathExistsSync(tarFileFullPath)) fs.removeSync(tarFileFullPath); this.startFetchingBuildLogs(machineToDeploy, appName); @@ -172,11 +181,10 @@ export default class DeployHelper { const appUrl = self.deployParams.captainMachine!.baseUrl .replace('https://', 'http://') .replace('//captain.', '//' + appName + '.'); - StdOutUtil.printGreenMessage(`Deployed successfully: ${appName}`); - + StdOutUtil.printGreenMessage(`\n\n\nDeployed successfully: ${appName}`); StdOutUtil.printMagentaMessage(`App is available at ${appUrl}`, true); } else { - StdOutUtil.printError(`\nSomething bad happened. Cannot deploy "${appName}"\n`, true); + StdOutUtil.printError(`\n\nSomething bad happened. Cannot deploy "${appName}"\n`, true); } } else { setTimeout(() => { diff --git a/app-cli/src/utils/StorageHelper.ts b/app-cli/src/utils/StorageHelper.ts index 8cbae2b..646e232 100644 --- a/app-cli/src/utils/StorageHelper.ts +++ b/app-cli/src/utils/StorageHelper.ts @@ -1,4 +1,4 @@ -import { IMachine, IDeployedDirectory } from '../models/storage/StoredObjects'; +import { IMachine, IDeployedDirectory, IOldSavedApp } from '../models/storage/StoredObjects'; import * as ConfigStore from 'configstore'; import Utils from './Utils'; @@ -16,8 +16,36 @@ export default class StorageHelper { private data: ConfigStore; constructor() { - this.data = new ConfigStore('new-captainduckduck'); - // migrate data! TODO + this.data = new ConfigStore('captainduckduck'); + this.migrateData(); + } + + migrateData() { + const self = this; + const data = this.data; + const oldMachines: any[] = data.get('captainMachines') || []; + const oldApps: IOldSavedApp[] = data.get('apps') || []; + oldMachines.forEach((m) => { + self.saveMachine({ + authToken: m.authToken, + baseUrl: m.baseUrl, + name: m.name + }); + }); + + oldApps.forEach((app) => { + self.saveDeployedDirectory({ + appName: app.appName, + cwd: app.cwd, + machineNameToDeploy: app.machineToDeploy.name, + deploySource: { + branchToPush: app.branchToPush + } + }); + }); + + data.delete('captainMachines'); + data.delete('apps'); } getMachines(): IMachine[] { From 58273efcb295aafc74d8564881dbe6fa391dde4e Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Sun, 6 Jan 2019 16:40:47 -0800 Subject: [PATCH 41/44] better error management --- app-cli/built/commands/serversetup.js | 23 +++++++++++++-- app-cli/built/commands/serversetup.js.map | 2 +- app-cli/src/commands/serversetup.ts | 34 +++++++++++++++++++++-- 3 files changed, 52 insertions(+), 7 deletions(-) diff --git a/app-cli/built/commands/serversetup.js b/app-cli/built/commands/serversetup.js index e349594..2b5c79c 100755 --- a/app-cli/built/commands/serversetup.js +++ b/app-cli/built/commands/serversetup.js @@ -21,6 +21,7 @@ const ErrorFactory_1 = require("../utils/ErrorFactory"); const SpinnerHelper_1 = require("../utils/SpinnerHelper"); let newPasswordFirstTry = undefined; let lastWorkingPassword = Constants_1.default.DEFAULT_PASSWORD; +let serverIpAddress = ''; let captainMachine = { authToken: '', baseUrl: '', @@ -56,6 +57,7 @@ const questions = [ // login using captain42. and set the ipAddressToServer captainMachine.baseUrl = `http://${ipFromUser}:3000`; yield CliApiManager_1.default.get(captainMachine).getAuthToken(lastWorkingPassword); + serverIpAddress = ipFromUser; } catch (e) { // User may have used a different default password @@ -86,8 +88,7 @@ const questions = [ type: 'input', name: 'captainRootDomain', message: 'Enter a root domain for this Captain server. For example, enter test.yourdomain.com if you' + - ' setup your DNS to point *.test.yourdomain.com to ip address of your server' + - ': ', + ' setup your DNS to point *.test.yourdomain.com to ip address of your server.', filter: (value) => __awaiter(this, void 0, void 0, function* () { const captainRootDomainFromUser = value.trim(); try { @@ -96,6 +97,18 @@ const questions = [ captainMachine.baseUrl = `http://captain.${captainRootDomainFromUser}`; } catch (e) { + StdOutUtil_1.default.printError('\n\n'); + if (e.captainStatus === ErrorFactory_1.default.VERIFICATION_FAILED) { + if (captainRootDomainFromUser.indexOf('/') >= 0) { + StdOutUtil_1.default.printError('DO NOT include http in your base domain, it should be just plain domain, e.g., test.domain.com'); + } + if (captainRootDomainFromUser.indexOf('*') >= 0) { + StdOutUtil_1.default.printError('DO NOT include * in your base domain, it should be just plain domain, e.g., test.domain.com'); + } + StdOutUtil_1.default.printError(`\n\nCannot verify that http://captain.${captainRootDomainFromUser} points to your server IP.\n` + + `\nAre you sure that you set *.${captainRootDomainFromUser} points to ${serverIpAddress}\n\n` + + `Double check your DNS. If everything looks correct, note that, DNS changes take up to 24 hrs to work properly. Check with your Domain Provider.`); + } StdOutUtil_1.default.errorHandler(e); } return captainRootDomainFromUser; @@ -107,6 +120,10 @@ const questions = [ message: 'Enter a new password:', filter: (value) => { newPasswordFirstTry = value; + if (!newPasswordFirstTry) { + StdOutUtil_1.default.printError('Password empty.', true); + throw new Error('Password empty'); + } return value; } }, @@ -116,7 +133,7 @@ const questions = [ message: 'Enter your new password again:', filter: (value) => __awaiter(this, void 0, void 0, function* () { const confirmPasswordValueFromUser = value; - if (newPasswordFirstTry !== confirmPasswordValueFromUser) { + if ((newPasswordFirstTry !== confirmPasswordValueFromUser)) { StdOutUtil_1.default.printError('Passwords do not match. Try serversetup again.', true); throw new Error('Password mismatch'); } diff --git a/app-cli/built/commands/serversetup.js.map b/app-cli/built/commands/serversetup.js.map index 812606b..8aa6722 100755 --- a/app-cli/built/commands/serversetup.js.map +++ b/app-cli/built/commands/serversetup.js.map @@ -1 +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c,CAAC,EAAE;gBACpD,OAAO,GAAG,cAAc,uHAAuH,CAAC;aAChJ;YAED,IAAI,mBAAS,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE;gBAChD,cAAc,CAAC,IAAI,GAAG,cAAc,CAAC;gBACrC,OAAO,IAAI,CAAC;aACZ;YAED,OAAO,2EAA2E,CAAC;QACpF,CAAC;KACD;CACD,CAAC;AAEF,SAAe,WAAW;;QACzB,oBAAU,CAAC,YAAY,CAAC,+BAA+B,CAAC,CAAC;QAEzD,MAAM,aAAa,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAEvD,uBAAa,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;QAEhD,oBAAU,CAAC,YAAY,CAAC,+BAA+B,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC;QAEjF,oBAAU,CAAC,YAAY,CAAC,oEAAoE,CAAC,CAAC;IAC/F,CAAC;CAAA;AAED,kBAAe,WAAW,CAAC"} \ No newline at end of file +{"version":3,"file":"serversetup.js","sourceRoot":"","sources":["../../src/commands/serversetup.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,qCAAqC;AACrC,kDAA2C;AAC3C,oDAA6C;AAC7C,oEAA0D;AAE1D,wDAAiD;AACjD,0CAAmC;AACnC,kDAA2C;AAC3C,0DAAmD;AACnD,wDAAiD;AACjD,0DAAmD;AAEnD,IAAI,mBAAmB,GAAuB,SAAS,CAAC;AACxD,IAAI,mBAAmB,GAAW,mBAAS,CAAC,gBAAgB,CAAC;AAC7D,IAAI,eAAe,GAAG,EAAE,CAAC;AAEzB,IAAI,cAAc,GAAa;IAC9B,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX,IAAI,EAAE,EAAE;CACR,CAAC;AAEF,MAAM,SAAS,GAAG;IACjB;QACC,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EACN,kFA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,EAAE;YAC3B,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;YAEpC,IAAI,YAAY,GAAG,SAAS,CAAC;YAC7B,IAAI,uBAAa,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE;gBACpD,OAAO,GAAG,cAAc,uHAAuH,CAAC;aAChJ;YAED,IAAI,mBAAS,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE;gBAChD,cAAc,CAAC,IAAI,GAAG,cAAc,CAAC;gBACrC,OAAO,IAAI,CAAC;aACZ;YAED,OAAO,2EAA2E,CAAC;QACpF,CAAC;KACD;CACD,CAAC;AAEF,SAAe,WAAW;;QACzB,oBAAU,CAAC,YAAY,CAAC,+BAA+B,CAAC,CAAC;QAEzD,MAAM,aAAa,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAEvD,uBAAa,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;QAEhD,oBAAU,CAAC,YAAY,CAAC,+BAA+B,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC;QAEjF,oBAAU,CAAC,YAAY,CAAC,oEAAoE,CAAC,CAAC;IAC/F,CAAC;CAAA;AAED,kBAAe,WAAW,CAAC"} \ No newline at end of file diff --git a/app-cli/src/commands/serversetup.ts b/app-cli/src/commands/serversetup.ts index f419e56..0bc0be0 100644 --- a/app-cli/src/commands/serversetup.ts +++ b/app-cli/src/commands/serversetup.ts @@ -14,6 +14,7 @@ import SpinnerHelper from '../utils/SpinnerHelper'; let newPasswordFirstTry: string | undefined = undefined; let lastWorkingPassword: string = Constants.DEFAULT_PASSWORD; +let serverIpAddress = ''; let captainMachine: IMachine = { authToken: '', @@ -58,6 +59,7 @@ const questions = [ // login using captain42. and set the ipAddressToServer captainMachine.baseUrl = `http://${ipFromUser}:3000`; await CliApiManager.get(captainMachine).getAuthToken(lastWorkingPassword); + serverIpAddress = ipFromUser; } catch (e) { // User may have used a different default password if (e.captainStatus === ErrorFactory.STATUS_WRONG_PASSWORD) return ''; @@ -87,8 +89,7 @@ const questions = [ name: 'captainRootDomain', message: 'Enter a root domain for this Captain server. For example, enter test.yourdomain.com if you' + - ' setup your DNS to point *.test.yourdomain.com to ip address of your server' + - ': ', + ' setup your DNS to point *.test.yourdomain.com to ip address of your server.', filter: async (value: string) => { const captainRootDomainFromUser = value.trim(); try { @@ -96,6 +97,26 @@ const questions = [ captainMachine = Utils.copyObject(captainMachine); captainMachine.baseUrl = `http://captain.${captainRootDomainFromUser}`; } catch (e) { + StdOutUtil.printError('\n\n'); + if (e.captainStatus === ErrorFactory.VERIFICATION_FAILED) { + if (captainRootDomainFromUser.indexOf('/') >= 0) { + StdOutUtil.printError( + 'DO NOT include http in your base domain, it should be just plain domain, e.g., test.domain.com' + ); + } + + if (captainRootDomainFromUser.indexOf('*') >= 0) { + StdOutUtil.printError( + 'DO NOT include * in your base domain, it should be just plain domain, e.g., test.domain.com' + ); + } + + StdOutUtil.printError( + `\n\nCannot verify that http://captain.${captainRootDomainFromUser} points to your server IP.\n` + + `\nAre you sure that you set *.${captainRootDomainFromUser} points to ${serverIpAddress}\n\n` + + `Double check your DNS. If everything looks correct, note that, DNS changes take up to 24 hrs to work properly. Check with your Domain Provider.` + ); + } StdOutUtil.errorHandler(e); } @@ -108,6 +129,12 @@ const questions = [ message: 'Enter a new password:', filter: (value: string) => { newPasswordFirstTry = value; + + if (!newPasswordFirstTry) { + StdOutUtil.printError('Password empty.', true); + throw new Error('Password empty'); + } + return value; } }, @@ -118,10 +145,11 @@ const questions = [ filter: async (value: string) => { const confirmPasswordValueFromUser = value; - if (newPasswordFirstTry !== confirmPasswordValueFromUser) { + if ((newPasswordFirstTry !== confirmPasswordValueFromUser)) { StdOutUtil.printError('Passwords do not match. Try serversetup again.', true); throw new Error('Password mismatch'); } + return ''; } }, From fdf69ef62d19e008b2d570c8b94180f8f9f33cd9 Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Sun, 6 Jan 2019 16:46:35 -0800 Subject: [PATCH 42/44] updated package json --- app-cli/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app-cli/package.json b/app-cli/package.json index 71c48b8..0986878 100644 --- a/app-cli/package.json +++ b/app-cli/package.json @@ -46,7 +46,7 @@ "@types/inquirer": "^0.0.43", "@types/request-promise": "^4.1.42", "@types/update-notifier": "^2.5.0", - "chalk": "^2.4.1", + "chalk": "^2.4.2", "command-exists": "^1.2.8", "commander": "^2.19.0", "configstore": "^4.0.0", @@ -62,7 +62,7 @@ }, "devDependencies": { "@types/node": "^10.12.18", - "eslint": "^5.11.1", + "eslint": "^5.12.0", "eslint-plugin-jest": "^21.27.2", "jest": "^23.6.0", "prettier": "^1.15.3" From 411b3fead76eb3ada8004d688a42dbda63fc6200 Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Sun, 6 Jan 2019 16:47:10 -0800 Subject: [PATCH 43/44] updated package json --- app-cli/yarn.lock | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app-cli/yarn.lock b/app-cli/yarn.lock index dca898b..7cc2bd3 100644 --- a/app-cli/yarn.lock +++ b/app-cli/yarn.lock @@ -862,7 +862,7 @@ chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.4.1: +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.1: version "2.4.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" integrity sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ== @@ -871,6 +871,15 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.4.1: escape-string-regexp "^1.0.5" supports-color "^5.3.0" +chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + chardet@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" @@ -1497,7 +1506,7 @@ eslint-visitor-keys@^1.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== -eslint@^5.11.1: +eslint@^5.12.0: version "5.12.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.12.0.tgz#fab3b908f60c52671fb14e996a450b96c743c859" integrity sha512-LntwyPxtOHrsJdcSwyQKVtHofPHdv+4+mFwEe91r2V13vqpM8yLr7b1sW+Oo/yheOPkWYsYlYJCkzlFAt8KV7g== From 4d4bb632720dd1eb758d26cc29374c018083dbf1 Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Sun, 6 Jan 2019 16:56:03 -0800 Subject: [PATCH 44/44] updated docs --- app-cli/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app-cli/readme.md b/app-cli/readme.md index 0748cfe..20537c3 100644 --- a/app-cli/readme.md +++ b/app-cli/readme.md @@ -69,7 +69,7 @@ You will then see your application being uploaded, after that, your application You can also deploy directly with one command: ```bash -captainduckduck deploy -s -h https://captain.root.domain.com -a app-name -p password -b branchName +captainduckduck deploy -h https://captain.root.domain.com -a app-name -p password -b branchName ``` This can be useful if you want to integrate CI/CD pipeline.