From 30218590edbfeafa61eb45e3a04e01d9baf9260a Mon Sep 17 00:00:00 2001 From: Sumit Goel Date: Mon, 14 Aug 2017 12:51:27 -0700 Subject: [PATCH 01/18] update travis to use npm test --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a325047..8267d5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,8 +20,7 @@ install: - npm install script: - - shellcheck -s bash -Calways ./tasks/test.sh - - bash ./tasks/test.sh + - npm test matrix: fast_finish: true From 47bd8d79992be817628d15020968783ecc7d8ec1 Mon Sep 17 00:00:00 2001 From: Sumit Goel Date: Mon, 14 Aug 2017 12:53:04 -0700 Subject: [PATCH 02/18] add hostname, expose port 443, add volume for nginx ssl directory --- docker-compose.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index bc560e6..ad6b807 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,13 @@ version: '2' services: zabbix-database: + hostname: zabbix-database.local image: postgres:alpine environment: POSTGRES_USER: ${DBUSER} POSTGRES_PASSWORD: ${DBPASS} zabbix-server: + hostname: zabbix-server.local image: zabbix/zabbix-server-pgsql:${ZABTAG} environment: DB_SERVER_HOST: zabbix-database @@ -14,9 +16,13 @@ services: depends_on: - zabbix-database zabbix-web: + hostname: zabbix-web.local image: zabbix/zabbix-web-nginx-pgsql:${ZABTAG} + volumes: + - ${NGINXDIRSSL}:/etc/ssl/nginx ports: - - ${HOSTPORT}:80/tcp + - 0.0.0.0:${HOSTPORT}:80/tcp + - 0.0.0.0:${HOSTPORTSSL}:443/tcp environment: ZBX_SERVER_HOST: zabbix-server DB_SERVER_HOST: zabbix-database @@ -27,6 +33,7 @@ services: - zabbix-server - zabbix-database zabbix-agent1: + hostname: zabbix-agent1.local image: zabbix/zabbix-agent:${ZABTAG} environment: ZBX_HOSTNAME: zabbix-agent1 @@ -34,6 +41,7 @@ services: depends_on: - zabbix-server zabbix-agent2: + hostname: zabbix-agent2.local image: zabbix/zabbix-agent:${ZABTAG} environment: ZBX_HOSTNAME: zabbix-agent2 @@ -41,6 +49,7 @@ services: depends_on: - zabbix-server zabbix-agent3: + hostname: zabbix-agent3.local image: zabbix/zabbix-agent:${ZABTAG} environment: ZBX_HOSTNAME: zabbix-agent3 From 7076576e5fe17f9aca2e7cf132f17ba257f9db07 Mon Sep 17 00:00:00 2001 From: Sumit Goel Date: Mon, 14 Aug 2017 12:53:25 -0700 Subject: [PATCH 03/18] first commit --- tasks/ssl/dhparam.pem | 8 ++++++++ tasks/ssl/ssl.crt | 23 +++++++++++++++++++++++ tasks/ssl/ssl.csr | 18 ++++++++++++++++++ tasks/ssl/ssl.key | 27 +++++++++++++++++++++++++++ 4 files changed, 76 insertions(+) create mode 100644 tasks/ssl/dhparam.pem create mode 100644 tasks/ssl/ssl.crt create mode 100644 tasks/ssl/ssl.csr create mode 100644 tasks/ssl/ssl.key diff --git a/tasks/ssl/dhparam.pem b/tasks/ssl/dhparam.pem new file mode 100644 index 0000000..495fa7d --- /dev/null +++ b/tasks/ssl/dhparam.pem @@ -0,0 +1,8 @@ +-----BEGIN DH PARAMETERS----- +MIIBCAKCAQEA56u8aEfOO8albchbrekiD6ZzITrzoUhwIOaCyHk5Ey2X+TPVeRhp +IVRQipcuxPeYhwNJp9UZCF1lTwTyLorUAdYh283NSz146Y49BO/p1z+NZWG9Wrjd +Ov+gYgt4Y+Muoyv5WbyDtNPM/4lGmwMKQBo2Wu8oHrsqaD7FfJgm+IrYi8oc1mBf +OKsMKiVFhiZCluNRB4hdq81+EWVk3i/oekwL5pR2k8AzqHVlRVJUjIrAbVUjJqKr +t60se6yTNlYzVZYz039E5UHXQEdLehrjOBWwuc1o5zxkqmrTgKqVgFTbrQSJo6Jq +YvBUyOIfy2TzMSCIUScU3so0k23NnpeTYwIBAg== +-----END DH PARAMETERS----- diff --git a/tasks/ssl/ssl.crt b/tasks/ssl/ssl.crt new file mode 100644 index 0000000..fa3e474 --- /dev/null +++ b/tasks/ssl/ssl.crt @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIIDyjCCArICCQDjbEqIEQ5iIzANBgkqhkiG9w0BAQsFADCBpjELMAkGA1UEBhMC +VVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28x +FDASBgNVBAoTC3N1bWl0Z29lbHB3MRcwFQYDVQQLEw56YWJiaXgtcHJvbWlzZTEZ +MBcGA1UEAxMQemFiYml4LXdlYi5sb2NhbDEgMB4GCSqGSIb3DQEJARYRZW1haWxA +ZXhhbXBsZS5jb20wHhcNMTcwODE0MDUwNTE5WhcNMTgwODE0MDUwNTE5WjCBpjEL +MAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG +cmFuY2lzY28xFDASBgNVBAoTC3N1bWl0Z29lbHB3MRcwFQYDVQQLEw56YWJiaXgt +cHJvbWlzZTEZMBcGA1UEAxMQemFiYml4LXdlYi5sb2NhbDEgMB4GCSqGSIb3DQEJ +ARYRZW1haWxAZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK +AoIBAQDCQRVKme+qqYaVHGymMDjU5w/SGOdOUu3s0H+JMYHuqwH5jHRGsLZyymTB +BQDkIFx7N/8vLos32/9agD/MHSveqXULatHKhEkHATkYxcY2MSpDLPOj2UC51iat +STFkNpUnhxU+kUj+2AZXwvHxAZa6pK/zgMo9SHmeF5lkQ+JaK2sxH77oyjYtDqxp +7bey9nfVDsokg/c3Gcmex3tcW0F7btJ0nLkSJY2zaO0QaIEt0tZ5omMnglEjPSGA +ddl9HnE84G6QdUTXzvcrepE40KFAU4THI/CSBpbS/nUSZstSTH7lo2VNvTksOZlU +h4riSuzbzFLKLO31ew2GJQqqoKTFAgMBAAEwDQYJKoZIhvcNAQELBQADggEBALJs +Cp+VcI8mXuBskjAUmM0q+Aywfa5lFCYNKnHU/3xyP4PPraaihqt7HqUx8ZemRq0X +d3B+AlQv3hM2+Jth/RwXiKfWnlv+o7Jm+C2BAy53e35ZV2ApK+rnMhmdeZ+Ppj3l +af307/nlbxc5UQ9qwMAVD9B9yEt7C7IU1GkC9HW1j6sNhdXKoxBqzdQhzFTYrzxM +urDYc5SNaksZdv4Nd44wL8Sf3w3sU1ckCDjFNKhBJRIR5ZxV8aWonCv9LhPIbxZ1 +ojnYgFliRA9X5TR4EWNsI1Uoo5T3J3EOJSkrZsWwsiQzX/1qEp546k2xQa8Qy8iE +Un2UitL3MWXOtYTKqRA= +-----END CERTIFICATE----- diff --git a/tasks/ssl/ssl.csr b/tasks/ssl/ssl.csr new file mode 100644 index 0000000..cf2955b --- /dev/null +++ b/tasks/ssl/ssl.csr @@ -0,0 +1,18 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIC7DCCAdQCAQAwgaYxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlh +MRYwFAYDVQQHEw1TYW4gRnJhbmNpc2NvMRQwEgYDVQQKEwtzdW1pdGdvZWxwdzEX +MBUGA1UECxMOemFiYml4LXByb21pc2UxGTAXBgNVBAMTEHphYmJpeC13ZWIubG9j +YWwxIDAeBgkqhkiG9w0BCQEWEWVtYWlsQGV4YW1wbGUuY29tMIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwkEVSpnvqqmGlRxspjA41OcP0hjnTlLt7NB/ +iTGB7qsB+Yx0RrC2cspkwQUA5CBcezf/Ly6LN9v/WoA/zB0r3ql1C2rRyoRJBwE5 +GMXGNjEqQyzzo9lAudYmrUkxZDaVJ4cVPpFI/tgGV8Lx8QGWuqSv84DKPUh5nheZ +ZEPiWitrMR++6Mo2LQ6sae23svZ31Q7KJIP3NxnJnsd7XFtBe27SdJy5EiWNs2jt +EGiBLdLWeaJjJ4JRIz0hgHXZfR5xPOBukHVE1873K3qRONChQFOExyPwkgaW0v51 +EmbLUkx+5aNlTb05LDmZVIeK4krs28xSyizt9XsNhiUKqqCkxQIDAQABoAAwDQYJ +KoZIhvcNAQEFBQADggEBACqO0Cu6h+LJAnPcoLqbdu2JoZda41TyU0VF5SaRZbni +ufPbuq5Anx0SYIiAMKW2W6mv089KiOdkr0TrC+NfCMWwTJccUzye3KKa3qL6VppR +AEKy5ipvlkBJG8wUoR1MhEhQZ3WJLxmnvMIwJl7PWTsjdOC7T92gmlGi/ueh9rCF +Pf1GsCEwW1Ce8u/0daped3PagO54LRxJWe8xh+9fV8GqbD9xHf1wpN+Wee3uIF2R +wVKpLSGrmdey8NsbmL++v/Ae0NLE+xqFqMkR5Al3D13+jQ5tz4i6ZNg/wfQnU2mD +RgsMoJodFjh036ADkHDy5Ghv6+beyjEm5dIKSqc3RbE= +-----END CERTIFICATE REQUEST----- diff --git a/tasks/ssl/ssl.key b/tasks/ssl/ssl.key new file mode 100644 index 0000000..1464330 --- /dev/null +++ b/tasks/ssl/ssl.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpQIBAAKCAQEAwkEVSpnvqqmGlRxspjA41OcP0hjnTlLt7NB/iTGB7qsB+Yx0 +RrC2cspkwQUA5CBcezf/Ly6LN9v/WoA/zB0r3ql1C2rRyoRJBwE5GMXGNjEqQyzz +o9lAudYmrUkxZDaVJ4cVPpFI/tgGV8Lx8QGWuqSv84DKPUh5nheZZEPiWitrMR++ +6Mo2LQ6sae23svZ31Q7KJIP3NxnJnsd7XFtBe27SdJy5EiWNs2jtEGiBLdLWeaJj +J4JRIz0hgHXZfR5xPOBukHVE1873K3qRONChQFOExyPwkgaW0v51EmbLUkx+5aNl +Tb05LDmZVIeK4krs28xSyizt9XsNhiUKqqCkxQIDAQABAoIBADRXiyAl6HFo6o2l +MhV5quabOCUZdsIhEGEeMS9LesJPq+GNGguuNAssRAfKjFnr6l99UDJrbTHpAp5l +LkuWlKqTqKkh6FOUX4UWrEbji6wwhT3CkAfXU1x/ur44malyF7Cl8nCAf1XD6bme +Gskg73dtRsfrLRNkQvj5TOi6bfRzhDqASz8oqsY7kNS8giqt60ufHAIZiFqMhIUK +8KAjJbPdcInijGbETK3chVMMXBIPhiY6pWAGajoQ8/KsUTLeiQexqArPNTAVXXS3 +wBaFxvW9fJNqyUtoN6q1JBXwV2pu9FOs2SjXmKxgBeebKxSl+J3qYjFYmghP+7JS +ks8aigUCgYEA68jOHyONLlWsJxpuqc87+pCKw/c9tXenUsrOo9QAcz3Hus5zjIdA +ltmd0E3PpywUGRNdtgBTLV47nY3AzDjIYL/CrFmDeuVTtSUasN+VFam1yZS9Iu4L +OzkqcPE7DncZVS2EREn/GwSWQYEiGKFM+blaYwttMy/GBEeTRa2nuusCgYEA0ui9 +KlqWFfZ2D8QArAwsZ+9XP6sZbQx8O+tOKSYZKorJ1eL5UNLYvKh1LBqkHSonWJs+ +JN907IeQzVngpU6pbDxr22dF/JSbNzWD6xntQVeqEEBXoRbCs/mNwLuG9hfVuD5C +K5ZaV8t0+mJoHka3rfx2mlkZlxFZ/udaNzL30w8CgYEAu+9BhAZlSLJW1pA19rnM +l+pQAOT31cW6o74tON4JQdHTei2GYlOIAvUP2fG7ewciOd56yk+1/KpooCtVqjH0 +XVFbjN6IcxOJRhB+Fs8PWMX9tOAOZWIRp7HoBz/wD5aUpZTzIS9N3C4qyalxEOq4 +nS/FQL7h2nPQxKZ8V4ST9eMCgYEAxIfFhcsFog+YchZ1fdyWIH+hcJ2yQrBor7kT +izqKJt9PNrSbF9pxxlK/ZMqqdNbL9UAsB1YGcUXeA8yljcSgEVC4PKmeSL/9ZtPC +SnhNYh8bRKuAPIamBekcUyUrnPQW3el95XnkU30uUwcR+GxzSng/2JIAS4oKr4HL +yjX/QrcCgYEA2bVHHxcgS35ru8e0p8HbRSzVw77ugigtqZUvuP0UYB7CjxPySGLs +u5j0+b+d0KU4fs8xpLSdoXjSRkK522u6lSMWQsSqcEOdKUn3kKAdB/I1GMQXzxhs +nMcVz8vKJAER1yX89Db1y6viGtqM/44MhIubdrC3TA+WZj0ti5vz2ZY= +-----END RSA PRIVATE KEY----- From 5ab93119f6076cdab9a0dc7efe83bf5ea74de076 Mon Sep 17 00:00:00 2001 From: Sumit Goel Date: Mon, 14 Aug 2017 12:54:13 -0700 Subject: [PATCH 04/18] bumped package dependencies version --- package-lock.json | 452 ++++++++++++++++++++++++++-------------------- package.json | 14 +- 2 files changed, 268 insertions(+), 198 deletions(-) diff --git a/package-lock.json b/package-lock.json index 11ee1ae..4c3e918 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "zabbix-promise", - "version": "1.0.5", + "version": "1.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -71,7 +71,7 @@ "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", "dev": true, "requires": { - "string-width": "2.1.0" + "string-width": "2.1.1" } }, "ansi-escapes": { @@ -93,14 +93,14 @@ "dev": true }, "anymatch": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.0.tgz", - "integrity": "sha1-o+Uvo5FoyCX/V7AkgSbOWo/5VQc=", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", "dev": true, "optional": true, "requires": { - "arrify": "1.0.1", - "micromatch": "2.3.11" + "micromatch": "2.3.11", + "normalize-path": "2.1.1" } }, "argparse": { @@ -216,7 +216,7 @@ "babel-core": "6.25.0", "babel-polyfill": "6.23.0", "babel-register": "6.24.1", - "babel-runtime": "6.23.0", + "babel-runtime": "6.25.0", "chokidar": "1.7.0", "commander": "2.11.0", "convert-source-map": "1.5.0", @@ -252,7 +252,7 @@ "babel-helpers": "6.24.1", "babel-messages": "6.23.0", "babel-register": "6.24.1", - "babel-runtime": "6.23.0", + "babel-runtime": "6.25.0", "babel-template": "6.25.0", "babel-traverse": "6.25.0", "babel-types": "6.25.0", @@ -287,7 +287,7 @@ "dev": true, "requires": { "babel-messages": "6.23.0", - "babel-runtime": "6.23.0", + "babel-runtime": "6.25.0", "babel-types": "6.25.0", "detect-indent": "4.0.0", "jsesc": "1.3.0", @@ -302,7 +302,7 @@ "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", "dev": true, "requires": { - "babel-runtime": "6.23.0", + "babel-runtime": "6.25.0", "babel-template": "6.25.0" } }, @@ -312,7 +312,7 @@ "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", "dev": true, "requires": { - "babel-runtime": "6.23.0" + "babel-runtime": "6.25.0" } }, "babel-plugin-syntax-flow": { @@ -328,7 +328,7 @@ "dev": true, "requires": { "babel-plugin-syntax-flow": "6.18.0", - "babel-runtime": "6.23.0" + "babel-runtime": "6.25.0" } }, "babel-polyfill": { @@ -337,8 +337,8 @@ "integrity": "sha1-g2TKYt+Or7gwSZ9pkXdGbDsDSZ0=", "dev": true, "requires": { - "babel-runtime": "6.23.0", - "core-js": "2.4.1", + "babel-runtime": "6.25.0", + "core-js": "2.5.0", "regenerator-runtime": "0.10.5" } }, @@ -358,8 +358,8 @@ "dev": true, "requires": { "babel-core": "6.25.0", - "babel-runtime": "6.23.0", - "core-js": "2.4.1", + "babel-runtime": "6.25.0", + "core-js": "2.5.0", "home-or-tmp": "2.0.0", "lodash": "4.17.4", "mkdirp": "0.5.1", @@ -367,12 +367,12 @@ } }, "babel-runtime": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "integrity": "sha1-CpSJ8UTecO+zzkMArM2zKeL8VDs=", + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.25.0.tgz", + "integrity": "sha1-M7mOql1IK7AajRqmtDetKwGuxBw=", "dev": true, "requires": { - "core-js": "2.4.1", + "core-js": "2.5.0", "regenerator-runtime": "0.10.5" } }, @@ -382,7 +382,7 @@ "integrity": "sha1-ZlJBFmt8KqTGGdceGSlpVSsQwHE=", "dev": true, "requires": { - "babel-runtime": "6.23.0", + "babel-runtime": "6.25.0", "babel-traverse": "6.25.0", "babel-types": "6.25.0", "babylon": "6.17.4", @@ -397,7 +397,7 @@ "requires": { "babel-code-frame": "6.22.0", "babel-messages": "6.23.0", - "babel-runtime": "6.23.0", + "babel-runtime": "6.25.0", "babel-types": "6.25.0", "babylon": "6.17.4", "debug": "2.6.8", @@ -412,7 +412,7 @@ "integrity": "sha1-cK+ySNVmDl0Y+BHZHIMDtUE0oY4=", "dev": true, "requires": { - "babel-runtime": "6.23.0", + "babel-runtime": "6.25.0", "esutils": "2.0.2", "lodash": "4.17.4", "to-fast-properties": "1.0.3" @@ -440,9 +440,9 @@ } }, "binary-extensions": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.8.0.tgz", - "integrity": "sha1-SOyNFt9Dd+rl+liEaCSAr02Vx3Q=", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.9.0.tgz", + "integrity": "sha1-ZlBsFs5vTWkopbPNajPKQelB43s=", "dev": true, "optional": true }, @@ -455,25 +455,54 @@ } }, "boxen": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.1.0.tgz", - "integrity": "sha1-sbad1SIwXoB6md7ud329blFnsQI=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.2.1.tgz", + "integrity": "sha1-DxHn/jRO25OXl3/BPt5/ZNlWSB0=", "dev": true, "requires": { "ansi-align": "2.0.0", "camelcase": "4.1.0", - "chalk": "1.1.3", + "chalk": "2.1.0", "cli-boxes": "1.0.0", - "string-width": "2.1.0", - "term-size": "0.1.1", + "string-width": "2.1.1", + "term-size": "1.2.0", "widest-line": "1.0.0" }, "dependencies": { + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.0" + } + }, "camelcase": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", "dev": true + }, + "chalk": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", + "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.2.1" + } + }, + "supports-color": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.2.1.tgz", + "integrity": "sha512-qxzYsob3yv6U+xMzPrv170y8AwGP7i74g+pbixCfD6rgso8BscLT2qXIuz6TpOaiJZ3mFgT5O9lyT9nMU4LfaA==", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } } } }, @@ -594,9 +623,9 @@ } }, "chai": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.0.2.tgz", - "integrity": "sha1-L3MnxN5vOF3XeHmZ4qsCaXoyuDs=", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.1.1.tgz", + "integrity": "sha1-ZuISeebzxkFf+CMYeCJ5AOIXGzk=", "dev": true, "requires": { "assertion-error": "1.0.2", @@ -642,7 +671,7 @@ "dev": true, "optional": true, "requires": { - "anymatch": "1.3.0", + "anymatch": "1.3.2", "async-each": "1.0.1", "fsevents": "1.1.2", "glob-parent": "2.0.0", @@ -660,9 +689,9 @@ "dev": true }, "circular-json": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.1.tgz", - "integrity": "sha1-vos2rvzN6LPKeqLWr8B6NyQsDS0=", + "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": { @@ -730,13 +759,13 @@ "integrity": "sha1-Gsz5fdc5uYO/mU1W/sj5WFNkG3o=", "dev": true, "requires": { - "color-name": "1.1.2" + "color-name": "1.1.3" } }, "color-name": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.2.tgz", - "integrity": "sha1-XIq3K2S9IhXWF66VWeuxSEdc+Y0=", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, "combined-stream": { @@ -771,12 +800,12 @@ } }, "configstore": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.0.tgz", - "integrity": "sha1-Rd+QcHPibfoc9LLVL1tgVF6qEdE=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.1.tgz", + "integrity": "sha512-5oNkD/L++l0O6xGXxb1EWS7SivtjfGQlRyxJsYgE0Z495/L81e2h4/d3r969hoPXuFItzNOKMtsXgYG4c7dYvw==", "dev": true, "requires": { - "dot-prop": "4.1.1", + "dot-prop": "4.2.0", "graceful-fs": "4.1.11", "make-dir": "1.0.0", "unique-string": "1.0.0", @@ -791,16 +820,15 @@ "dev": true }, "core-js": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.4.1.tgz", - "integrity": "sha1-TekR5mew6ukSTjQlS1OupvxhjT4=", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.0.tgz", + "integrity": "sha1-VpwFCRi+ZIazg3VSAorgRmtxcIY=", "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=", - "dev": true + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, "coveralls": { "version": "2.13.1", @@ -864,7 +892,7 @@ "is-typedarray": "1.0.0", "isstream": "0.1.2", "json-stringify-safe": "5.0.1", - "mime-types": "2.1.15", + "mime-types": "2.1.16", "oauth-sign": "0.8.2", "qs": "6.3.2", "stringstream": "0.0.5", @@ -890,6 +918,17 @@ "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=", + "dev": true, + "requires": { + "lru-cache": "4.1.1", + "shebang-command": "1.2.0", + "which": "1.3.0" + } + }, "cross-spawn-async": { "version": "2.2.5", "resolved": "https://registry.npmjs.org/cross-spawn-async/-/cross-spawn-async-2.2.5.tgz", @@ -897,7 +936,7 @@ "dev": true, "requires": { "lru-cache": "4.1.1", - "which": "1.2.14" + "which": "1.3.0" } }, "cryptiles": { @@ -1119,9 +1158,9 @@ } }, "dot-prop": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.1.1.tgz", - "integrity": "sha1-qEk/C3te7sglJbXHWH+n3nyoWcE=", + "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==", "dev": true, "requires": { "is-obj": "1.0.1" @@ -1198,30 +1237,32 @@ } }, "eslint": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.2.0.tgz", - "integrity": "sha1-orMYQRGxmOAunH88ymJaXgHFaz0=", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.4.1.tgz", + "integrity": "sha1-mc1+r8/8ov+Zpcj18qR01jZLS9M=", "dev": true, "requires": { "ajv": "5.2.2", "babel-code-frame": "6.22.0", "chalk": "1.1.3", "concat-stream": "1.6.0", + "cross-spawn": "5.1.0", "debug": "2.6.8", "doctrine": "2.0.0", "eslint-scope": "3.7.1", - "espree": "3.4.3", + "espree": "3.5.0", "esquery": "1.0.0", "estraverse": "4.2.0", "esutils": "2.0.2", "file-entry-cache": "2.0.0", + "functional-red-black-tree": "1.0.1", "glob": "7.1.2", "globals": "9.18.0", "ignore": "3.3.3", "imurmurhash": "0.1.4", - "inquirer": "3.2.0", + "inquirer": "3.2.1", "is-resolvable": "1.0.0", - "js-yaml": "3.9.0", + "js-yaml": "3.9.1", "json-stable-stringify": "1.0.1", "levn": "0.3.0", "lodash": "4.17.4", @@ -1233,6 +1274,7 @@ "pluralize": "4.0.0", "progress": "2.0.0", "require-uncached": "1.0.3", + "semver": "5.4.1", "strip-json-comments": "2.0.1", "table": "4.0.1", "text-table": "0.2.0" @@ -1257,9 +1299,9 @@ "dev": true }, "js-yaml": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.9.0.tgz", - "integrity": "sha512-0LoUNELX4S+iofCT8f4uEHIiRBR+c2AINyC8qRWfC6QNruLtxVZRJaPcu/xwMgFIgDxF25tGHaDjvxzJCNE9yw==", + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.9.1.tgz", + "integrity": "sha512-CbcG379L1e+mWBnLvHWWeLs8GyV/EMw862uLI3c+GxVyDHWZcjZinwuBd3iW2pgxgIlksW/1vNJa4to+RvDOww==", "dev": true, "requires": { "argparse": "1.0.9", @@ -1274,13 +1316,13 @@ "integrity": "sha512-7Kr71WRD54h0FQ3L8yy01F/zXt4sEynv3k/paz6tuXViR72xZoEooh0nW1Na8m3DFdpiKhIcSfTmRYIV9HzhBA==", "dev": true, "requires": { - "eslint": "4.2.0" + "eslint": "4.4.1" } }, "eslint-plugin-flowtype": { - "version": "2.34.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.34.1.tgz", - "integrity": "sha512-xwXpTW7Xv+wfuQdfPILmFl9HWBdWbDjE1aZWWQ4EgCpQtMzymEkDQfyD1ME0VA8C0HTXV7cufypQRvLi+Hk/og==", + "version": "2.35.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.35.0.tgz", + "integrity": "sha512-zjXGjOsHds8b84C0Ad3VViKh+sUA9PeXKHwPRlSLwwSX0v1iUJf/6IX7wxc+w2T2tnDH8PT6B/YgtcEuNI3ssA==", "dev": true, "requires": { "lodash": "4.17.4" @@ -1297,9 +1339,9 @@ } }, "espree": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.4.3.tgz", - "integrity": "sha1-KRC1zNSc6JPC//+qtP2LOjG4I3Q=", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.0.tgz", + "integrity": "sha1-mDWGJb3QVYYeon4oZ+pyn69GPY0=", "dev": true, "requires": { "acorn": "5.1.1", @@ -1394,7 +1436,7 @@ "dev": true, "requires": { "iconv-lite": "0.4.18", - "jschardet": "1.4.2", + "jschardet": "1.5.1", "tmp": "0.0.31" } }, @@ -1409,9 +1451,9 @@ } }, "extsprintf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz", - "integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=" + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" }, "fast-deep-equal": { "version": "1.0.0", @@ -1481,16 +1523,16 @@ "integrity": "sha1-+oZxTnLCHbiGAXYezy9VXRq8a5Y=", "dev": true, "requires": { - "circular-json": "0.3.1", + "circular-json": "0.3.3", "del": "2.2.2", "graceful-fs": "4.1.11", "write": "0.2.1" } }, "flow-bin": { - "version": "0.49.1", - "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.49.1.tgz", - "integrity": "sha1-yeRWsxc6dTWk/68olWNSxju44+k=", + "version": "0.52.0", + "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.52.0.tgz", + "integrity": "sha1-ttmr6LzR7lxi3zhkUaTiVTytw6M=", "dev": true }, "for-in": { @@ -1522,7 +1564,7 @@ "requires": { "asynckit": "0.4.0", "combined-stream": "1.0.5", - "mime-types": "2.1.15" + "mime-types": "2.1.16" } }, "fs-readdir-recursive": { @@ -2436,6 +2478,12 @@ } } }, + "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 + }, "generate-function": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", @@ -2549,7 +2597,7 @@ "homedir-polyfill": "1.0.1", "ini": "1.3.4", "is-windows": "0.2.0", - "which": "1.2.14" + "which": "1.3.0" } }, "globals": { @@ -2719,7 +2767,7 @@ "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", "requires": { "assert-plus": "0.2.0", - "jsprim": "1.4.0", + "jsprim": "1.4.1", "sshpk": "1.13.1" } }, @@ -2779,13 +2827,13 @@ "dev": true }, "inquirer": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.2.0.tgz", - "integrity": "sha512-4CyUYMP7lOBkiUU1rR24WGrfRX6SucwbY2Mqb1PdApU24wnTIk4TsnkQwV72dDdIKZ2ycLP+fWCV+tA7wwgoew==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.2.1.tgz", + "integrity": "sha512-QgW3eiPN8gpj/K5vVpHADJJgrrF0ho/dZGylikGX7iqAdRgC9FVKYKWFLx6hZDBFcOLEoSqINYrVPeFAeG/PdA==", "dev": true, "requires": { "ansi-escapes": "2.0.0", - "chalk": "2.0.1", + "chalk": "2.1.0", "cli-cursor": "2.1.0", "cli-width": "2.1.0", "external-editor": "2.0.4", @@ -2795,7 +2843,7 @@ "run-async": "2.3.0", "rx-lite": "4.0.8", "rx-lite-aggregates": "4.0.8", - "string-width": "2.1.0", + "string-width": "2.1.1", "strip-ansi": "4.0.0", "through": "2.3.8" }, @@ -2807,23 +2855,23 @@ "dev": true }, "ansi-styles": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.1.0.tgz", - "integrity": "sha1-CcIC1ckX7CMYjKpcnLkXnNlUd1A=", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", "dev": true, "requires": { "color-convert": "1.9.0" } }, "chalk": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.0.1.tgz", - "integrity": "sha512-Mp+FXEI+FrwY/XYV45b2YD3E8i3HwnEAoFcM0qlZzq/RZ9RwWitt2Y/c7cqRAz70U7hfekqx6qNYthuKFO6K0g==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", + "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", "dev": true, "requires": { - "ansi-styles": "3.1.0", + "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.2.0" + "supports-color": "4.2.1" } }, "strip-ansi": { @@ -2836,9 +2884,9 @@ } }, "supports-color": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.2.0.tgz", - "integrity": "sha512-Ts0Mu/A1S1aZxEJNG88I4Oc9rcZSBFNac5e27yh4j2mqbhZSSzR1Ah79EYwSn9Zuh7lrlGD2cVGzw1RKGzyLSg==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.2.1.tgz", + "integrity": "sha512-qxzYsob3yv6U+xMzPrv170y8AwGP7i74g+pbixCfD6rgso8BscLT2qXIuz6TpOaiJZ3mFgT5O9lyT9nMU4LfaA==", "dev": true, "requires": { "has-flag": "2.0.0" @@ -2874,7 +2922,7 @@ "dev": true, "optional": true, "requires": { - "binary-extensions": "1.8.0" + "binary-extensions": "1.9.0" } }, "is-buffer": { @@ -3139,7 +3187,7 @@ "once": "1.4.0", "resolve": "1.1.7", "supports-color": "3.2.3", - "which": "1.2.14", + "which": "1.3.0", "wordwrap": "1.0.0" }, "dependencies": { @@ -3196,9 +3244,9 @@ "optional": true }, "jschardet": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-1.4.2.tgz", - "integrity": "sha1-KqEH8UKvQSHRRWWdRPUIMJYeaZo=", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-1.5.1.tgz", + "integrity": "sha512-vE2hT1D0HLZCLLclfBSfkfTTedhVj0fubHpJBHKwwUWX0nSbhPAfk+SG9rTX95BYNmau8rGFfCeaT6T5OW1C2A==", "dev": true }, "jsesc": { @@ -3255,14 +3303,14 @@ "dev": true }, "jsprim": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.0.tgz", - "integrity": "sha1-o7h+QCmNjDgFUtjMdiigu5WiKRg=", + "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.0.2", + "extsprintf": "1.3.0", "json-schema": "0.2.3", - "verror": "1.3.6" + "verror": "1.10.0" }, "dependencies": { "assert-plus": { @@ -3534,16 +3582,16 @@ } }, "mime-db": { - "version": "1.27.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.27.0.tgz", - "integrity": "sha1-gg9XIpa70g7CXtVeW13oaeVDbrE=" + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.29.0.tgz", + "integrity": "sha1-SNJtI1WJZRcErFkWygYAGRQmaHg=" }, "mime-types": { - "version": "2.1.15", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.15.tgz", - "integrity": "sha1-pOv1BkCUVpI3uM9wBGd20J/JKu0=", + "version": "2.1.16", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.16.tgz", + "integrity": "sha1-K4WKUuXs1RbbiXrCvodIeDBpjiM=", "requires": { - "mime-db": "1.27.0" + "mime-db": "1.29.0" } }, "mimic-fn": { @@ -3577,14 +3625,14 @@ } }, "mocha": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.4.2.tgz", - "integrity": "sha1-0O9NMyEm2/GNDWQMmzgt1IvpdZQ=", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.5.0.tgz", + "integrity": "sha512-pIU2PJjrPYvYRqVpjXzj76qltO9uBYI7woYAMoxbSefsa+vqAfptjoeevd6bUgwD0mPIO+hv9f7ltvsNreL2PA==", "dev": true, "requires": { "browser-stdout": "1.3.0", "commander": "2.9.0", - "debug": "2.6.0", + "debug": "2.6.8", "diff": "3.2.0", "escape-string-regexp": "1.0.5", "glob": "7.1.1", @@ -3604,15 +3652,6 @@ "graceful-readlink": "1.0.1" } }, - "debug": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.0.tgz", - "integrity": "sha1-vFlryr52F/Edn6FTYe3tVgi4SZs=", - "dev": true, - "requires": { - "ms": "0.7.2" - } - }, "glob": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", @@ -3633,12 +3672,6 @@ "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", "dev": true }, - "ms": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", - "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", - "dev": true - }, "supports-color": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", @@ -3682,13 +3715,12 @@ "dev": true }, "node-emoji": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.7.0.tgz", - "integrity": "sha512-dYx345sjhPJUpWaVQKjP0/43y+nTcfBRTZfSciM3ZEbRGaU/9AKaHBPf7AJ9vOKcK0W3v67AgI4m4oo02NLHhQ==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.8.1.tgz", + "integrity": "sha512-+ktMAh1Jwas+TnGodfCfjUbJKoANqPaJFN0z0iqh41eqD8dvguNzcitVSBSVK1pidz0AqGbLKcoVuVLRVZ/aVg==", "dev": true, "requires": { - "lodash.toarray": "4.4.0", - "string.prototype.codepointat": "0.2.0" + "lodash.toarray": "4.4.0" } }, "nopt": { @@ -3708,7 +3740,7 @@ "requires": { "hosted-git-info": "2.5.0", "is-builtin-module": "1.0.0", - "semver": "5.3.0", + "semver": "5.4.1", "validate-npm-package-license": "3.0.1" } }, @@ -3717,18 +3749,17 @@ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", "dev": true, - "optional": true, "requires": { "remove-trailing-separator": "1.0.2" } }, "npm-check": { - "version": "5.4.4", - "resolved": "https://registry.npmjs.org/npm-check/-/npm-check-5.4.4.tgz", - "integrity": "sha1-znVOyfPtEux0osWmvnvG8TTyKO0=", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/npm-check/-/npm-check-5.4.5.tgz", + "integrity": "sha512-UWBWfob0YxTu/yqxzDWS17gj8GMjQ0C/lKl/Fy7UZ3tQOCX8XZxmfIcKMkvBUgJaMkZjiAoRyw2CFKBgNn1SYQ==", "dev": true, "requires": { - "babel-runtime": "6.23.0", + "babel-runtime": "6.25.0", "callsite-record": "3.2.2", "chalk": "1.1.3", "co": "4.6.0", @@ -3743,12 +3774,12 @@ "meow": "3.7.0", "merge-options": "0.0.64", "minimatch": "3.0.4", - "node-emoji": "1.7.0", + "node-emoji": "1.8.1", "ora": "0.2.3", "package-json": "4.0.1", "path-exists": "2.1.0", "pkg-dir": "1.0.0", - "semver": "5.3.0", + "semver": "5.4.1", "semver-diff": "2.1.0", "text-table": "0.2.0", "throat": "2.0.2", @@ -3891,9 +3922,9 @@ } }, "nsp": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/nsp/-/nsp-2.6.3.tgz", - "integrity": "sha1-2wUDWVPNoqs6Vx7oL6uE9MsIHRc=", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/nsp/-/nsp-2.7.0.tgz", + "integrity": "sha512-OeYnX8eKRWKk/mlVeRKvwoocWN4gQlj2tVxNXHttLdasidlP34wwjOV9J9w3C/LbwyYXMb+8zDylZF/7zgyEpA==", "dev": true, "requires": { "chalk": "1.1.3", @@ -4377,6 +4408,12 @@ "object-assign": "4.1.1" } }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, "package-json": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz", @@ -4386,7 +4423,7 @@ "got": "6.7.1", "registry-auth-token": "3.3.1", "registry-url": "3.1.0", - "semver": "5.3.0" + "semver": "5.4.1" } }, "parse-glob": { @@ -4747,8 +4784,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.0.2.tgz", "integrity": "sha1-abBi2XhyetFNxrVrpKt3L9jXBRE=", - "dev": true, - "optional": true + "dev": true }, "repeat-element": { "version": "1.1.2", @@ -4789,7 +4825,7 @@ "is-typedarray": "1.0.0", "isstream": "0.1.2", "json-stringify-safe": "5.0.1", - "mime-types": "2.1.15", + "mime-types": "2.1.16", "oauth-sign": "0.8.2", "performance-now": "0.2.0", "qs": "6.4.0", @@ -4917,9 +4953,9 @@ "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" }, "semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", "dev": true }, "semver-diff": { @@ -4928,7 +4964,7 @@ "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", "dev": true, "requires": { - "semver": "5.3.0" + "semver": "5.4.1" } }, "set-blocking": { @@ -4944,6 +4980,21 @@ "dev": true, "optional": true }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "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=", + "dev": true + }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", @@ -5061,9 +5112,9 @@ } }, "string-width": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.0.tgz", - "integrity": "sha1-AwZkVh/BRslCPsfZeP4kV0N/5tA=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { "is-fullwidth-code-point": "2.0.0", @@ -5087,12 +5138,6 @@ } } }, - "string.prototype.codepointat": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/string.prototype.codepointat/-/string.prototype.codepointat-0.2.0.tgz", - "integrity": "sha1-aybpvTr8qnvjtCabUm3huCAArHg=", - "dev": true - }, "stringstream": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", @@ -5154,31 +5199,47 @@ "chalk": "1.1.3", "lodash": "4.17.4", "slice-ansi": "0.0.4", - "string-width": "2.1.0" + "string-width": "2.1.1" } }, "term-size": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/term-size/-/term-size-0.1.1.tgz", - "integrity": "sha1-hzYLljlsq1dgljcUzaDQy+7K2co=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", + "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", "dev": true, "requires": { - "execa": "0.4.0" + "execa": "0.7.0" }, "dependencies": { "execa": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.4.0.tgz", - "integrity": "sha1-TrZGejaglfq7KXD/nV4/t7zm68M=", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", "dev": true, "requires": { - "cross-spawn-async": "2.2.5", + "cross-spawn": "5.1.0", + "get-stream": "3.0.0", "is-stream": "1.1.0", - "npm-run-path": "1.0.0", - "object-assign": "4.1.1", - "path-key": "1.0.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", "strip-eof": "1.0.0" } + }, + "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=", + "dev": true, + "requires": { + "path-key": "2.0.1" + } + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true } } }, @@ -5322,9 +5383,9 @@ "integrity": "sha1-G1g3z5DAc22IYncytmHBOPht5y8=", "dev": true, "requires": { - "boxen": "1.1.0", + "boxen": "1.2.1", "chalk": "1.1.3", - "configstore": "3.1.0", + "configstore": "3.1.1", "import-lazy": "2.1.0", "is-npm": "1.0.0", "latest-version": "3.1.0", @@ -5378,11 +5439,20 @@ } }, "verror": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz", - "integrity": "sha1-z/XfEpRtKX0rqu+qJoniW+AcAFw=", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "requires": { - "extsprintf": "1.0.2" + "assert-plus": "1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "1.3.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + } } }, "walkdir": { @@ -5392,9 +5462,9 @@ "dev": true }, "which": { - "version": "1.2.14", - "resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz", - "integrity": "sha1-mofEN48D6CfOyvGs31bHNsAcFOU=", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", "dev": true, "requires": { "isexe": "2.0.0" diff --git a/package.json b/package.json index 240cb37..1ac93d5 100644 --- a/package.json +++ b/package.json @@ -36,18 +36,18 @@ "babel-cli": "6.24.1", "babel-eslint": "7.2.3", "babel-preset-flow": "6.23.0", - "chai": "4.0.2", + "chai": "4.1.1", "chai-as-promised": "7.1.1", "coveralls": "2.13.1", - "eslint": "4.2.0", + "eslint": "4.4.1", "eslint-config-sumitgoelpw": "1.0.6", - "eslint-plugin-flowtype": "2.34.1", - "flow-bin": "0.49.1", + "eslint-plugin-flowtype": "2.35.0", + "flow-bin": "0.52.0", "istanbul": "0.4.5", - "mocha": "3.4.2", + "mocha": "3.5.0", "mocha-lcov-reporter": "1.3.0", - "npm-check": "5.4.4", - "nsp": "2.6.3" + "npm-check": "5.4.5", + "nsp": "2.7.0" }, "eslintConfig": { "extends": [ From 4470e706c3a97c0fb9226303eefe09e9cb06b8c3 Mon Sep 17 00:00:00 2001 From: Sumit Goel Date: Mon, 14 Aug 2017 12:55:19 -0700 Subject: [PATCH 05/18] export host port for ssl and nginx ssl directory --- tasks/test.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tasks/test.sh b/tasks/test.sh index ab25541..fc785ae 100644 --- a/tasks/test.sh +++ b/tasks/test.sh @@ -4,9 +4,22 @@ set -ev export PATH="./node_modules/.bin:$PATH" +DIR=$(pwd) + +# Uncomment the below lines to regenerate the self signed certificates +# +# cd "$DIR"/tasks/ssl +# rm -f ./* +# openssl req -out ssl.csr -new -newkey rsa:2048 -nodes -keyout ssl.key -subj "/C=US/ST=California/L=San Francisco/O=sumitgoelpw/OU=zabbix-promise/CN=zabbix-web.local/emailAddress=email@example.com" +# openssl x509 -req -sha256 -days 365 -in ssl.csr -signkey ssl.key -out ssl.crt +# openssl dhparam -out dhparam.pem 2048 +# cd "$DIR" + export DBUSER='postgres' export DBPASS='postgres' export HOSTPORT='8080' +export HOSTPORTSSL='8443' +export NGINXDIRSSL="$DIR/tasks/ssl" # linting check eslint . From 9c51b0b32b7ba976ee2de13376be5bba1932424c Mon Sep 17 00:00:00 2001 From: Sumit Goel Date: Mon, 14 Aug 2017 12:57:04 -0700 Subject: [PATCH 06/18] change url from http to https and add request option rejectUnauthorized --- test/host.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/host.js b/test/host.js index 7b90047..7a99f77 100644 --- a/test/host.js +++ b/test/host.js @@ -4,9 +4,9 @@ const Zabbix = require('../index'); const {expect} = chai; const zabbix = new Zabbix( - 'http://127.0.0.1:8080/api_jsonrpc.php', + 'https://127.0.0.1:8443/api_jsonrpc.php', 'Admin', - 'zabbix' + 'zabbix', {'rejectUnauthorized': false} ); chai.use(chaiAsPromised); From 4864b294021e5b9232b8c1925d6ebc4e26bd421c Mon Sep 17 00:00:00 2001 From: Sumit Goel Date: Mon, 14 Aug 2017 12:59:15 -0700 Subject: [PATCH 07/18] replace rejectUnauthorized with options object; can be passed to request --- lib/wrapper.js | 3 +-- src/wrapper.js | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/wrapper.js b/lib/wrapper.js index cb0d41a..c544a96 100644 --- a/lib/wrapper.js +++ b/lib/wrapper.js @@ -16,7 +16,6 @@ module.exports = { 'uri': opts.uri, 'json': true, 'gzip': true, - 'rejectUnauthorized': opts.rejectUnauthorized, 'simple': false, 'resolveWithFullResponse': true, 'body': { @@ -28,6 +27,6 @@ module.exports = { } }; - return rp.post(options); + return rp.post(Object.assign(options, opts.options)); } }; \ No newline at end of file diff --git a/src/wrapper.js b/src/wrapper.js index e4f7f46..ea75024 100644 --- a/src/wrapper.js +++ b/src/wrapper.js @@ -13,7 +13,7 @@ module.exports = { */ 'post': (opts: {| uri: string, - rejectUnauthorized: boolean, + options: {}, id: number, auth: string | null, method: string, @@ -25,7 +25,6 @@ module.exports = { 'uri': opts.uri, 'json': true, 'gzip': true, - 'rejectUnauthorized': opts.rejectUnauthorized, 'simple': false, 'resolveWithFullResponse': true, 'body': { @@ -37,7 +36,7 @@ module.exports = { } }; - return rp.post(options); + return rp.post(Object.assign(options, opts.options)); } }; From 299e17da2959fee0ca80711bc0531772377f41e7 Mon Sep 17 00:00:00 2001 From: Sumit Goel Date: Mon, 14 Aug 2017 13:00:01 -0700 Subject: [PATCH 08/18] replace rejectUnauthorized with options object; can be passed to request --- lib/api.js | 9 +++++---- src/api.js | 12 ++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/api.js b/lib/api.js index d4a54d9..41ef0ac 100644 --- a/lib/api.js +++ b/lib/api.js @@ -10,14 +10,15 @@ class Zabbix { * @param {string} url - Zabbix API endpoint. * @param {string} user - login name. * @param {string} password - login password. - * @param {boolean} rejectUnauthorized - Use false for cert verification. + * @param {Object} options - specify request options. + * Link: https://github.com/request/request#requestoptions-callback */ - constructor(url, user, password, rejectUnauthorized = true) { + constructor(url, user, password, options = {}) { this.url = url; this.user = user; this.password = password; - this.rejectUnauthorized = rejectUnauthorized; + this.options = options; this.rpcid = 0; this.authid = null; } // eslint: constructor @@ -44,7 +45,7 @@ class Zabbix { 'id': this.rpcid += 1, 'uri': this.url, 'auth': this.authid, - 'rejectUnauthorized': this.rejectUnauthorized, + 'options': this.options, method, params }; diff --git a/src/api.js b/src/api.js index 317874c..83b6949 100644 --- a/src/api.js +++ b/src/api.js @@ -9,7 +9,7 @@ class Zabbix { url: string user: string password: string - rejectUnauthorized: boolean + options: {} rpcid: number authid: string | null @@ -19,15 +19,15 @@ class Zabbix { * @param {string} url - Zabbix API endpoint. * @param {string} user - login name. * @param {string} password - login password. - * @param {boolean} rejectUnauthorized - Use false for cert verification. + * @param {Object} options - specify request options. + * Link: https://github.com/request/request#requestoptions-callback */ - constructor (url: string, user: string, password: string, - rejectUnauthorized: boolean = true) { + constructor (url: string, user: string, password: string, options: {} = {}) { this.url = url; this.user = user; this.password = password; - this.rejectUnauthorized = rejectUnauthorized; + this.options = options; this.rpcid = 0; this.authid = null; @@ -61,7 +61,7 @@ class Zabbix { 'id': this.rpcid += 1, 'uri': this.url, 'auth': this.authid, - 'rejectUnauthorized': this.rejectUnauthorized, + 'options': this.options, method, params }; From e2c7d2687e4812067670b9197b31ef4235e7c306 Mon Sep 17 00:00:00 2001 From: Sumit Goel Date: Mon, 4 Sep 2017 13:37:47 -0700 Subject: [PATCH 09/18] add ability to supress flow errors --- .flowconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/.flowconfig b/.flowconfig index 4a58bdc..cf602f9 100644 --- a/.flowconfig +++ b/.flowconfig @@ -5,3 +5,4 @@ [libs] [options] +suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe From d96f6a25a6cffbd9dd0d881c51e3689ed42a394d Mon Sep 17 00:00:00 2001 From: Sumit Goel Date: Mon, 4 Sep 2017 13:38:14 -0700 Subject: [PATCH 10/18] add debug and update dependencies --- package-lock.json | 509 ++++++++++++++++++++++++++-------------------- package.json | 11 +- 2 files changed, 299 insertions(+), 221 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4c3e918..8a71359 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,9 +11,9 @@ "dev": true }, "acorn": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.1.1.tgz", - "integrity": "sha512-vOk6uEMctu0vQrvuSqFdJyqj1Q0S5VTDL79qtjo+DhRr+1mmaD+tluFSCZqhvi/JUhXSzoZN2BhtstaPEeE8cw==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.1.2.tgz", + "integrity": "sha512-o96FZLJBPY1lvTuJylGA9Bk3t/GKPPJG8H0ydQQl01crzwJgspa4AEIq/pVTXigmK0PHVQhiAtn8WMBLL9D2WA==", "dev": true }, "acorn-jsx": { @@ -208,15 +208,15 @@ "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=" }, "babel-cli": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-cli/-/babel-cli-6.24.1.tgz", - "integrity": "sha1-IHzXBbumFImy6kG1MSNBz2rKIoM=", + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-cli/-/babel-cli-6.26.0.tgz", + "integrity": "sha1-UCq1SHTX24itALiHoGODzgPQAvE=", "dev": true, "requires": { - "babel-core": "6.25.0", - "babel-polyfill": "6.23.0", - "babel-register": "6.24.1", - "babel-runtime": "6.25.0", + "babel-core": "6.26.0", + "babel-polyfill": "6.26.0", + "babel-register": "6.26.0", + "babel-runtime": "6.26.0", "chokidar": "1.7.0", "commander": "2.11.0", "convert-source-map": "1.5.0", @@ -226,14 +226,14 @@ "output-file-sync": "1.1.2", "path-is-absolute": "1.0.1", "slash": "1.0.0", - "source-map": "0.5.6", + "source-map": "0.5.7", "v8flags": "2.1.1" } }, "babel-code-frame": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.22.0.tgz", - "integrity": "sha1-AnYgvuVnqIwyVhV05/0IAdMxGOQ=", + "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", @@ -242,21 +242,21 @@ } }, "babel-core": { - "version": "6.25.0", - "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.25.0.tgz", - "integrity": "sha1-fdQrBGPHQunVKW3rPsZ6kyLa1yk=", + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.0.tgz", + "integrity": "sha1-rzL3izGm/O8RnIew/Y2XU/A6C7g=", "dev": true, "requires": { - "babel-code-frame": "6.22.0", - "babel-generator": "6.25.0", + "babel-code-frame": "6.26.0", + "babel-generator": "6.26.0", "babel-helpers": "6.24.1", "babel-messages": "6.23.0", - "babel-register": "6.24.1", - "babel-runtime": "6.25.0", - "babel-template": "6.25.0", - "babel-traverse": "6.25.0", - "babel-types": "6.25.0", - "babylon": "6.17.4", + "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.0", "debug": "2.6.8", "json5": "0.5.1", @@ -265,7 +265,18 @@ "path-is-absolute": "1.0.1", "private": "0.1.7", "slash": "1.0.0", - "source-map": "0.5.6" + "source-map": "0.5.7" + }, + "dependencies": { + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } } }, "babel-eslint": { @@ -274,25 +285,25 @@ "integrity": "sha1-sv4tgBJkcPXBlELcdXJTqJdxCCc=", "dev": true, "requires": { - "babel-code-frame": "6.22.0", - "babel-traverse": "6.25.0", - "babel-types": "6.25.0", - "babylon": "6.17.4" + "babel-code-frame": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0" } }, "babel-generator": { - "version": "6.25.0", - "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.25.0.tgz", - "integrity": "sha1-M6GvcNXyiQrrRlpKd5PB32qeqfw=", + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.0.tgz", + "integrity": "sha1-rBriAHC3n248odMmlhMFN3TyDcU=", "dev": true, "requires": { "babel-messages": "6.23.0", - "babel-runtime": "6.25.0", - "babel-types": "6.25.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.6", + "source-map": "0.5.7", "trim-right": "1.0.1" } }, @@ -302,8 +313,8 @@ "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", "dev": true, "requires": { - "babel-runtime": "6.25.0", - "babel-template": "6.25.0" + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" } }, "babel-messages": { @@ -312,7 +323,7 @@ "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", "dev": true, "requires": { - "babel-runtime": "6.25.0" + "babel-runtime": "6.26.0" } }, "babel-plugin-syntax-flow": { @@ -328,18 +339,26 @@ "dev": true, "requires": { "babel-plugin-syntax-flow": "6.18.0", - "babel-runtime": "6.25.0" + "babel-runtime": "6.26.0" } }, "babel-polyfill": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.23.0.tgz", - "integrity": "sha1-g2TKYt+Or7gwSZ9pkXdGbDsDSZ0=", + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", + "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", "dev": true, "requires": { - "babel-runtime": "6.25.0", - "core-js": "2.5.0", + "babel-runtime": "6.26.0", + "core-js": "2.5.1", "regenerator-runtime": "0.10.5" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", + "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", + "dev": true + } } }, "babel-preset-flow": { @@ -352,76 +371,87 @@ } }, "babel-register": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.24.1.tgz", - "integrity": "sha1-fhDhOi9xBlvfrVoXh7pFvKbe118=", + "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.25.0", - "babel-runtime": "6.25.0", - "core-js": "2.5.0", + "babel-core": "6.26.0", + "babel-runtime": "6.26.0", + "core-js": "2.5.1", "home-or-tmp": "2.0.0", "lodash": "4.17.4", "mkdirp": "0.5.1", - "source-map-support": "0.4.15" + "source-map-support": "0.4.17" } }, "babel-runtime": { - "version": "6.25.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.25.0.tgz", - "integrity": "sha1-M7mOql1IK7AajRqmtDetKwGuxBw=", + "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.5.0", - "regenerator-runtime": "0.10.5" + "core-js": "2.5.1", + "regenerator-runtime": "0.11.0" } }, "babel-template": { - "version": "6.25.0", - "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.25.0.tgz", - "integrity": "sha1-ZlJBFmt8KqTGGdceGSlpVSsQwHE=", + "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.25.0", - "babel-traverse": "6.25.0", - "babel-types": "6.25.0", - "babylon": "6.17.4", + "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.25.0", - "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.25.0.tgz", - "integrity": "sha1-IldJfi/NGbie3BPEyROB+VEklvE=", + "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.22.0", + "babel-code-frame": "6.26.0", "babel-messages": "6.23.0", - "babel-runtime": "6.25.0", - "babel-types": "6.25.0", - "babylon": "6.17.4", + "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.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } } }, "babel-types": { - "version": "6.25.0", - "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.25.0.tgz", - "integrity": "sha1-cK+ySNVmDl0Y+BHZHIMDtUE0oY4=", + "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.25.0", + "babel-runtime": "6.26.0", "esutils": "2.0.2", "lodash": "4.17.4", "to-fast-properties": "1.0.3" } }, "babylon": { - "version": "6.17.4", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.17.4.tgz", - "integrity": "sha512-kChlV+0SXkjE0vUn9OZ7pBMWRFd8uq3mZe8x1K6jhuNcAFAtEnjchFAqB+dYEXKyd+JpT6eppRR78QAr5gTsUw==", + "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": { @@ -440,9 +470,9 @@ } }, "binary-extensions": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.9.0.tgz", - "integrity": "sha1-ZlBsFs5vTWkopbPNajPKQelB43s=", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.10.0.tgz", + "integrity": "sha1-muuabF6IY4qtFx4Wf1kAq+JINdA=", "dev": true, "optional": true }, @@ -492,13 +522,13 @@ "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.2.1" + "supports-color": "4.4.0" } }, "supports-color": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.2.1.tgz", - "integrity": "sha512-qxzYsob3yv6U+xMzPrv170y8AwGP7i74g+pbixCfD6rgso8BscLT2qXIuz6TpOaiJZ3mFgT5O9lyT9nMU4LfaA==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", + "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", "dev": true, "requires": { "has-flag": "2.0.0" @@ -623,14 +653,14 @@ } }, "chai": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.1.1.tgz", - "integrity": "sha1-ZuISeebzxkFf+CMYeCJ5AOIXGzk=", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.1.2.tgz", + "integrity": "sha1-D2RYS6ZC8PKs4oBiefTwbKI61zw=", "dev": true, "requires": { "assertion-error": "1.0.2", "check-error": "1.0.2", - "deep-eql": "2.0.2", + "deep-eql": "3.0.0", "get-func-name": "2.0.0", "pathval": "1.1.0", "type-detect": "4.0.3" @@ -683,9 +713,9 @@ } }, "ci-info": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.0.0.tgz", - "integrity": "sha1-3FKF8rTiUYIWg2gcOBwziPRuxTQ=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.0.1.tgz", + "integrity": "sha512-u+kVhyCfR37aSKEneBwRcsff8tCLIyBvngsqL/fgOoWJsBhSFVVRaXWUI3HuAQKu8cLawFFRxNxpDUktZUXScw==", "dev": true }, "circular-json": { @@ -716,9 +746,9 @@ "dev": true }, "cli-width": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.1.0.tgz", - "integrity": "sha1-sjTKIJsp72b8UY2bmNWEewDt8Ao=", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", "dev": true }, "cliui": { @@ -809,7 +839,7 @@ "graceful-fs": "4.1.11", "make-dir": "1.0.0", "unique-string": "1.0.0", - "write-file-atomic": "2.1.0", + "write-file-atomic": "2.3.0", "xdg-basedir": "3.0.0" } }, @@ -820,9 +850,9 @@ "dev": true }, "core-js": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.0.tgz", - "integrity": "sha1-VpwFCRi+ZIazg3VSAorgRmtxcIY=", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.1.tgz", + "integrity": "sha1-rmh03GaTd4m4B1T/VCjfZoGcpQs=", "dev": true }, "core-util-is": { @@ -857,7 +887,7 @@ "requires": { "chalk": "1.1.3", "commander": "2.11.0", - "is-my-json-valid": "2.16.0", + "is-my-json-valid": "2.16.1", "pinkie-promise": "2.0.1" } }, @@ -892,7 +922,7 @@ "is-typedarray": "1.0.0", "isstream": "0.1.2", "json-stringify-safe": "5.0.1", - "mime-types": "2.1.16", + "mime-types": "2.1.17", "oauth-sign": "0.8.2", "qs": "6.3.2", "stringstream": "0.0.5", @@ -978,10 +1008,9 @@ } }, "debug": { - "version": "2.6.8", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", - "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", - "dev": true, + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.0.1.tgz", + "integrity": "sha512-6nVc6S36qbt/mutyt+UGMnawAMrPDZUPQjRZI3FS9tCtDRhvxJbK79unYBLPi+z5SLXQ3ftoVBFCblQtNSls8w==", "requires": { "ms": "2.0.0" } @@ -993,20 +1022,12 @@ "dev": true }, "deep-eql": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-2.0.2.tgz", - "integrity": "sha1-sbrAblbwp2d3aG1Qyf63XC7XZ5o=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.0.tgz", + "integrity": "sha512-9zef2MtjASSE1Pts2Nm6Yh5MTVdVh+s4Qt/e+jPV6qTBhqTc0WOEaWnLvLKGxky0gwZGmcY6TnUqyCD6fNs5Lg==", "dev": true, "requires": { - "type-detect": "3.0.0" - }, - "dependencies": { - "type-detect": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-3.0.0.tgz", - "integrity": "sha1-RtDMhVOrt7E6NSsNbeov1Y8tm1U=", - "dev": true - } + "type-detect": "4.0.3" } }, "deep-extend": { @@ -1047,8 +1068,8 @@ "integrity": "sha1-az0emTkx4J7mc9NQfTF123NII+Y=", "dev": true, "requires": { - "babel-traverse": "6.25.0", - "babylon": "6.17.4", + "babel-traverse": "6.26.0", + "babylon": "6.18.0", "builtin-modules": "1.1.1", "deprecate": "1.0.0", "deps-regex": "0.1.4", @@ -1237,14 +1258,14 @@ } }, "eslint": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.4.1.tgz", - "integrity": "sha1-mc1+r8/8ov+Zpcj18qR01jZLS9M=", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.6.1.tgz", + "integrity": "sha1-3cf8f9cL+TIFsLNEm7FqHp59SVA=", "dev": true, "requires": { "ajv": "5.2.2", - "babel-code-frame": "6.22.0", - "chalk": "1.1.3", + "babel-code-frame": "6.26.0", + "chalk": "2.1.0", "concat-stream": "1.6.0", "cross-spawn": "5.1.0", "debug": "2.6.8", @@ -1258,9 +1279,9 @@ "functional-red-black-tree": "1.0.1", "glob": "7.1.2", "globals": "9.18.0", - "ignore": "3.3.3", + "ignore": "3.3.5", "imurmurhash": "0.1.4", - "inquirer": "3.2.1", + "inquirer": "3.2.3", "is-resolvable": "1.0.0", "js-yaml": "3.9.1", "json-stable-stringify": "1.0.1", @@ -1275,6 +1296,7 @@ "progress": "2.0.0", "require-uncached": "1.0.3", "semver": "5.4.1", + "strip-ansi": "4.0.0", "strip-json-comments": "2.0.1", "table": "4.0.1", "text-table": "0.2.0" @@ -1292,6 +1314,41 @@ "json-stable-stringify": "1.0.1" } }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.0" + } + }, + "chalk": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", + "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.4.0" + } + }, + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "esprima": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", @@ -1307,6 +1364,24 @@ "argparse": "1.0.9", "esprima": "4.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" + } + }, + "supports-color": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", + "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } } } }, @@ -1316,13 +1391,13 @@ "integrity": "sha512-7Kr71WRD54h0FQ3L8yy01F/zXt4sEynv3k/paz6tuXViR72xZoEooh0nW1Na8m3DFdpiKhIcSfTmRYIV9HzhBA==", "dev": true, "requires": { - "eslint": "4.4.1" + "eslint": "4.6.1" } }, "eslint-plugin-flowtype": { - "version": "2.35.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.35.0.tgz", - "integrity": "sha512-zjXGjOsHds8b84C0Ad3VViKh+sUA9PeXKHwPRlSLwwSX0v1iUJf/6IX7wxc+w2T2tnDH8PT6B/YgtcEuNI3ssA==", + "version": "2.35.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.35.1.tgz", + "integrity": "sha512-YTCeVsMOi3ga8PJjdAV97FaTNXNknzrO+4ZDMHJN65i4uMjL5KgfgQZpyVsBirWOfgXMKRduxpsyM64K/0LbXw==", "dev": true, "requires": { "lodash": "4.17.4" @@ -1344,7 +1419,7 @@ "integrity": "sha1-mDWGJb3QVYYeon4oZ+pyn69GPY0=", "dev": true, "requires": { - "acorn": "5.1.1", + "acorn": "5.1.2", "acorn-jsx": "3.0.1" } }, @@ -1530,9 +1605,9 @@ } }, "flow-bin": { - "version": "0.52.0", - "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.52.0.tgz", - "integrity": "sha1-ttmr6LzR7lxi3zhkUaTiVTytw6M=", + "version": "0.54.0", + "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.54.0.tgz", + "integrity": "sha1-8vsEeOnplwK2I8nthAeaOZA7unc=", "dev": true }, "for-in": { @@ -1564,7 +1639,7 @@ "requires": { "asynckit": "0.4.0", "combined-stream": "1.0.5", - "mime-types": "2.1.16" + "mime-types": "2.1.17" } }, "fs-readdir-recursive": { @@ -1586,7 +1661,7 @@ "dev": true, "optional": true, "requires": { - "nan": "2.6.2", + "nan": "2.7.0", "node-pre-gyp": "0.6.36" }, "dependencies": { @@ -2348,14 +2423,6 @@ } } }, - "string_decoder": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "5.0.1" - } - }, "string-width": { "version": "1.0.2", "bundled": true, @@ -2366,6 +2433,14 @@ "strip-ansi": "3.0.1" } }, + "string_decoder": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, "stringstream": { "version": "0.0.5", "bundled": true, @@ -2778,9 +2853,9 @@ "dev": true }, "ignore": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.3.tgz", - "integrity": "sha1-QyNS5XrM2HqzEQ6C0/6g5HgSFW0=", + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.5.tgz", + "integrity": "sha512-JLH93mL8amZQhh/p6mfQgVBH3M6epNq3DfsXsTSuSrInVjwyYlFE1nv2AgfRCC8PoOhM0jwQ5v8s9LgbK7yGDw==", "dev": true }, "import-lazy": { @@ -2827,15 +2902,15 @@ "dev": true }, "inquirer": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.2.1.tgz", - "integrity": "sha512-QgW3eiPN8gpj/K5vVpHADJJgrrF0ho/dZGylikGX7iqAdRgC9FVKYKWFLx6hZDBFcOLEoSqINYrVPeFAeG/PdA==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.2.3.tgz", + "integrity": "sha512-Bc3KbimpDTOeQdDj18Ir/rlsGuhBSSNqdOnxaAuKhpkdnMMuKsEGbZD2v5KFF9oso2OU+BPh7+/u5obmFDRmWw==", "dev": true, "requires": { "ansi-escapes": "2.0.0", "chalk": "2.1.0", "cli-cursor": "2.1.0", - "cli-width": "2.1.0", + "cli-width": "2.2.0", "external-editor": "2.0.4", "figures": "2.0.0", "lodash": "4.17.4", @@ -2871,7 +2946,7 @@ "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.2.1" + "supports-color": "4.4.0" } }, "strip-ansi": { @@ -2884,9 +2959,9 @@ } }, "supports-color": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.2.1.tgz", - "integrity": "sha512-qxzYsob3yv6U+xMzPrv170y8AwGP7i74g+pbixCfD6rgso8BscLT2qXIuz6TpOaiJZ3mFgT5O9lyT9nMU4LfaA==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", + "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", "dev": true, "requires": { "has-flag": "2.0.0" @@ -2922,7 +2997,7 @@ "dev": true, "optional": true, "requires": { - "binary-extensions": "1.9.0" + "binary-extensions": "1.10.0" } }, "is-buffer": { @@ -2946,7 +3021,7 @@ "integrity": "sha1-9zkzayYyNlBhqdSCcM1WrjNpMY4=", "dev": true, "requires": { - "ci-info": "1.0.0" + "ci-info": "1.0.1" } }, "is-dotfile": { @@ -3010,9 +3085,9 @@ } }, "is-my-json-valid": { - "version": "2.16.0", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz", - "integrity": "sha1-8Hndm/2uZe4gOKrorLyGqxCeNpM=", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.1.tgz", + "integrity": "sha512-ochPsqWS1WXj8ZnMIV0vnNXooaMhp7cyL4FMSIPKTtnV0Ha/T19G2b9kkhcNsabV9bxYkze7/aLZJb/bYuFduQ==", "dev": true, "requires": { "generate-function": "2.0.0", @@ -3084,7 +3159,8 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "dev": true + "dev": true, + "optional": true }, "is-promise": { "version": "2.1.0", @@ -3578,20 +3654,20 @@ "normalize-path": "2.1.1", "object.omit": "2.0.1", "parse-glob": "3.0.4", - "regex-cache": "0.4.3" + "regex-cache": "0.4.4" } }, "mime-db": { - "version": "1.29.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.29.0.tgz", - "integrity": "sha1-SNJtI1WJZRcErFkWygYAGRQmaHg=" + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", + "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=" }, "mime-types": { - "version": "2.1.16", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.16.tgz", - "integrity": "sha1-K4WKUuXs1RbbiXrCvodIeDBpjiM=", + "version": "2.1.17", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", + "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", "requires": { - "mime-db": "1.29.0" + "mime-db": "1.30.0" } }, "mimic-fn": { @@ -3652,6 +3728,15 @@ "graceful-readlink": "1.0.1" } }, + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "glob": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", @@ -3692,8 +3777,7 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, "mute-stream": { "version": "0.0.7", @@ -3702,9 +3786,9 @@ "dev": true }, "nan": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.6.2.tgz", - "integrity": "sha1-5P805slf37WuzAjeZZb0NgWn20U=", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.7.0.tgz", + "integrity": "sha1-2Vv3IeyHfgjbJ27T/G63j5CDrUY=", "dev": true, "optional": true }, @@ -3750,7 +3834,7 @@ "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", "dev": true, "requires": { - "remove-trailing-separator": "1.0.2" + "remove-trailing-separator": "1.1.0" } }, "npm-check": { @@ -3759,7 +3843,7 @@ "integrity": "sha512-UWBWfob0YxTu/yqxzDWS17gj8GMjQ0C/lKl/Fy7UZ3tQOCX8XZxmfIcKMkvBUgJaMkZjiAoRyw2CFKBgNn1SYQ==", "dev": true, "requires": { - "babel-runtime": "6.25.0", + "babel-runtime": "6.26.0", "callsite-record": "3.2.2", "chalk": "1.1.3", "co": "4.6.0", @@ -3848,7 +3932,7 @@ "ansi-regex": "2.1.1", "chalk": "1.1.3", "cli-cursor": "1.0.2", - "cli-width": "2.1.0", + "cli-width": "2.2.0", "figures": "1.7.0", "lodash": "4.17.4", "readline2": "1.0.1", @@ -4745,20 +4829,19 @@ } }, "regenerator-runtime": { - "version": "0.10.5", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", - "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz", + "integrity": "sha512-/aA0kLeRb5N9K0d4fw7ooEbI+xDe+DKD499EQqygGqeS8N3xto15p09uY2xj7ixP81sNPXvRLnAQIqdVStgb1A==", "dev": true }, "regex-cache": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz", - "integrity": "sha1-mxpsNdTQ3871cRrmUejp09cRQUU=", + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", "dev": true, "optional": true, "requires": { - "is-equal-shallow": "0.1.3", - "is-primitive": "2.0.0" + "is-equal-shallow": "0.1.3" } }, "registry-auth-token": { @@ -4781,9 +4864,9 @@ } }, "remove-trailing-separator": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.0.2.tgz", - "integrity": "sha1-abBi2XhyetFNxrVrpKt3L9jXBRE=", + "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": { @@ -4825,7 +4908,7 @@ "is-typedarray": "1.0.0", "isstream": "0.1.2", "json-stringify-safe": "5.0.1", - "mime-types": "2.1.16", + "mime-types": "2.1.17", "oauth-sign": "0.8.2", "performance-now": "0.2.0", "qs": "6.4.0", @@ -5013,12 +5096,6 @@ "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", "dev": true }, - "slide": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", - "dev": true - }, "sntp": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", @@ -5028,18 +5105,18 @@ } }, "source-map": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", - "integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=", + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, "source-map-support": { - "version": "0.4.15", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.15.tgz", - "integrity": "sha1-AyAt9lwG0r2MfsI2KhkwVv7407E=", + "version": "0.4.17", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.17.tgz", + "integrity": "sha512-30c1Ch8FSjV0FwC253iftbbj0dU/OXoSg1LAEGZJUlGgjTNj6cu+DVqJWWIZJY5RXLWV4eFtR+4ouo0VIOYOTg==", "dev": true, "requires": { - "source-map": "0.5.6" + "source-map": "0.5.7" } }, "spdx-correct": { @@ -5102,15 +5179,6 @@ "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=" }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "dev": true, - "requires": { - "safe-buffer": "5.1.1" - } - }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -5138,6 +5206,15 @@ } } }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, "stringstream": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", @@ -5350,7 +5427,7 @@ "dev": true, "optional": true, "requires": { - "source-map": "0.5.6", + "source-map": "0.5.7", "uglify-to-browserify": "1.0.2", "yargs": "3.10.0" } @@ -5568,14 +5645,14 @@ } }, "write-file-atomic": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.1.0.tgz", - "integrity": "sha512-0TZ20a+xcIl4u0+Mj5xDH2yOWdmQiXlKf9Hm+TgDXjTMsEYb+gDrmb8e8UNAzMCitX8NBqG4Z/FUQIyzv/R1JQ==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", + "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", "dev": true, "requires": { "graceful-fs": "4.1.11", "imurmurhash": "0.1.4", - "slide": "1.1.6" + "signal-exit": "3.0.2" } }, "xdg-basedir": { diff --git a/package.json b/package.json index 1ac93d5..fade896 100644 --- a/package.json +++ b/package.json @@ -29,20 +29,21 @@ }, "homepage": "https://github.com/sumitgoelpw/zabbix-promise#readme", "dependencies": { + "debug": "3.0.1", "request": "2.81.0", "request-promise-native": "1.0.4" }, "devDependencies": { - "babel-cli": "6.24.1", + "babel-cli": "6.26.0", "babel-eslint": "7.2.3", "babel-preset-flow": "6.23.0", - "chai": "4.1.1", + "chai": "4.1.2", "chai-as-promised": "7.1.1", "coveralls": "2.13.1", - "eslint": "4.4.1", + "eslint": "4.6.1", "eslint-config-sumitgoelpw": "1.0.6", - "eslint-plugin-flowtype": "2.35.0", - "flow-bin": "0.52.0", + "eslint-plugin-flowtype": "2.35.1", + "flow-bin": "0.54.0", "istanbul": "0.4.5", "mocha": "3.5.0", "mocha-lcov-reporter": "1.3.0", From 95a98932a8812a4fd4d561f09cf49c6f833a2916 Mon Sep 17 00:00:00 2001 From: Sumit Goel Date: Mon, 4 Sep 2017 13:47:04 -0700 Subject: [PATCH 11/18] first commit --- examples/sendValues.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 examples/sendValues.js diff --git a/examples/sendValues.js b/examples/sendValues.js new file mode 100644 index 0000000..82733be --- /dev/null +++ b/examples/sendValues.js @@ -0,0 +1,10 @@ +const zabbix = require('../index'); + +zabbix.sender({ + 'path': '/usr/local/bin/zabbix_sender', + 'server': 'zabbix-dev', + 'host': 'CloudGenix-Events', + 'values': '- testing 444\n- testing 111\n' +}) + .then((value) => console.log(value)) + .catch((reason) => console.log(reason)); From 79609d4b8026e961f35de77186794f9859a42ce7 Mon Sep 17 00:00:00 2001 From: Sumit Goel Date: Mon, 4 Sep 2017 13:47:46 -0700 Subject: [PATCH 12/18] linting correction --- examples/createHost.js | 3 +-- examples/getEvents.js | 3 +-- examples/getHost.js | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/examples/createHost.js b/examples/createHost.js index 6792261..eafc839 100644 --- a/examples/createHost.js +++ b/examples/createHost.js @@ -27,5 +27,4 @@ zabbix.login() .then((value) => console.log(JSON.stringify(value, null, whiteSpaceCount))) .then(() => zabbix.logout()) .catch((reason) => - console.log(JSON.stringify(reason, null, whiteSpaceCount)) - ); + console.log(JSON.stringify(reason, null, whiteSpaceCount))); diff --git a/examples/getEvents.js b/examples/getEvents.js index 9d31a36..8f9af09 100644 --- a/examples/getEvents.js +++ b/examples/getEvents.js @@ -41,5 +41,4 @@ zabbix.login() }) .then(() => zabbix.logout()) .catch((reason) => - console.log(JSON.stringify(reason, null, whiteSpaceCount)) - ); + console.log(JSON.stringify(reason, null, whiteSpaceCount))); diff --git a/examples/getHost.js b/examples/getHost.js index 76c89e0..9baf44b 100644 --- a/examples/getHost.js +++ b/examples/getHost.js @@ -18,5 +18,4 @@ zabbix.login() .then((value) => console.log(JSON.stringify(value, null, whiteSpaceCount))) .then(() => zabbix.logout()) .catch((reason) => - console.log(JSON.stringify(reason, null, whiteSpaceCount)) - ); + console.log(JSON.stringify(reason, null, whiteSpaceCount))); From 91bc63c4a6a0b59824c567934059030978e6e7ff Mon Sep 17 00:00:00 2001 From: Sumit Goel Date: Mon, 4 Sep 2017 13:48:38 -0700 Subject: [PATCH 13/18] linting correction --- test/host.js | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/test/host.js b/test/host.js index 7a99f77..4d07729 100644 --- a/test/host.js +++ b/test/host.js @@ -62,12 +62,12 @@ describe('host actions:', () => { }); - it(`update host ${hosts[0].name}`, () => expect( - zabbix.request('host.update', { - 'hostid': hosts[0].id, - 'templates': [{'templateid': hosts[0].tid}], - 'inventory_mode': 1 - })).to.be.fulfilled.and.to.eventually.be.an('Object')); + // eslint-disable-next-line max-len + it(`update host ${hosts[0].name}`, () => expect(zabbix.request('host.update', { + 'hostid': hosts[0].id, + 'templates': [{'templateid': hosts[0].tid}], + 'inventory_mode': 1 + })).to.be.fulfilled.and.to.eventually.be.an('Object')); it(`get host ${hosts[0].name}`, () => expect(zabbix.request('host.get', { 'output': [ @@ -77,16 +77,17 @@ describe('host actions:', () => { 'hostids': hosts[0].id })).to.be.fulfilled.and.to.eventually.be.an('Array')); - it(`add template to ${hosts[1].name}, ${hosts[2].name}`, () => expect( - zabbix.request('host.massadd', { - 'hosts': [ - {'hostid': hosts[1].id}, - {'hostid': hosts[2].id} - ], - 'templates': [{'templateid': hosts[1].tid}] - })).to.be.fulfilled.and.to.eventually.be.an('Object')); + // eslint-disable-next-line max-len + it(`add template to ${hosts[1].name}, ${hosts[2].name}`, () => expect(zabbix.request('host.massadd', { + 'hosts': [ + {'hostid': hosts[1].id}, + {'hostid': hosts[2].id} + ], + 'templates': [{'templateid': hosts[1].tid}] + })).to.be.fulfilled.and.to.eventually.be.an('Object')); - it(`update inventory contact ${hosts[1].name}, ${hosts[2].name}`, + it( + `update inventory contact ${hosts[1].name}, ${hosts[2].name}`, () => expect(zabbix.request('host.massupdate', { 'hosts': [ {'hostid': hosts[1].id}, @@ -94,22 +95,25 @@ describe('host actions:', () => { ], 'inventory': {'contact': 'Sumit Goel'}, 'inventory_mode': 1 - })).to.be.fulfilled.and.to.eventually.be.an('Object')); + })).to.be.fulfilled.and.to.eventually.be.an('Object') + ); - it(`unlink and clear template from ${hosts[1].name}, ${hosts[2].name}`, + it( + `unlink and clear template from ${hosts[1].name}, ${hosts[2].name}`, () => expect(zabbix.request('host.massremove', { 'hostids': [ hosts[1].id, hosts[2].id ], 'templateids_clear': hosts[1].tid - })).to.be.fulfilled.and.to.eventually.be.an('Object')); + })).to.be.fulfilled.and.to.eventually.be.an('Object') + ); hosts.forEach((host) => { - it(`delete host ${host.name}`, () => expect( - zabbix.request('host.delete', [host.id])) - .to.be.fulfilled.and.to.eventually.be.an('Object')); + // eslint-disable-next-line max-len + it(`delete host ${host.name}`, () => expect(zabbix.request('host.delete', [host.id])).to.be.fulfilled.and + .to.eventually.be.an('Object')); }); From ed4e859c89f58925bc2e942e7431a643811444ba Mon Sep 17 00:00:00 2001 From: Sumit Goel Date: Mon, 4 Sep 2017 14:46:34 -0700 Subject: [PATCH 14/18] code refactoring --- lib/api.js | 49 ++++++++++++++---------------------------- lib/wrapper.js | 12 ++++++----- src/api.js | 58 ++++++++++++++++---------------------------------- src/wrapper.js | 12 ++++++----- 4 files changed, 48 insertions(+), 83 deletions(-) diff --git a/lib/api.js b/lib/api.js index 41ef0ac..8e51524 100644 --- a/lib/api.js +++ b/lib/api.js @@ -1,6 +1,5 @@ const req = require('./wrapper'); - -const HTTPOK = 200; +const debug = require('debug')('api'); class Zabbix { @@ -23,22 +22,6 @@ class Zabbix { this.authid = null; } // eslint: constructor - static reqValidation(value) { - - return new Promise((resolve, reject) => { - - const { result } = value.body; - - if (value.statusCode === HTTPOK && result) { - - resolve(result); - } else { - - reject(result); - } - }); - } // eslint: reqValidation - request(method, params) { const opts = { @@ -50,7 +33,17 @@ class Zabbix { params }; - return req.post(opts).then(value => this.constructor.reqValidation(value)); + return req.post(opts).then(value => { + + debug('HTTP response: %o', value); + + if (!Object.prototype.hasOwnProperty.call(value, 'result')) { + + throw value; + } + + return value.result; + }); } // eslint: request /** @@ -66,13 +59,8 @@ class Zabbix { 'password': this.password }).then(value => { - if (typeof value === 'string' || value instanceof String) { - - this.authid = value; - return value; - } - - throw value; + this.authid = value; + return value; }); } // eslint: login @@ -86,13 +74,8 @@ class Zabbix { return this.request('user.logout', []).then(value => { - if (typeof value === 'boolean' && value) { - - this.authid = null; - return value; - } - - throw value; + this.authid = null; + return value; }); } // eslint: logout diff --git a/lib/wrapper.js b/lib/wrapper.js index c544a96..b23dcf6 100644 --- a/lib/wrapper.js +++ b/lib/wrapper.js @@ -1,4 +1,5 @@ const rp = require('request-promise-native'); +const debug = require('debug')('wrapper'); module.exports = { @@ -11,13 +12,10 @@ module.exports = { */ 'post': opts => { - const options = { - 'method': 'POST', + let options = { 'uri': opts.uri, 'json': true, 'gzip': true, - 'simple': false, - 'resolveWithFullResponse': true, 'body': { 'jsonrpc': '2.0', 'id': opts.id, @@ -27,6 +25,10 @@ module.exports = { } }; - return rp.post(Object.assign(options, opts.options)); + options = Object.assign(options, opts.options); + + debug('HTTP POST Options: %o', options); + + return rp.post(options); } }; \ No newline at end of file diff --git a/src/api.js b/src/api.js index 83b6949..5c0c732 100644 --- a/src/api.js +++ b/src/api.js @@ -1,8 +1,8 @@ // @flow const req = require('./wrapper'); +const debug = require('debug')('api'); -const HTTPOK = 200; class Zabbix { @@ -33,28 +33,6 @@ class Zabbix { } // eslint: constructor - static reqValidation (value) { - - return new Promise((resolve, reject) => { - - const {result} = value.body; - - if (value.statusCode === HTTPOK && result) { - - resolve(result); - - } else { - - reject(result); - - } - - - }); - - - } // eslint: reqValidation - request (method: string, params: {} | []) { const opts = { @@ -67,7 +45,19 @@ class Zabbix { }; return req.post(opts) - .then((value) => this.constructor.reqValidation(value)); + .then((value) => { + + debug('HTTP response: %o', value); + + if (!Object.prototype.hasOwnProperty.call(value, 'result')) { + + throw new Error(value); + + } + + return value.result; + + }); } // eslint: request @@ -85,14 +75,8 @@ class Zabbix { }) .then((value) => { - if (typeof value === 'string' || value instanceof String) { - - this.authid = value; - return value; - - } - - throw value; + this.authid = value; + return value; }); @@ -109,14 +93,8 @@ class Zabbix { return this.request('user.logout', []) .then((value) => { - if (typeof value === 'boolean' && value) { - - this.authid = null; - return value; - - } - - throw value; + this.authid = null; + return value; }); diff --git a/src/wrapper.js b/src/wrapper.js index ea75024..258cea7 100644 --- a/src/wrapper.js +++ b/src/wrapper.js @@ -1,6 +1,7 @@ // @flow const rp = require('request-promise-native'); +const debug = require('debug')('wrapper'); module.exports = { @@ -20,13 +21,10 @@ module.exports = { params: {} | [] |}) => { - const options = { - 'method': 'POST', + let options = { 'uri': opts.uri, 'json': true, 'gzip': true, - 'simple': false, - 'resolveWithFullResponse': true, 'body': { 'jsonrpc': '2.0', 'id': opts.id, @@ -36,7 +34,11 @@ module.exports = { } }; - return rp.post(Object.assign(options, opts.options)); + options = Object.assign(options, opts.options); + + debug('HTTP POST Options: %o', options); + + return rp.post(options); } }; From 9068dc6e15acc3aeb7f2890d68f5acda852f64da Mon Sep 17 00:00:00 2001 From: Sumit Goel Date: Mon, 4 Sep 2017 14:46:55 -0700 Subject: [PATCH 15/18] add zabbix_sender method --- lib/utils.js | 44 +++++++++++++++++++++++++++++++++---- src/utils.js | 62 ++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 98 insertions(+), 8 deletions(-) diff --git a/lib/utils.js b/lib/utils.js index a106dff..4bfb51f 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -1,12 +1,48 @@ const Zabbix = require('./api'); +const util = require('util'); +const exec = util.promisify(require('child_process').exec); class Client extends Zabbix { - sendValues() { + static sender(options) { - console.log(`Coming soon... ${this.url}`); - } + // $FlowFixMe: more research needed + return new Promise((resolve, reject) => { + // eslint-disable-line max-statements, max-len -} + if (!Object.prototype.hasOwnProperty.call(options, 'path')) { + + reject(new Error('Please provide full path for zabbix_sender ' + 'utility.')); + } // eslint: path + + if (!Object.prototype.hasOwnProperty.call(options, 'server')) { + + reject(new Error('Please provide zabbix server or proxy name.')); + } // eslint: server + + if (!Object.prototype.hasOwnProperty.call(options, 'port')) { + + options.port = '10051'; + } // eslint: port + + if (!Object.prototype.hasOwnProperty.call(options, 'host')) { + + reject(new Error('Please provide the zabbix host name as ' + 'registered in Zabbix frontend.')); + } // eslint: host + + if (!Object.prototype.hasOwnProperty.call(options, 'values')) { + + reject(new Error('Specify values each line contains whitespace ' + 'delimited: - ')); + } // eslint: values + + resolve(options); + }).then(val => { + + const { path, server, port, host, values } = val; + return exec(`printf -- '${values}' | ${path} -vv -z ${server} ` + `-p ${port} -s ${host} -r -i -`); + }); + } // eslint: sender + +} // eslint: Class module.exports = Client; \ No newline at end of file diff --git a/src/utils.js b/src/utils.js index 47b9557..104acd0 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,15 +1,69 @@ // @flow const Zabbix = require('./api'); +const util = require('util'); +const exec = util.promisify(require('child_process').exec); class Client extends Zabbix { - sendValues () { + static sender (options: {| + path: string, + server: string, + port: string, + host: string, + values: string + |}) { - console.log(`Coming soon... ${this.url}`); + // $FlowFixMe: more research needed + return new Promise((resolve, reject) => { // eslint-disable-line max-statements, max-len - } + if (!Object.prototype.hasOwnProperty.call(options, 'path')) { -} + reject(new Error('Please provide full path for zabbix_sender ' + + 'utility.')); + + } // eslint: path + + if (!Object.prototype.hasOwnProperty.call(options, 'server')) { + + reject(new Error('Please provide zabbix server or proxy name.')); + + } // eslint: server + + if (!Object.prototype.hasOwnProperty.call(options, 'port')) { + + options.port = '10051'; + + } // eslint: port + + if (!Object.prototype.hasOwnProperty.call(options, 'host')) { + + reject(new Error('Please provide the zabbix host name as ' + + 'registered in Zabbix frontend.')); + + } // eslint: host + + if (!Object.prototype.hasOwnProperty.call(options, 'values')) { + + reject(new Error('Specify values each line contains whitespace ' + + 'delimited: - ')); + + } // eslint: values + + resolve(options); + + }) + .then((val) => { + + const {path, server, port, host, values} = val; + return exec(`printf -- '${values}' | ${path} -vv -z ${server} ` + + `-p ${port} -s ${host} -r -i -`); + + }); + + + } // eslint: sender + +} // eslint: Class module.exports = Client; From ca7f48589599e8ae18aa0abb50fba7fa3739fc1d Mon Sep 17 00:00:00 2001 From: Sumit Goel Date: Mon, 4 Sep 2017 15:21:37 -0700 Subject: [PATCH 16/18] update throw new error --- lib/api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/api.js b/lib/api.js index 8e51524..9c11a93 100644 --- a/lib/api.js +++ b/lib/api.js @@ -39,7 +39,7 @@ class Zabbix { if (!Object.prototype.hasOwnProperty.call(value, 'result')) { - throw value; + throw new Error(value); } return value.result; From 2ca6de1febb57c9262767db5aab2e3aba5aa1178 Mon Sep 17 00:00:00 2001 From: Sumit Goel Date: Mon, 4 Sep 2017 15:22:10 -0700 Subject: [PATCH 17/18] remove util.promisify to support node 6 --- lib/utils.js | 26 ++++++++++++++++++++++---- src/utils.js | 29 ++++++++++++++++++++++++----- 2 files changed, 46 insertions(+), 9 deletions(-) diff --git a/lib/utils.js b/lib/utils.js index 4bfb51f..3c0fe99 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -1,6 +1,5 @@ const Zabbix = require('./api'); -const util = require('util'); -const exec = util.promisify(require('child_process').exec); +const { exec } = require('child_process'); class Client extends Zabbix { @@ -39,8 +38,27 @@ class Client extends Zabbix { }).then(val => { const { path, server, port, host, values } = val; - return exec(`printf -- '${values}' | ${path} -vv -z ${server} ` + `-p ${port} -s ${host} -r -i -`); - }); + + return new Promise((resolve, reject) => { + + let cmd = `printf -- '${values}' | ${path} -vv -z ${server} `; + cmd += `-p ${port} -s ${host} -r -i -`; + + exec(cmd, (error, stdout, stderr) => { + + if (error) { + + return reject(error); + } + + return resolve({ + stdout, + stderr + }); + }); // eslint: exec + }); // eslint: promise + }); // eslint: then + } // eslint: sender } // eslint: Class diff --git a/src/utils.js b/src/utils.js index 104acd0..d049c2a 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,8 +1,7 @@ // @flow const Zabbix = require('./api'); -const util = require('util'); -const exec = util.promisify(require('child_process').exec); +const {exec} = require('child_process'); class Client extends Zabbix { @@ -56,10 +55,30 @@ class Client extends Zabbix { .then((val) => { const {path, server, port, host, values} = val; - return exec(`printf -- '${values}' | ${path} -vv -z ${server} ` + - `-p ${port} -s ${host} -r -i -`); - }); + return new Promise((resolve, reject) => { + + let cmd = `printf -- '${values}' | ${path} -vv -z ${server} `; + cmd += `-p ${port} -s ${host} -r -i -`; + + exec(cmd, (error, stdout, stderr) => { + + if (error) { + + return reject(error); + + } + + return resolve({ + stdout, + stderr + }); + + }); // eslint: exec + + }); // eslint: promise + + }); // eslint: then } // eslint: sender From e5901e993a8094ba67ee5a20b87f72fee5e473d1 Mon Sep 17 00:00:00 2001 From: Sumit Goel Date: Mon, 4 Sep 2017 21:49:01 -0700 Subject: [PATCH 18/18] bumped version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fade896..4c65bd7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zabbix-promise", - "version": "1.1.0", + "version": "1.2.0", "description": "Simplified Zabbix API Client with Promise support", "main": "index.js", "scripts": {