diff --git a/monitoring/snippets/package-lock.json b/monitoring/snippets/package-lock.json index ddd8f2f43d..035f8affa1 100644 --- a/monitoring/snippets/package-lock.json +++ b/monitoring/snippets/package-lock.json @@ -5323,7 +5323,7 @@ "axios": "0.18.0", "google-p12-pem": "1.0.2", "jws": "3.1.4", - "mime": "2.2.1", + "mime": "2.2.2", "pify": "3.0.0" } }, @@ -6385,7 +6385,7 @@ } }, "mime": { - "version": "2.2.1", + "version": "2.2.2", "bundled": true }, "mime-db": { @@ -11085,9 +11085,9 @@ } }, "@google-cloud/nodejs-repo-tools": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@google-cloud/nodejs-repo-tools/-/nodejs-repo-tools-2.2.3.tgz", - "integrity": "sha512-O6OVc8lKiLL8Qtoc1lVAynf5pJT550fHZcW33a7oQ7TMNkrTHPgeoYw4esi4KSbDRn8gV+cfefnkgqxXmr+KzA==", + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/@google-cloud/nodejs-repo-tools/-/nodejs-repo-tools-2.2.6.tgz", + "integrity": "sha512-bDEgNBAJ8kfYWrpifg+D7rXs8NUBUUeu2I6NWkcL9IOXg86rblu7xnhFHRxBMcvytJ+7WY4pvkCLxO1v3QBsXg==", "dev": true, "requires": { "ava": "0.25.0", @@ -11105,112 +11105,15 @@ "yargs-parser": "9.0.2" }, "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "ava": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/ava/-/ava-0.25.0.tgz", - "integrity": "sha512-4lGNJCf6xL8SvsKVEKxEE46se7JAUIAZoKHw9itTQuwcsydhpAMkBs5gOOiWiwt0JKNIuXWc2/r4r8ZdcNrBEw==", - "dev": true, - "requires": { - "@ava/babel-preset-stage-4": "1.1.0", - "@ava/babel-preset-transform-test-files": "3.0.0", - "@ava/write-file-atomic": "2.2.0", - "@concordance/react": "1.0.0", - "@ladjs/time-require": "0.1.4", - "ansi-escapes": "3.1.0", - "ansi-styles": "3.2.1", - "arr-flatten": "1.1.0", - "array-union": "1.0.2", - "array-uniq": "1.0.3", - "arrify": "1.0.1", - "auto-bind": "1.2.0", - "ava-init": "0.2.1", - "babel-core": "6.26.0", - "babel-generator": "6.26.1", - "babel-plugin-syntax-object-rest-spread": "6.13.0", - "bluebird": "3.5.1", - "caching-transform": "1.0.1", - "chalk": "2.3.2", - "chokidar": "1.7.0", - "clean-stack": "1.3.0", - "clean-yaml-object": "0.1.0", - "cli-cursor": "2.1.0", - "cli-spinners": "1.1.0", - "cli-truncate": "1.1.0", - "co-with-promise": "4.6.0", - "code-excerpt": "2.1.1", - "common-path-prefix": "1.0.0", - "concordance": "3.0.0", - "convert-source-map": "1.5.1", - "core-assert": "0.2.1", - "currently-unhandled": "0.4.1", - "debug": "3.1.0", - "dot-prop": "4.2.0", - "empower-core": "0.6.2", - "equal-length": "1.0.1", - "figures": "2.0.0", - "find-cache-dir": "1.0.0", - "fn-name": "2.0.1", - "get-port": "3.2.0", - "globby": "6.1.0", - "has-flag": "2.0.0", - "hullabaloo-config-manager": "1.1.1", - "ignore-by-default": "1.0.1", - "import-local": "0.1.1", - "indent-string": "3.2.0", - "is-ci": "1.1.0", - "is-generator-fn": "1.0.0", - "is-obj": "1.0.1", - "is-observable": "1.1.0", - "is-promise": "2.1.0", - "last-line-stream": "1.0.0", - "lodash.clonedeepwith": "4.5.0", - "lodash.debounce": "4.0.8", - "lodash.difference": "4.5.0", - "lodash.flatten": "4.4.0", - "loud-rejection": "1.6.0", - "make-dir": "1.2.0", - "matcher": "1.1.0", - "md5-hex": "2.0.0", - "meow": "3.7.0", - "ms": "2.1.1", - "multimatch": "2.1.0", - "observable-to-promise": "0.5.0", - "option-chain": "1.0.0", - "package-hash": "2.0.0", - "pkg-conf": "2.1.0", - "plur": "2.1.2", - "pretty-ms": "3.1.0", - "require-precompiled": "0.1.0", - "resolve-cwd": "2.0.0", - "safe-buffer": "5.1.1", - "semver": "5.5.0", - "slash": "1.0.0", - "source-map-support": "0.5.4", - "stack-utils": "1.0.1", - "strip-ansi": "4.0.0", - "strip-bom-buf": "1.0.0", - "supertap": "1.0.0", - "supports-color": "5.3.0", - "trim-off-newlines": "1.0.1", - "unique-temp-dir": "1.0.0", - "update-notifier": "2.4.0" - } - }, - "cliui": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.0.0.tgz", - "integrity": "sha512-nY3W5Gu2racvdDk//ELReY+dHjb9PlIcVDFXP72nVIhq2Gy3LuVXYwJoPVudwQnv1shtohpgkdCKT2YaKY0CKw==", + "proxyquire": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/proxyquire/-/proxyquire-1.8.0.tgz", + "integrity": "sha1-AtUUpb7ZhvBMuyCTrxZ0FTX3ntw=", "dev": true, "requires": { - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "wrap-ansi": "2.1.0" + "fill-keys": "1.0.2", + "module-not-found-error": "1.0.1", + "resolve": "1.1.7" } }, "sinon": { @@ -11228,15 +11131,6 @@ "type-detect": "4.0.8" } }, - "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" - } - }, "yargs": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.0.0.tgz", @@ -11256,15 +11150,6 @@ "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" - } } } }, @@ -11362,9 +11247,9 @@ "dev": true }, "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "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", @@ -11479,16 +11364,17 @@ "dev": true }, "ava": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/ava/-/ava-0.23.0.tgz", - "integrity": "sha512-ZsVwO8UENDoZHlYQOEBv6oSGuUiZ8AFqaa+OhTv/McwC+4Y2V9skip5uYwN3egT9I9c+mKzLWA9lXUv7D6g8ZA==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/ava/-/ava-0.25.0.tgz", + "integrity": "sha512-4lGNJCf6xL8SvsKVEKxEE46se7JAUIAZoKHw9itTQuwcsydhpAMkBs5gOOiWiwt0JKNIuXWc2/r4r8ZdcNrBEw==", "dev": true, "requires": { "@ava/babel-preset-stage-4": "1.1.0", "@ava/babel-preset-transform-test-files": "3.0.0", "@ava/write-file-atomic": "2.2.0", "@concordance/react": "1.0.0", - "ansi-escapes": "2.0.0", + "@ladjs/time-require": "0.1.4", + "ansi-escapes": "3.1.0", "ansi-styles": "3.2.1", "arr-flatten": "1.1.0", "array-union": "1.0.2", @@ -11497,6 +11383,8 @@ "auto-bind": "1.2.0", "ava-init": "0.2.1", "babel-core": "6.26.0", + "babel-generator": "6.26.1", + "babel-plugin-syntax-object-rest-spread": "6.13.0", "bluebird": "3.5.1", "caching-transform": "1.0.1", "chalk": "2.3.2", @@ -11530,9 +11418,8 @@ "is-ci": "1.1.0", "is-generator-fn": "1.0.0", "is-obj": "1.0.1", - "is-observable": "0.2.0", + "is-observable": "1.1.0", "is-promise": "2.1.0", - "js-yaml": "3.11.0", "last-line-stream": "1.0.0", "lodash.clonedeepwith": "4.5.0", "lodash.debounce": "4.0.8", @@ -11554,72 +11441,17 @@ "require-precompiled": "0.1.0", "resolve-cwd": "2.0.0", "safe-buffer": "5.1.1", + "semver": "5.5.0", "slash": "1.0.0", - "source-map-support": "0.4.18", + "source-map-support": "0.5.4", "stack-utils": "1.0.1", "strip-ansi": "4.0.0", "strip-bom-buf": "1.0.0", - "supports-color": "4.5.0", - "time-require": "0.1.2", + "supertap": "1.0.0", + "supports-color": "5.3.0", "trim-off-newlines": "1.0.1", "unique-temp-dir": "1.0.0", "update-notifier": "2.4.0" - }, - "dependencies": { - "ansi-escapes": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-2.0.0.tgz", - "integrity": "sha1-W65SvkJIeN2Xg+iRDj/Cki6DyBs=", - "dev": true - }, - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "is-observable": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/is-observable/-/is-observable-0.2.0.tgz", - "integrity": "sha1-s2ExHYPG5dcmyr9eJQsCNxBvWuI=", - "dev": true, - "requires": { - "symbol-observable": "0.2.4" - } - }, - "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.7" - } - }, - "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.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", - "dev": true, - "requires": { - "has-flag": "2.0.0" - } - }, - "symbol-observable": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-0.2.4.tgz", - "integrity": "sha1-lag9smGG1q9+ehjb2XYKL4bQj0A=", - "dev": true - } } }, "ava-init": { @@ -11646,6 +11478,12 @@ "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", @@ -11665,6 +11503,15 @@ "supports-color": "2.0.0" } }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", @@ -12367,25 +12214,13 @@ } }, "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.0.0.tgz", + "integrity": "sha512-nY3W5Gu2racvdDk//ELReY+dHjb9PlIcVDFXP72nVIhq2Gy3LuVXYwJoPVudwQnv1shtohpgkdCKT2YaKY0CKw==", "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1", + "string-width": "2.1.1", + "strip-ansi": "4.0.0", "wrap-ansi": "2.1.0" - }, - "dependencies": { - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - } } }, "clone-response": { @@ -12901,15 +12736,6 @@ "mime-types": "2.1.18" } }, - "formatio": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/formatio/-/formatio-1.2.0.tgz", - "integrity": "sha1-87IWfZBoxGmKjVH092CjmlTYGOs=", - "dev": true, - "requires": { - "samsam": "1.3.0" - } - }, "formidable": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.1.tgz", @@ -13922,6 +13748,14 @@ "dev": true, "requires": { "ansi-regex": "2.1.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 + } } }, "has-color": { @@ -14169,12 +14003,9 @@ } }, "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=", - "requires": { - "number-is-nan": "1.0.1" - } + "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", @@ -16758,6 +16589,12 @@ "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "dev": true + }, "path-to-regexp": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", @@ -16906,14 +16743,25 @@ "dev": true }, "proxyquire": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/proxyquire/-/proxyquire-1.8.0.tgz", - "integrity": "sha1-AtUUpb7ZhvBMuyCTrxZ0FTX3ntw=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/proxyquire/-/proxyquire-2.0.1.tgz", + "integrity": "sha512-fQr3VQrbdzHrdaDn3XuisVoJlJNDJizHAvUXw9IuXRR8BpV2x0N7LsCxrpJkeKfPbNjiNU/V5vc008cI0TmzzQ==", "dev": true, "requires": { "fill-keys": "1.0.2", "module-not-found-error": "1.0.1", - "resolve": "1.1.7" + "resolve": "1.5.0" + }, + "dependencies": { + "resolve": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", + "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", + "dev": true, + "requires": { + "path-parse": "1.0.5" + } + } } }, "pseudomap": { @@ -17299,29 +17147,18 @@ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, "sinon": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-4.0.2.tgz", - "integrity": "sha512-4mUsjHfjrHyPFGDTtNJl0q8cv4VOJGvQykI1r3fnn05ys0sQL9M1Y+DyyGNWLD2PMcoyqjJ/nFDm4K54V1eQOg==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-4.5.0.tgz", + "integrity": "sha512-trdx+mB0VBBgoYucy6a9L7/jfQOmvGeaKZT4OOJ+lPAtI8623xyGr8wLiE4eojzBS8G9yXbhx42GHUOVLr4X2w==", "dev": true, "requires": { + "@sinonjs/formatio": "2.0.0", "diff": "3.5.0", - "formatio": "1.2.0", "lodash.get": "4.4.2", "lolex": "2.3.2", "nise": "1.3.2", - "supports-color": "4.5.0", + "supports-color": "5.3.0", "type-detect": "4.0.8" - }, - "dependencies": { - "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", - "dev": true, - "requires": { - "has-flag": "2.0.0" - } - } } }, "slash": { @@ -17337,14 +17174,6 @@ "dev": true, "requires": { "is-fullwidth-code-point": "2.0.0" - }, - "dependencies": { - "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=", - "dev": true - } } }, "slide": { @@ -17448,26 +17277,6 @@ "requires": { "is-fullwidth-code-point": "2.0.0", "strip-ansi": "4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" - }, - "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=" - }, - "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": { @@ -17480,11 +17289,11 @@ } }, "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "3.0.0" } }, "strip-bom": { @@ -17551,23 +17360,6 @@ "js-yaml": "3.11.0", "serialize-error": "2.1.0", "strip-ansi": "4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "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" - } - } } }, "supertest": { @@ -17634,52 +17426,6 @@ "xtend": "4.0.1" } }, - "time-require": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/time-require/-/time-require-0.1.2.tgz", - "integrity": "sha1-+eEss3D8JgXhFARYK6VO9corLZg=", - "dev": true, - "requires": { - "chalk": "0.4.0", - "date-time": "0.1.1", - "pretty-ms": "0.2.2", - "text-table": "0.2.0" - }, - "dependencies": { - "ansi-styles": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz", - "integrity": "sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg=", - "dev": true - }, - "chalk": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz", - "integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=", - "dev": true, - "requires": { - "ansi-styles": "1.0.0", - "has-color": "0.1.7", - "strip-ansi": "0.1.1" - } - }, - "pretty-ms": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-0.2.2.tgz", - "integrity": "sha1-2oeaaC/zOjcBEEbxPWJ/Z8c7hPY=", - "dev": true, - "requires": { - "parse-ms": "0.1.2" - } - }, - "strip-ansi": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", - "integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE=", - "dev": true - } - } - }, "time-zone": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz", @@ -17919,6 +17665,19 @@ "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=" + }, + "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=", + "requires": { + "number-is-nan": "1.0.1" + } + }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -17928,6 +17687,14 @@ "is-fullwidth-code-point": "1.0.0", "strip-ansi": "3.0.1" } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "2.1.1" + } } } }, @@ -18009,11 +17776,11 @@ "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" }, "yargs": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-10.0.3.tgz", - "integrity": "sha512-DqBpQ8NAUX4GyPP/ijDGHsJya4tYqLQrjPr95HNsr1YwL3+daCfvBwg7+gIC6IdJhR2kATh3hb61vjzMWEtjdw==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz", + "integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==", "requires": { - "cliui": "3.2.0", + "cliui": "4.0.0", "decamelize": "1.2.0", "find-up": "2.1.0", "get-caller-file": "1.0.2", @@ -18024,13 +17791,13 @@ "string-width": "2.1.1", "which-module": "2.0.0", "y18n": "3.2.1", - "yargs-parser": "8.1.0" + "yargs-parser": "9.0.2" } }, "yargs-parser": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-8.1.0.tgz", - "integrity": "sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", + "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", "requires": { "camelcase": "4.1.0" } diff --git a/monitoring/snippets/package.json b/monitoring/snippets/package.json index c6afe67e77..b4b4b6dbf5 100644 --- a/monitoring/snippets/package.json +++ b/monitoring/snippets/package.json @@ -13,12 +13,12 @@ }, "dependencies": { "@google-cloud/monitoring": "0.4.1", - "yargs": "10.0.3" + "yargs": "11.1.0" }, "devDependencies": { - "@google-cloud/nodejs-repo-tools": "2.2.3", - "ava": "0.23.0", - "proxyquire": "1.8.0", - "sinon": "4.0.2" + "@google-cloud/nodejs-repo-tools": "2.2.6", + "ava": "0.25.0", + "proxyquire": "2.0.1", + "sinon": "4.5.0" } } diff --git a/monitoring/snippets/system-test/uptime.test.js b/monitoring/snippets/system-test/uptime.test.js index d41e1090f3..3b90023591 100644 --- a/monitoring/snippets/system-test/uptime.test.js +++ b/monitoring/snippets/system-test/uptime.test.js @@ -22,30 +22,27 @@ const tools = require(`@google-cloud/nodejs-repo-tools`); const cmd = `node uptime.js`; const cwd = path.join(__dirname, `..`); const projectId = process.env.GCLOUD_PROJECT; -const instanceId = 'uptime-test-' + Date.now(); +const hostname = 'mydomain.com'; test.before(tools.checkCredentials); -test(`should get an uptime check`, async t => { +test(`should list uptime-check ips`, async t => { t.regex(await tools.runAsync(`${cmd} list-ips`, cwd), /USA/); }); let id; test.serial(`should create an uptime check`, async t => { - const results = await tools.runAsyncWithIO( - `${cmd} create ${instanceId}`, - cwd - ); + const results = await tools.runAsyncWithIO(`${cmd} create ${hostname}`, cwd); const output = results.stdout + results.stderr; const matches = output.match( new RegExp(`ID: projects/${projectId}/uptimeCheckConfigs/(.+)`) ); id = matches[1]; t.regex(output, /Uptime check created:/); - t.regex(output, /"type":"gce_instance"/); - t.regex(output, new RegExp(`"labels":{"instance_id":"${instanceId}"}`)); - t.regex(output, /Display Name: My GCE Instance Uptime Check/); + t.regex(output, /"type":"uptime_url"/); + t.regex(output, new RegExp(`"labels":{"host":"${hostname}"}`)); + t.regex(output, /Display Name: My Uptime Check/); }); test.serial(`should get an uptime check`, async t => { @@ -55,8 +52,8 @@ test.serial(`should get an uptime check`, async t => { output, new RegExp(`Retrieving projects/${projectId}/uptimeCheckConfigs/${id}`) ); - t.regex(output, /"type":"gce_instance"/); - t.regex(output, new RegExp(`"labels":{"instance_id":"${instanceId}"}`)); + t.regex(output, /"type":"uptime_url"/); + t.regex(output, new RegExp(`"labels":{"host":"${hostname}"}`)); }); test.serial(`should list uptime checks`, async t => { @@ -65,11 +62,9 @@ test.serial(`should list uptime checks`, async t => { .tryTest(async assert => { const results = await tools.runAsyncWithIO(`${cmd} list`, cwd); const output = results.stdout + results.stderr; - assert(/"type":"gce_instance"/.test(output)); - assert( - new RegExp(`"labels":{"instance_id":"${instanceId}"}`).test(output) - ); - assert(/Display Name: My GCE Instance Uptime Check/.test(output)); + assert(/"type":"uptime_url"/.test(output)); + assert(new RegExp(`"labels":{"host":"${hostname}"}`).test(output)); + assert(/Display Name: My Uptime Check/.test(output)); }) .start(); }); diff --git a/monitoring/snippets/uptime.js b/monitoring/snippets/uptime.js index 0b51f2ffa0..17115058b2 100644 --- a/monitoring/snippets/uptime.js +++ b/monitoring/snippets/uptime.js @@ -23,7 +23,7 @@ 'use strict'; -function createUptimeCheckConfig(projectId, gceInstanceId) { +function createUptimeCheckConfig(projectId, hostname) { // [START monitoring_uptime_check_create] // Imports the Google Cloud client library const monitoring = require('@google-cloud/monitoring'); @@ -35,17 +35,17 @@ function createUptimeCheckConfig(projectId, gceInstanceId) { * TODO(developer): Uncomment and edit the following lines of code. */ // const projectId = 'YOUR_PROJECT_ID'; - // const gceInstanceId = 'my-instance'; + // const hostname = 'mydomain.com'; const request = { // i.e. parent: 'projects/my-project-id' parent: client.projectPath(projectId), uptimeCheckConfig: { - displayName: 'My GCE Instance Uptime Check', + displayName: 'My Uptime Check', monitoredResource: { // See the Uptime Check docs for supported MonitoredResource types - type: 'gce_instance', - labels: {instance_id: gceInstanceId}, + type: 'uptime_url', + labels: {host: hostname}, }, httpCheck: {path: '/', port: 80}, timeout: {seconds: 10}, @@ -246,10 +246,10 @@ function deleteUptimeCheckConfig(projectId, uptimeCheckConfigId) { require(`yargs`) .demand(1) .command( - `create [projectId]`, + `create [projectId]`, `Creates an uptime check config.`, {}, - opts => createUptimeCheckConfig(opts.projectId, '' + opts.gceInstanceId) + opts => createUptimeCheckConfig(opts.projectId, '' + opts.hostname) ) .command(`list [projectId]`, `Lists uptime check configs.`, {}, opts => listUptimeCheckConfigs(opts.projectId) @@ -278,10 +278,7 @@ require(`yargs`) type: 'string', }, }) - .example( - `node $0 create my-instance`, - 'Create an uptime check for a "my-instance" GCE instance.' - ) + .example(`node $0 create mydomain.com`, 'Create an uptime check.') .example(`node $0 list`, 'List all uptime check configs.') .example( `node $0 list "resource.type = gce_instance AND resource.label.instance_id = mongodb"`,