From 58cd9ced1a6ff858e49da52bbf31d63ad0193826 Mon Sep 17 00:00:00 2001 From: James Allen Date: Mon, 17 Feb 2014 14:54:20 +0000 Subject: [PATCH 01/93] Initial open source commit --- libraries/logger/.gitignore | 1 + libraries/logger/index.js | 2 ++ libraries/logger/logging-manager.coffee | 20 ++++++++++++++++++++ libraries/logger/package.json | 9 +++++++++ 4 files changed, 32 insertions(+) create mode 100644 libraries/logger/.gitignore create mode 100755 libraries/logger/index.js create mode 100644 libraries/logger/logging-manager.coffee create mode 100644 libraries/logger/package.json diff --git a/libraries/logger/.gitignore b/libraries/logger/.gitignore new file mode 100644 index 0000000000..3c3629e647 --- /dev/null +++ b/libraries/logger/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/libraries/logger/index.js b/libraries/logger/index.js new file mode 100755 index 0000000000..a1855a2839 --- /dev/null +++ b/libraries/logger/index.js @@ -0,0 +1,2 @@ +require("coffee-script") +module.exports = require('./logging-manager'); diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee new file mode 100644 index 0000000000..cc3a262cf6 --- /dev/null +++ b/libraries/logger/logging-manager.coffee @@ -0,0 +1,20 @@ +bunyan = require('bunyan') + +module.exports = Logger = + initialize: (name) -> + @logger = bunyan.createLogger + name: name + serializers: bunyan.stdSerializers + return @ + info : ()-> + @logger.info.apply(@logger, arguments) + log : ()-> + @logger.info.apply(@logger, arguments) + error: ()-> + @logger.error.apply(@logger, arguments) + err: ()-> + @logger.error.apply(@logger, arguments) + warn: ()-> + @logger.warn.apply(@logger, arguments) + +Logger.initialize("default-sharelatex") diff --git a/libraries/logger/package.json b/libraries/logger/package.json new file mode 100644 index 0000000000..e0e8455d09 --- /dev/null +++ b/libraries/logger/package.json @@ -0,0 +1,9 @@ +{ + "name": "logger-sharelatex", + "homepage": "www.sharelatex.com", + "version": "0.0.1", + "dependencies": { + "coffee-script": "1.4.0", + "bunyan": "0.16.x" + } +} From c1e10e7ec4adbdc25857bb9f51ebc0a0991fd42f Mon Sep 17 00:00:00 2001 From: James Allen Date: Tue, 19 Aug 2014 13:27:58 +0100 Subject: [PATCH 02/93] Release version 1.0.0 --- libraries/logger/package.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/logger/package.json b/libraries/logger/package.json index e0e8455d09..f911ae178b 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -1,7 +1,12 @@ { "name": "logger-sharelatex", "homepage": "www.sharelatex.com", - "version": "0.0.1", + "description": "A centralised logging system for ShareLaTeX", + "repository": { + "type": "git", + "url": "http://github.com/sharelatex/logger-sharelatex.git" + }, + "version": "1.0.0", "dependencies": { "coffee-script": "1.4.0", "bunyan": "0.16.x" From 5637678b48aaf599c4e07bb0eca5e71a831029c3 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Mon, 8 Jun 2015 10:01:45 +0100 Subject: [PATCH 03/93] bumped bunyan version to work with node 0.12 --- libraries/logger/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/logger/package.json b/libraries/logger/package.json index f911ae178b..93e8c7d019 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -9,6 +9,6 @@ "version": "1.0.0", "dependencies": { "coffee-script": "1.4.0", - "bunyan": "0.16.x" + "bunyan": "1.3.6" } } From 90e6c85e5494b87fa10f15d514c1bbdd298a9704 Mon Sep 17 00:00:00 2001 From: James Allen Date: Tue, 16 Jun 2015 16:50:18 +0100 Subject: [PATCH 04/93] Send errors to Sentry if configured --- libraries/logger/logging-manager.coffee | 13 +++++++++++-- libraries/logger/package.json | 7 ++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee index cc3a262cf6..84ad3da218 100644 --- a/libraries/logger/logging-manager.coffee +++ b/libraries/logger/logging-manager.coffee @@ -6,12 +6,21 @@ module.exports = Logger = name: name serializers: bunyan.stdSerializers return @ + + initializeErrorReporting: (sentry_dsn) -> + raven = require "raven" + @raven = new raven.Client(sentry_dsn) + info : ()-> @logger.info.apply(@logger, arguments) log : ()-> @logger.info.apply(@logger, arguments) - error: ()-> - @logger.error.apply(@logger, arguments) + error: (attributes, args...)-> + @logger.error(attributes, args...) + if @raven? + error = attributes.err or attributes.error + if error? + @raven.captureError(error, attributes) err: ()-> @logger.error.apply(@logger, arguments) warn: ()-> diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 93e8c7d019..17911317d9 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -3,12 +3,13 @@ "homepage": "www.sharelatex.com", "description": "A centralised logging system for ShareLaTeX", "repository": { - "type": "git", - "url": "http://github.com/sharelatex/logger-sharelatex.git" + "type": "git", + "url": "http://github.com/sharelatex/logger-sharelatex.git" }, "version": "1.0.0", "dependencies": { + "bunyan": "1.3.6", "coffee-script": "1.4.0", - "bunyan": "1.3.6" + "raven": "^0.8.0" } } From 30bfae5b359583db1f975901f5a46dcb4ddf9477 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 1 Dec 2015 20:51:08 +0000 Subject: [PATCH 05/93] upgraded bunyan --- libraries/logger/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 17911317d9..750a7232e1 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -8,7 +8,7 @@ }, "version": "1.0.0", "dependencies": { - "bunyan": "1.3.6", + "bunyan": "1.5.1", "coffee-script": "1.4.0", "raven": "^0.8.0" } From f1abe1e03baa9531a33b9b5a6515b88c8e53d7ab Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 8 Dec 2015 10:30:18 +0000 Subject: [PATCH 06/93] allow passing options to sentry --- libraries/logger/logging-manager.coffee | 4 ++-- libraries/logger/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee index 84ad3da218..ddcd1892cc 100644 --- a/libraries/logger/logging-manager.coffee +++ b/libraries/logger/logging-manager.coffee @@ -7,9 +7,9 @@ module.exports = Logger = serializers: bunyan.stdSerializers return @ - initializeErrorReporting: (sentry_dsn) -> + initializeErrorReporting: (sentry_dsn, options) -> raven = require "raven" - @raven = new raven.Client(sentry_dsn) + @raven = new raven.Client(sentry_dsn, options) info : ()-> @logger.info.apply(@logger, arguments) diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 750a7232e1..a597a9a561 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "http://github.com/sharelatex/logger-sharelatex.git" }, - "version": "1.0.0", + "version": "1.2.0", "dependencies": { "bunyan": "1.5.1", "coffee-script": "1.4.0", From 06662f869f53165d5c2c614645a0cea65dfa85af Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Thu, 17 Dec 2015 16:41:32 +0000 Subject: [PATCH 07/93] capture id's as tags, and pass attributes to sentry --- libraries/logger/logging-manager.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee index ddcd1892cc..852ea90339 100644 --- a/libraries/logger/logging-manager.coffee +++ b/libraries/logger/logging-manager.coffee @@ -20,7 +20,10 @@ module.exports = Logger = if @raven? error = attributes.err or attributes.error if error? - @raven.captureError(error, attributes) + tags = {} + for key, value of attributes + tags[key] = value if key.match(/_id/) and typeof value == 'string' + @raven.captureError(error, tags: tags, extra: attributes) err: ()-> @logger.error.apply(@logger, arguments) warn: ()-> From fd70f23e5ced66105fcce9eebb9734e7b4c5e482 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Fri, 18 Dec 2015 10:58:03 +0000 Subject: [PATCH 08/93] updated version to 1.2.1 --- libraries/logger/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/logger/package.json b/libraries/logger/package.json index a597a9a561..56d1a87e6d 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "http://github.com/sharelatex/logger-sharelatex.git" }, - "version": "1.2.0", + "version": "1.2.1", "dependencies": { "bunyan": "1.5.1", "coffee-script": "1.4.0", From 2e21da050c088e6d0519523ab18e133fd9d5aa8e Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 5 Jan 2016 13:31:05 +0000 Subject: [PATCH 09/93] add logging of request parameters to sentry --- libraries/logger/logging-manager.coffee | 12 +++++++++++- libraries/logger/package.json | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee index 852ea90339..7762f4f716 100644 --- a/libraries/logger/logging-manager.coffee +++ b/libraries/logger/logging-manager.coffee @@ -19,11 +19,21 @@ module.exports = Logger = @logger.error(attributes, args...) if @raven? error = attributes.err or attributes.error + req = attributes.req if error? tags = {} + extra = {} for key, value of attributes tags[key] = value if key.match(/_id/) and typeof value == 'string' - @raven.captureError(error, tags: tags, extra: attributes) + extra[key] = value + if req? + extra.req = + method: req.method + url: req.originalUrl + query: req.query + headers: req.headers + ip: req.ip + @raven.captureError(error, {tags: tags, extra: extra}) err: ()-> @logger.error.apply(@logger, arguments) warn: ()-> diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 56d1a87e6d..8ed1e105cc 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "http://github.com/sharelatex/logger-sharelatex.git" }, - "version": "1.2.1", + "version": "1.3.0", "dependencies": { "bunyan": "1.5.1", "coffee-script": "1.4.0", From 17cf288e4cd1a20d190d53546bdb362b1a44822c Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 26 Jan 2016 16:41:52 +0000 Subject: [PATCH 10/93] recreate Error objects from plain objects when logging to sentry --- libraries/logger/logging-manager.coffee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee index 7762f4f716..68cf867e6d 100644 --- a/libraries/logger/logging-manager.coffee +++ b/libraries/logger/logging-manager.coffee @@ -33,6 +33,12 @@ module.exports = Logger = query: req.query headers: req.headers ip: req.ip + # recreate error objects that have been converted to a normal object + if !(error instanceof Error) and typeof error is "object" + newError = new Error(error.message) + for own key, value of error + newError[key] = value + error = newError @raven.captureError(error, {tags: tags, extra: extra}) err: ()-> @logger.error.apply(@logger, arguments) From e8b8cfd9e0c9814d3c7d0cb30d9b270cc2c4ad16 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 26 Jan 2016 16:42:08 +0000 Subject: [PATCH 11/93] release version 1.3.1 --- libraries/logger/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 8ed1e105cc..4903dcc74e 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "http://github.com/sharelatex/logger-sharelatex.git" }, - "version": "1.3.0", + "version": "1.3.1", "dependencies": { "bunyan": "1.5.1", "coffee-script": "1.4.0", From e04e6332e80329aec32a0b19921cc348806eff4a Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 29 Mar 2016 12:53:16 +0100 Subject: [PATCH 12/93] add fatal exception reporting split out capture exception code into separate method --- libraries/logger/logging-manager.coffee | 74 +++++++++++++++---------- 1 file changed, 45 insertions(+), 29 deletions(-) diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee index 68cf867e6d..7bfec073ab 100644 --- a/libraries/logger/logging-manager.coffee +++ b/libraries/logger/logging-manager.coffee @@ -6,43 +6,59 @@ module.exports = Logger = name: name serializers: bunyan.stdSerializers return @ - + initializeErrorReporting: (sentry_dsn, options) -> raven = require "raven" @raven = new raven.Client(sentry_dsn, options) - + + captureException: (attributes, message, level) -> + error = attributes.err or attributes.error or message + req = attributes.req + if error? + tags = {} + extra = {} + # capture attributes and use *_id objects as tags + for key, value of attributes + tags[key] = value if key.match(/_id/) and typeof value == 'string' + extra[key] = value + # capture req object if available + if req? + extra.req = + method: req.method + url: req.originalUrl + query: req.query + headers: req.headers + ip: req.ip + # recreate error objects that have been converted to a normal object + if !(error instanceof Error) and typeof error is "object" + newError = new Error(error.message) + for own key, value of error + newError[key] = value + error = newError + # send the error to sentry + @raven.captureException(error, {tags: tags, extra: extra, level: level}) + info : ()-> @logger.info.apply(@logger, arguments) log : ()-> @logger.info.apply(@logger, arguments) - error: (attributes, args...)-> - @logger.error(attributes, args...) - if @raven? - error = attributes.err or attributes.error - req = attributes.req - if error? - tags = {} - extra = {} - for key, value of attributes - tags[key] = value if key.match(/_id/) and typeof value == 'string' - extra[key] = value - if req? - extra.req = - method: req.method - url: req.originalUrl - query: req.query - headers: req.headers - ip: req.ip - # recreate error objects that have been converted to a normal object - if !(error instanceof Error) and typeof error is "object" - newError = new Error(error.message) - for own key, value of error - newError[key] = value - error = newError - @raven.captureError(error, {tags: tags, extra: extra}) - err: ()-> - @logger.error.apply(@logger, arguments) + error: (attributes, message, args...)-> + @logger.error(attributes, message, args...) + @captureException(attributes, message, "error") if @raven? + err: () -> + @error.apply(this, arguments) warn: ()-> @logger.warn.apply(@logger, arguments) + fatal: (attributes, message, callback) -> + @logger.fatal(attributes, message) + if @raven? + cb = (e) -> # call the callback once after 'logged' or 'error' event + callback() + cb = () -> + @captureException(attributes, message, "fatal") + @raven.once 'logged', cb + @raven.once 'error', cb + else + callback() Logger.initialize("default-sharelatex") From 04529c0019995394b082922af8ff02a4f575ce51 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Wed, 30 Mar 2016 14:30:05 +0100 Subject: [PATCH 13/93] release 1.4 --- libraries/logger/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 4903dcc74e..1f11a568d1 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "http://github.com/sharelatex/logger-sharelatex.git" }, - "version": "1.3.1", + "version": "1.4.0", "dependencies": { "bunyan": "1.5.1", "coffee-script": "1.4.0", From fdc1ad28989b3cbe9614195d5d037d705e7a0038 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Fri, 1 Apr 2016 15:35:14 +0100 Subject: [PATCH 14/93] use logger.error message as title of sentry report --- libraries/logger/logging-manager.coffee | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee index 7bfec073ab..1640fc6ea4 100644 --- a/libraries/logger/logging-manager.coffee +++ b/libraries/logger/logging-manager.coffee @@ -12,16 +12,27 @@ module.exports = Logger = @raven = new raven.Client(sentry_dsn, options) captureException: (attributes, message, level) -> - error = attributes.err or attributes.error or message - req = attributes.req + # handle case of logger.error "message" + if typeof attributes is 'string' + attributes = {err: attributes} + # extract any error object + error = attributes.err or attributes.error + # use our log message as the title when available + if not error? + error = {message: message} if typeof message is 'string' + else if message? + error.exception = error.message + error.message = message + # report the error if error? + # capture attributes and use *_id objects as tags tags = {} extra = {} - # capture attributes and use *_id objects as tags for key, value of attributes tags[key] = value if key.match(/_id/) and typeof value == 'string' extra[key] = value # capture req object if available + req = attributes.req if req? extra.req = method: req.method From 7bdf2ef26bdf7ffb2be78c5d6890f4ee93622f33 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Fri, 1 Apr 2016 15:35:54 +0100 Subject: [PATCH 15/93] release 1.5 --- libraries/logger/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 1f11a568d1..ae116a834e 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "http://github.com/sharelatex/logger-sharelatex.git" }, - "version": "1.4.0", + "version": "1.5.0", "dependencies": { "bunyan": "1.5.1", "coffee-script": "1.4.0", From 24e097d26349ab42493912bd42c72c09a1ecd0c3 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Fri, 1 Apr 2016 15:52:28 +0100 Subject: [PATCH 16/93] don't force message over exception but include it as description --- libraries/logger/logging-manager.coffee | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee index 1640fc6ea4..a915e07bca 100644 --- a/libraries/logger/logging-manager.coffee +++ b/libraries/logger/logging-manager.coffee @@ -14,15 +14,14 @@ module.exports = Logger = captureException: (attributes, message, level) -> # handle case of logger.error "message" if typeof attributes is 'string' - attributes = {err: attributes} + attributes = {err: new Error(attributes)} # extract any error object error = attributes.err or attributes.error - # use our log message as the title when available + # include our log message in the error report if not error? error = {message: message} if typeof message is 'string' else if message? - error.exception = error.message - error.message = message + attributes.description = message # report the error if error? # capture attributes and use *_id objects as tags From cf0e106153b164b812527978e76ca2d5004bf2fc Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Fri, 1 Apr 2016 15:52:42 +0100 Subject: [PATCH 17/93] release 1.5.1 --- libraries/logger/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/logger/package.json b/libraries/logger/package.json index ae116a834e..2dbad2f887 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "http://github.com/sharelatex/logger-sharelatex.git" }, - "version": "1.5.0", + "version": "1.5.1", "dependencies": { "bunyan": "1.5.1", "coffee-script": "1.4.0", From 6e3f102fb2fb5d49dc73d8b124741930ac3adf5e Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Wed, 22 Feb 2017 15:53:52 +0000 Subject: [PATCH 18/93] rate limit on sentry reporting --- libraries/logger/logging-manager.coffee | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee index a915e07bca..33f3ce8c49 100644 --- a/libraries/logger/logging-manager.coffee +++ b/libraries/logger/logging-manager.coffee @@ -54,7 +54,13 @@ module.exports = Logger = @logger.info.apply(@logger, arguments) error: (attributes, message, args...)-> @logger.error(attributes, message, args...) - @captureException(attributes, message, "error") if @raven? + if @raven? + now = new Date() + rateLimited = (now - @lastErrorTimeStamp) < 30 * 1000 + # only report one error every thirty seconds to avoid overload + if not rateLimited + @captureException(attributes, message, "error") + @lastErrorTimeStamp = now err: () -> @error.apply(this, arguments) warn: ()-> From 68b941357ef22271ff87d36a4c6f9f3cee1510b8 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Thu, 23 Feb 2017 09:42:01 +0000 Subject: [PATCH 19/93] avoid uninitialised last error timestamp --- libraries/logger/logging-manager.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee index 33f3ce8c49..3d6c3910c5 100644 --- a/libraries/logger/logging-manager.coffee +++ b/libraries/logger/logging-manager.coffee @@ -10,6 +10,7 @@ module.exports = Logger = initializeErrorReporting: (sentry_dsn, options) -> raven = require "raven" @raven = new raven.Client(sentry_dsn, options) + @lastErrorTimeStamp = 0 # for rate limiting on sentry reporting captureException: (attributes, message, level) -> # handle case of logger.error "message" From 5fc5a86b31fb74bb75fc0a632fcf50aa77a29c86 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Fri, 3 Mar 2017 14:43:41 +0000 Subject: [PATCH 20/93] upgrade to latest raven --- libraries/logger/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 2dbad2f887..36025ab98d 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -10,6 +10,6 @@ "dependencies": { "bunyan": "1.5.1", "coffee-script": "1.4.0", - "raven": "^0.8.0" + "raven": "^1.1.3" } } From dfb2a069c09c380dbf8746035df7c3eaa1a35b4e Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Fri, 3 Mar 2017 16:05:56 +0000 Subject: [PATCH 21/93] use try catch around sentry logging --- libraries/logger/logging-manager.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee index 3d6c3910c5..4643c41dd7 100644 --- a/libraries/logger/logging-manager.coffee +++ b/libraries/logger/logging-manager.coffee @@ -47,7 +47,10 @@ module.exports = Logger = newError[key] = value error = newError # send the error to sentry - @raven.captureException(error, {tags: tags, extra: extra, level: level}) + try + @raven.captureException(error, {tags: tags, extra: extra, level: level}) + catch + return # ignore any errors info : ()-> @logger.info.apply(@logger, arguments) From aebaff829b907ebf25edf5545ec3607924dd983c Mon Sep 17 00:00:00 2001 From: James Allen Date: Mon, 6 Mar 2017 12:09:37 +0000 Subject: [PATCH 22/93] Update package.json --- libraries/logger/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 36025ab98d..41e1b22a6e 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "http://github.com/sharelatex/logger-sharelatex.git" }, - "version": "1.5.1", + "version": "1.5.4", "dependencies": { "bunyan": "1.5.1", "coffee-script": "1.4.0", From 27c6390f4c255fad2d232f4f773ff5920ae01135 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Wed, 22 Mar 2017 14:46:42 +0000 Subject: [PATCH 23/93] upgrade to coffee-script 1.12.4 --- libraries/logger/index.js | 2 +- libraries/logger/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/logger/index.js b/libraries/logger/index.js index a1855a2839..dedfe4be5d 100755 --- a/libraries/logger/index.js +++ b/libraries/logger/index.js @@ -1,2 +1,2 @@ -require("coffee-script") +require("coffee-script/register") module.exports = require('./logging-manager'); diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 41e1b22a6e..be8eb7e03f 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -9,7 +9,7 @@ "version": "1.5.4", "dependencies": { "bunyan": "1.5.1", - "coffee-script": "1.4.0", + "coffee-script": "1.12.4", "raven": "^1.1.3" } } From c930f6c680fb46b66c1b530d36250a19639abcc2 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Wed, 22 Mar 2017 14:59:40 +0000 Subject: [PATCH 24/93] bump to version 1.5.5 --- libraries/logger/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/logger/package.json b/libraries/logger/package.json index be8eb7e03f..f4b9ff841f 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "http://github.com/sharelatex/logger-sharelatex.git" }, - "version": "1.5.4", + "version": "1.5.5", "dependencies": { "bunyan": "1.5.1", "coffee-script": "1.12.4", From 013c2a693c6c6118a4ed8e038ae180edec4a745b Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Thu, 23 Mar 2017 13:49:01 +0000 Subject: [PATCH 25/93] rate limit on logging v1.5.6 --- libraries/logger/logging-manager.coffee | 19 +++++++++++++++---- libraries/logger/package.json | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee index 4643c41dd7..2dff9d6272 100644 --- a/libraries/logger/logging-manager.coffee +++ b/libraries/logger/logging-manager.coffee @@ -11,6 +11,7 @@ module.exports = Logger = raven = require "raven" @raven = new raven.Client(sentry_dsn, options) @lastErrorTimeStamp = 0 # for rate limiting on sentry reporting + @lastErrorCount = 0 captureException: (attributes, message, level) -> # handle case of logger.error "message" @@ -59,12 +60,22 @@ module.exports = Logger = error: (attributes, message, args...)-> @logger.error(attributes, message, args...) if @raven? + MAX_ERRORS = 5 # maximum number of errors in 1 minute now = new Date() - rateLimited = (now - @lastErrorTimeStamp) < 30 * 1000 - # only report one error every thirty seconds to avoid overload - if not rateLimited - @captureException(attributes, message, "error") + # have we recently reported an error? + recentSentryReport = (now - @lastErrorTimeStamp) < 60 * 1000 + # if so, increment the error count + if recentSentryReport + @lastErrorCount++ + else + @lastErrorCount = 0 @lastErrorTimeStamp = now + # only report 5 errors every minute to avoid overload + if @lastErrorCount <= MAX_ERRORS + # add a note if the rate limit has been hit + note = if @lastErrorCount is MAX_ERRORS then "(rate limited)" else "" + # report the exception + @captureException(attributes, message, "error#{note}") err: () -> @error.apply(this, arguments) warn: ()-> diff --git a/libraries/logger/package.json b/libraries/logger/package.json index f4b9ff841f..d7dfcc80df 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "http://github.com/sharelatex/logger-sharelatex.git" }, - "version": "1.5.5", + "version": "1.5.6", "dependencies": { "bunyan": "1.5.1", "coffee-script": "1.12.4", From 7cf65d072dd9a1819ed8b0a664f513ac7f38b35d Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Mon, 27 Mar 2017 15:28:36 +0100 Subject: [PATCH 26/93] Add a .nvmrc file --- libraries/logger/.nvmrc | 1 + 1 file changed, 1 insertion(+) create mode 100644 libraries/logger/.nvmrc diff --git a/libraries/logger/.nvmrc b/libraries/logger/.nvmrc new file mode 100644 index 0000000000..d87edbfc10 --- /dev/null +++ b/libraries/logger/.nvmrc @@ -0,0 +1 @@ +4.2.1 \ No newline at end of file From c7a6f44b11d3bab909aaa93bd054f8cd9ae7fd35 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 28 Mar 2017 15:54:12 +0100 Subject: [PATCH 27/93] add unit tests --- libraries/logger/package.json | 12 +++- .../unit/coffee/loggingManagerTests.coffee | 65 +++++++++++++++++++ 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 libraries/logger/test/unit/coffee/loggingManagerTests.coffee diff --git a/libraries/logger/package.json b/libraries/logger/package.json index d7dfcc80df..5be4136be8 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -9,7 +9,17 @@ "version": "1.5.6", "dependencies": { "bunyan": "1.5.1", + "chai": "", "coffee-script": "1.12.4", - "raven": "^1.1.3" + "grunt": "^0.4.5", + "grunt-bunyan": "^0.5.0", + "grunt-contrib-clean": "^0.6.0", + "grunt-contrib-coffee": "^0.11.0", + "grunt-execute": "^0.2.2", + "grunt-mocha-test": "^0.11.0", + "raven": "^1.1.3", + "sandboxed-module": "", + "sinon": "", + "timekeeper": "^1.0.0" } } diff --git a/libraries/logger/test/unit/coffee/loggingManagerTests.coffee b/libraries/logger/test/unit/coffee/loggingManagerTests.coffee new file mode 100644 index 0000000000..307bca4a1e --- /dev/null +++ b/libraries/logger/test/unit/coffee/loggingManagerTests.coffee @@ -0,0 +1,65 @@ +require('coffee-script') +chai = require('chai') +should = chai.should() +expect = chai.expect +path = require('path') +modulePath = path.join __dirname, '../../../logging-manager.coffee' +SandboxedModule = require('sandboxed-module') +sinon = require("sinon") +tk = require("timekeeper") + +describe 'logger.error', -> + + beforeEach -> + @captureException = sinon.stub() + @start = Date.now() + tk.travel(new Date(@start)) + @LoggingManager = SandboxedModule.require modulePath, requires: + 'bunyan': {createLogger: sinon.stub().returns({error:sinon.stub()})} + 'raven': {Client: sinon.stub().returns({captureException:@captureException})} + @logger = @LoggingManager.initialize("test") + @logger.initializeErrorReporting("test_dsn") + + it 'should report a single error to sentry', () -> + @logger.error {foo:'bar'}, "message" + @captureException.called.should.equal true + + + it 'for multiple errors should only report a maximum of 5 errors to sentry', () -> + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @captureException.callCount.should.equal 5 + + it 'for multiple errors with a minute delay should report 10 errors to sentry', () -> + # the first five errors should be reported to sentry + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + # the following errors should not be reported + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + # allow a minute to pass + tk.travel(new Date(@start + 61*10000)); + # after a minute the next five errors should be reported to sentry + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + # the following errors should not be reported to sentry + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @captureException.callCount.should.equal 10 From 9c7494eb671c8953e68817467a6df88ce1a4bbc5 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Wed, 29 Mar 2017 13:34:55 +0100 Subject: [PATCH 28/93] fix off-by-one error in error count --- libraries/logger/logging-manager.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee index 2dff9d6272..ad6c8c4787 100644 --- a/libraries/logger/logging-manager.coffee +++ b/libraries/logger/logging-manager.coffee @@ -71,9 +71,9 @@ module.exports = Logger = @lastErrorCount = 0 @lastErrorTimeStamp = now # only report 5 errors every minute to avoid overload - if @lastErrorCount <= MAX_ERRORS + if @lastErrorCount < MAX_ERRORS # add a note if the rate limit has been hit - note = if @lastErrorCount is MAX_ERRORS then "(rate limited)" else "" + note = if @lastErrorCount+1 is MAX_ERRORS then "(rate limited)" else "" # report the exception @captureException(attributes, message, "error#{note}") err: () -> From f707c835b9895893fe8fc1d923e6b140a641bcfd Mon Sep 17 00:00:00 2001 From: James Allen Date: Thu, 7 Dec 2017 09:36:12 +0000 Subject: [PATCH 29/93] Add debug level --- libraries/logger/logging-manager.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee index ad6c8c4787..a2e2616193 100644 --- a/libraries/logger/logging-manager.coffee +++ b/libraries/logger/logging-manager.coffee @@ -53,6 +53,8 @@ module.exports = Logger = catch return # ignore any errors + debug : () -> + @logger.debug.apply(@logger, arguments) info : ()-> @logger.info.apply(@logger, arguments) log : ()-> From 86ea1d3b57106d0f594d0cfbf38317750cc5ba50 Mon Sep 17 00:00:00 2001 From: James Allen Date: Thu, 7 Dec 2017 09:36:43 +0000 Subject: [PATCH 30/93] Bump version to 1.5.7 --- libraries/logger/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 5be4136be8..a0fc8c60e6 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "http://github.com/sharelatex/logger-sharelatex.git" }, - "version": "1.5.6", + "version": "1.5.7", "dependencies": { "bunyan": "1.5.1", "chai": "", From 3676f78ff9b259ffc375b0415bd23731335ab8a2 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Fri, 2 Nov 2018 15:53:21 +0000 Subject: [PATCH 31/93] avoid reporting the same error object more than once --- libraries/logger/logging-manager.coffee | 6 ++++++ .../test/unit/coffee/loggingManagerTests.coffee | 15 +++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee index a2e2616193..95fa048740 100644 --- a/libraries/logger/logging-manager.coffee +++ b/libraries/logger/logging-manager.coffee @@ -19,6 +19,9 @@ module.exports = Logger = attributes = {err: new Error(attributes)} # extract any error object error = attributes.err or attributes.error + # avoid reporting errors twice + for key, value of attributes + return if value instanceof Error && value.reportedToSentry # include our log message in the error report if not error? error = {message: message} if typeof message is 'string' @@ -50,6 +53,9 @@ module.exports = Logger = # send the error to sentry try @raven.captureException(error, {tags: tags, extra: extra, level: level}) + # put a flag on the errors to avoid reporting them multiple times + for key, value of attributes + value.reportedToSentry = true if value instanceof Error catch return # ignore any errors diff --git a/libraries/logger/test/unit/coffee/loggingManagerTests.coffee b/libraries/logger/test/unit/coffee/loggingManagerTests.coffee index 307bca4a1e..3b50a880bb 100644 --- a/libraries/logger/test/unit/coffee/loggingManagerTests.coffee +++ b/libraries/logger/test/unit/coffee/loggingManagerTests.coffee @@ -1,3 +1,6 @@ +# run this with +# ./node_modules/.bin/mocha --reporter tap --compilers coffee:coffee-script/register test/unit/coffee/loggingManagerTests.coffee + require('coffee-script') chai = require('chai') should = chai.should() @@ -24,6 +27,18 @@ describe 'logger.error', -> @logger.error {foo:'bar'}, "message" @captureException.called.should.equal true + it 'should report the same error to sentry only once', () -> + error1 = new Error('this is the error') + @logger.error {foo: error1}, "first message" + @logger.error {bar: error1}, "second message" + @captureException.callCount.should.equal 1 + + it 'should report two different errors to sentry individually', () -> + error1 = new Error('this is the error') + error2 = new Error('this is the error') + @logger.error {foo: error1}, "first message" + @logger.error {bar: error2}, "second message" + @captureException.callCount.should.equal 2 it 'for multiple errors should only report a maximum of 5 errors to sentry', () -> @logger.error {foo:'bar'}, "message" From df3b889f5086836116762c9dc3cbf7a094b3be67 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 6 Nov 2018 08:36:54 +0000 Subject: [PATCH 32/93] remove the path in the message from fs errors --- libraries/logger/logging-manager.coffee | 4 ++++ .../logger/test/unit/coffee/loggingManagerTests.coffee | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee index 95fa048740..d76b7b96cd 100644 --- a/libraries/logger/logging-manager.coffee +++ b/libraries/logger/logging-manager.coffee @@ -50,6 +50,10 @@ module.exports = Logger = for own key, value of error newError[key] = value error = newError + # filter paths from the message to avoid duplicate errors in sentry + # (e.g. errors from `fs` methods which have a path attribute) + try + error.message = error.message.replace(" '#{error.path}'", '') if error.path # send the error to sentry try @raven.captureException(error, {tags: tags, extra: extra, level: level}) diff --git a/libraries/logger/test/unit/coffee/loggingManagerTests.coffee b/libraries/logger/test/unit/coffee/loggingManagerTests.coffee index 3b50a880bb..ab2a1dba0c 100644 --- a/libraries/logger/test/unit/coffee/loggingManagerTests.coffee +++ b/libraries/logger/test/unit/coffee/loggingManagerTests.coffee @@ -40,6 +40,12 @@ describe 'logger.error', -> @logger.error {bar: error2}, "second message" @captureException.callCount.should.equal 2 + it 'should remove the path from fs errors', () -> + fsError = new Error("Error: ENOENT: no such file or directory, stat '/tmp/3279b8d0-da10-11e8-8255-efd98985942b'") + fsError.path = "/tmp/3279b8d0-da10-11e8-8255-efd98985942b" + @logger.error {err: fsError}, "message" + @captureException.calledWith(sinon.match.has('message', 'Error: ENOENT: no such file or directory, stat')).should.equal true + it 'for multiple errors should only report a maximum of 5 errors to sentry', () -> @logger.error {foo:'bar'}, "message" @logger.error {foo:'bar'}, "message" From cd81a602fd4d22b3b1ab2d674f89f59654323410 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 6 Nov 2018 10:56:58 +0000 Subject: [PATCH 33/93] increment version to 1.5.8 --- libraries/logger/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/logger/package.json b/libraries/logger/package.json index a0fc8c60e6..277c2b76d5 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "http://github.com/sharelatex/logger-sharelatex.git" }, - "version": "1.5.7", + "version": "1.5.8", "dependencies": { "bunyan": "1.5.1", "chai": "", From a2ed1829424b2d969cb00c6a2ec685c260b0c6cb Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Fri, 14 Dec 2018 14:30:01 +0000 Subject: [PATCH 34/93] add process.env['LOG_LEVEL'] varable to let us change the logging level --- libraries/logger/logging-manager.coffee | 2 ++ libraries/logger/package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee index d76b7b96cd..b0999ace08 100644 --- a/libraries/logger/logging-manager.coffee +++ b/libraries/logger/logging-manager.coffee @@ -2,9 +2,11 @@ bunyan = require('bunyan') module.exports = Logger = initialize: (name) -> + level = process.env['LOG_LEVEL'] or "debug" @logger = bunyan.createLogger name: name serializers: bunyan.stdSerializers + level: level return @ initializeErrorReporting: (sentry_dsn, options) -> diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 277c2b76d5..ddd8d8971f 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "http://github.com/sharelatex/logger-sharelatex.git" }, - "version": "1.5.8", + "version": "1.5.9", "dependencies": { "bunyan": "1.5.1", "chai": "", From 8764c7378be929002689a3d70f334b1d8f067847 Mon Sep 17 00:00:00 2001 From: Ersun Warncke Date: Tue, 22 Jan 2019 13:31:05 +0000 Subject: [PATCH 35/93] check dynamic log level in gce metadata --- libraries/logger/logging-manager.coffee | 25 +- libraries/logger/package.json | 21 +- .../unit/coffee/loggingManagerTests.coffee | 294 +++++++++++++----- 3 files changed, 254 insertions(+), 86 deletions(-) diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee index b0999ace08..509dbcc026 100644 --- a/libraries/logger/logging-manager.coffee +++ b/libraries/logger/logging-manager.coffee @@ -1,14 +1,33 @@ bunyan = require('bunyan') +request = require('request') module.exports = Logger = initialize: (name) -> - level = process.env['LOG_LEVEL'] or "debug" + @defaultLevel = process.env['LOG_LEVEL'] or if process.env["NODE_ENV"] == 'production' then "warn" else "debug" + @loggerName = name @logger = bunyan.createLogger name: name serializers: bunyan.stdSerializers - level: level + level: @defaultLevel + if process.env["NODE_ENV"] == 'production' + # check for log level override on startup + @.checkLogLevel() + # re-check log level every minute + checkLogLevel = () => @.checkLogLevel() + setInterval(checkLogLevel, 1000 * 60) return @ + checkLogLevel: () -> + options = + headers: + "Metadata-Flavor": "Google" + uri: "http://metadata.google.internal/computeMetadata/v1/project/attributes/#{@loggerName}-setLogLevelEndTime" + request options, (err, response, body) => + if parseInt(body) > Date.now() + @logger.level('trace') + else + @logger.level(@defaultLevel) + initializeErrorReporting: (sentry_dsn, options) -> raven = require "raven" @raven = new raven.Client(sentry_dsn, options) @@ -94,7 +113,7 @@ module.exports = Logger = @error.apply(this, arguments) warn: ()-> @logger.warn.apply(@logger, arguments) - fatal: (attributes, message, callback) -> + fatal: (attributes, message, callback = () ->) -> @logger.fatal(attributes, message) if @raven? cb = (e) -> # call the callback once after 'logged' or 'error' event diff --git a/libraries/logger/package.json b/libraries/logger/package.json index ddd8d8971f..69f5260d40 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -7,19 +7,20 @@ "url": "http://github.com/sharelatex/logger-sharelatex.git" }, "version": "1.5.9", + "scripts": { + "test": "mocha --require coffee-script/register test/**/*.coffee" + }, "dependencies": { "bunyan": "1.5.1", - "chai": "", "coffee-script": "1.12.4", - "grunt": "^0.4.5", - "grunt-bunyan": "^0.5.0", - "grunt-contrib-clean": "^0.6.0", - "grunt-contrib-coffee": "^0.11.0", - "grunt-execute": "^0.2.2", - "grunt-mocha-test": "^0.11.0", "raven": "^1.1.3", - "sandboxed-module": "", - "sinon": "", - "timekeeper": "^1.0.0" + "request": "^2.88.0" + }, + "devDependencies": { + "chai": "^4.2.0", + "mocha": "^5.2.0", + "sandboxed-module": "0.2.0", + "sinon": "^7.2.3", + "sinon-chai": "^3.3.0" } } diff --git a/libraries/logger/test/unit/coffee/loggingManagerTests.coffee b/libraries/logger/test/unit/coffee/loggingManagerTests.coffee index ab2a1dba0c..04dd848c25 100644 --- a/libraries/logger/test/unit/coffee/loggingManagerTests.coffee +++ b/libraries/logger/test/unit/coffee/loggingManagerTests.coffee @@ -1,86 +1,234 @@ -# run this with -# ./node_modules/.bin/mocha --reporter tap --compilers coffee:coffee-script/register test/unit/coffee/loggingManagerTests.coffee - -require('coffee-script') -chai = require('chai') -should = chai.should() -expect = chai.expect -path = require('path') -modulePath = path.join __dirname, '../../../logging-manager.coffee' -SandboxedModule = require('sandboxed-module') +SandboxedModule = require("sandboxed-module") +chai = require("chai") +path = require("path") sinon = require("sinon") -tk = require("timekeeper") +sinonChai = require("sinon-chai") -describe 'logger.error', -> +chai.use(sinonChai) +chai.should() + +modulePath = path.join __dirname, '../../../logging-manager.coffee' + +describe 'LoggingManager', -> beforeEach -> - @captureException = sinon.stub() @start = Date.now() - tk.travel(new Date(@start)) + @clock = sinon.useFakeTimers(@start) + @captureException = sinon.stub() + @mockBunyanLogger = + debug: sinon.stub() + error: sinon.stub() + fatal: sinon.stub() + info: sinon.stub() + level: sinon.stub() + warn: sinon.stub() + @mockRavenClient = + captureException: @captureException + once: sinon.stub().yields() @LoggingManager = SandboxedModule.require modulePath, requires: - 'bunyan': {createLogger: sinon.stub().returns({error:sinon.stub()})} - 'raven': {Client: sinon.stub().returns({captureException:@captureException})} - @logger = @LoggingManager.initialize("test") + bunyan: @Bunyan = createLogger: sinon.stub().returns(@mockBunyanLogger) + raven: @Raven = Client: sinon.stub().returns(@mockRavenClient) + request: @Request = sinon.stub() + @loggerName = "test" + @logger = @LoggingManager.initialize(@loggerName) @logger.initializeErrorReporting("test_dsn") - it 'should report a single error to sentry', () -> - @logger.error {foo:'bar'}, "message" - @captureException.called.should.equal true + afterEach -> + @clock.restore() - it 'should report the same error to sentry only once', () -> - error1 = new Error('this is the error') - @logger.error {foo: error1}, "first message" - @logger.error {bar: error1}, "second message" - @captureException.callCount.should.equal 1 + describe 'initialize', -> + beforeEach -> + @LoggingManager.checkLogLevel = sinon.stub() + @Bunyan.createLogger.reset() - it 'should report two different errors to sentry individually', () -> - error1 = new Error('this is the error') - error2 = new Error('this is the error') - @logger.error {foo: error1}, "first message" - @logger.error {bar: error2}, "second message" - @captureException.callCount.should.equal 2 + describe "not in production", -> + beforeEach -> + @LoggingManager.initialize() - it 'should remove the path from fs errors', () -> - fsError = new Error("Error: ENOENT: no such file or directory, stat '/tmp/3279b8d0-da10-11e8-8255-efd98985942b'") - fsError.path = "/tmp/3279b8d0-da10-11e8-8255-efd98985942b" - @logger.error {err: fsError}, "message" - @captureException.calledWith(sinon.match.has('message', 'Error: ENOENT: no such file or directory, stat')).should.equal true + it 'should default to log level debug', -> + @Bunyan.createLogger.should.have.been.calledWithMatch level: "debug" - it 'for multiple errors should only report a maximum of 5 errors to sentry', () -> - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @captureException.callCount.should.equal 5 + it 'should not run checkLogLevel', -> + @LoggingManager.checkLogLevel.should.not.have.been.called - it 'for multiple errors with a minute delay should report 10 errors to sentry', () -> - # the first five errors should be reported to sentry - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - # the following errors should not be reported - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - # allow a minute to pass - tk.travel(new Date(@start + 61*10000)); - # after a minute the next five errors should be reported to sentry - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - # the following errors should not be reported to sentry - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @captureException.callCount.should.equal 10 + describe "in production", -> + beforeEach -> + process.env.NODE_ENV = 'production' + @LoggingManager.initialize() + + afterEach -> + delete process.env.NODE_ENV + + it 'should default to log level warn', -> + @Bunyan.createLogger.should.have.been.calledWithMatch level: "warn" + + it 'should run checkLogLevel', -> + @LoggingManager.checkLogLevel.should.have.been.calledOnce + + describe 'after 1 minute', -> + it 'should run checkLogLevel again', -> + @clock.tick(61*1000) + @LoggingManager.checkLogLevel.should.have.been.calledTwice + + describe 'after 2 minutes', -> + it 'should run checkLogLevel again', -> + @clock.tick(121*1000) + @LoggingManager.checkLogLevel.should.have.been.calledThrice + + describe "when LOG_LEVEL set in env", -> + beforeEach -> + process.env.LOG_LEVEL = "trace" + @LoggingManager.initialize() + + afterEach -> + delete process.env.LOG_LEVEL + + it "should use custom log level", -> + @Bunyan.createLogger.should.have.been.calledWithMatch level: "trace" + + describe 'bunyan logging', -> + beforeEach -> + @logArgs = [ foo: "bar", "foo", "bar" ] + + it 'should log debug', -> + @logger.debug @logArgs + @mockBunyanLogger.debug.should.have.been.calledWith @logArgs + + it 'should log error', -> + @logger.error @logArgs + @mockBunyanLogger.error.should.have.been.calledWith @logArgs + + it 'should log fatal', -> + @logger.fatal @logArgs + @mockBunyanLogger.fatal.should.have.been.calledWith @logArgs + + it 'should log info', -> + @logger.info @logArgs + @mockBunyanLogger.info.should.have.been.calledWith @logArgs + + it 'should log warn', -> + @logger.warn @logArgs + @mockBunyanLogger.warn.should.have.been.calledWith @logArgs + + it 'should log err', -> + @logger.err @logArgs + @mockBunyanLogger.error.should.have.been.calledWith @logArgs + + it 'should log log', -> + @logger.log @logArgs + @mockBunyanLogger.info.should.have.been.calledWith @logArgs + + describe 'logger.error', -> + it 'should report a single error to sentry', () -> + @logger.error {foo:'bar'}, "message" + @captureException.called.should.equal true + + it 'should report the same error to sentry only once', () -> + error1 = new Error('this is the error') + @logger.error {foo: error1}, "first message" + @logger.error {bar: error1}, "second message" + @captureException.callCount.should.equal 1 + + it 'should report two different errors to sentry individually', () -> + error1 = new Error('this is the error') + error2 = new Error('this is the error') + @logger.error {foo: error1}, "first message" + @logger.error {bar: error2}, "second message" + @captureException.callCount.should.equal 2 + + it 'should remove the path from fs errors', () -> + fsError = new Error("Error: ENOENT: no such file or directory, stat '/tmp/3279b8d0-da10-11e8-8255-efd98985942b'") + fsError.path = "/tmp/3279b8d0-da10-11e8-8255-efd98985942b" + @logger.error {err: fsError}, "message" + @captureException.calledWith(sinon.match.has('message', 'Error: ENOENT: no such file or directory, stat')).should.equal true + + it 'for multiple errors should only report a maximum of 5 errors to sentry', () -> + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @captureException.callCount.should.equal 5 + + it 'for multiple errors with a minute delay should report 10 errors to sentry', () -> + # the first five errors should be reported to sentry + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + # the following errors should not be reported + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + # allow a minute to pass + @clock.tick(@start+ 61*1000) + # after a minute the next five errors should be reported to sentry + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + # the following errors should not be reported to sentry + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @logger.error {foo:'bar'}, "message" + @captureException.callCount.should.equal 10 + + describe 'checkLogLevel', -> + it 'should request log level override from google meta data service', -> + @LoggingManager.checkLogLevel() + options = + headers: + "Metadata-Flavor": "Google" + uri: "http://metadata.google.internal/computeMetadata/v1/project/attributes/#{@loggerName}-setLogLevelEndTime" + @Request.should.have.been.calledWithMatch options + + describe 'when request has error', -> + beforeEach -> + @Request.yields "error" + @LoggingManager.checkLogLevel() + + it "should only set default level", -> + @mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith('debug') + + describe 'when statusCode is not 200', -> + beforeEach -> + @Request.yields null, statusCode: 404 + @LoggingManager.checkLogLevel() + + it "should only set default level", -> + @mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith('debug') + + describe 'when time value returned that is less than current time', -> + beforeEach -> + @Request.yields null, statusCode: 200, '1' + @LoggingManager.checkLogLevel() + + it "should only set default level", -> + @mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith('debug') + + describe 'when time value returned that is less than current time', -> + describe 'when level is already set', -> + beforeEach -> + @mockBunyanLogger.level.returns(10) + @Request.yields null, statusCode: 200, @start + 1000 + @LoggingManager.checkLogLevel() + + it "should set trace level", -> + @mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith('trace') + + describe 'when level is not already set', -> + beforeEach -> + @mockBunyanLogger.level.returns(20) + @Request.yields null, statusCode: 200, @start + 1000 + @LoggingManager.checkLogLevel() + + it "should set trace level", -> + @mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith('trace') From 128c9f7c3911bf442b2bf7fc8fb7c3823342c6a0 Mon Sep 17 00:00:00 2001 From: Ersun Warncke Date: Tue, 29 Jan 2019 12:00:14 -0400 Subject: [PATCH 36/93] lower case prod check, bump version --- libraries/logger/logging-manager.coffee | 5 +++-- libraries/logger/package.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee index 509dbcc026..a7d4e6d27b 100644 --- a/libraries/logger/logging-manager.coffee +++ b/libraries/logger/logging-manager.coffee @@ -3,13 +3,14 @@ request = require('request') module.exports = Logger = initialize: (name) -> - @defaultLevel = process.env['LOG_LEVEL'] or if process.env["NODE_ENV"] == 'production' then "warn" else "debug" + isProduction = process.env['NODE_ENV']?.toLowerCase() == 'production' + @defaultLevel = process.env['LOG_LEVEL'] or if isProduction then "warn" else "debug" @loggerName = name @logger = bunyan.createLogger name: name serializers: bunyan.stdSerializers level: @defaultLevel - if process.env["NODE_ENV"] == 'production' + if isProduction # check for log level override on startup @.checkLogLevel() # re-check log level every minute diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 69f5260d40..96d8d7dd8a 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "http://github.com/sharelatex/logger-sharelatex.git" }, - "version": "1.5.9", + "version": "1.6.0", "scripts": { "test": "mocha --require coffee-script/register test/**/*.coffee" }, From 5a6e00e12b2f045ead4f343344c294208ddd8aba Mon Sep 17 00:00:00 2001 From: Ersun Warncke Date: Wed, 6 Mar 2019 16:08:38 -0400 Subject: [PATCH 37/93] decaf --- libraries/logger/index.js | 3 +- .../loggingManagerTests.coffee | 0 libraries/logger/logging-manager.coffee | 129 --- libraries/logger/logging-manager.js | 221 +++++ libraries/logger/package-lock.json | 826 ++++++++++++++++++ libraries/logger/package.json | 5 +- .../logger/test/unit/loggingManagerTests.js | 302 +++++++ 7 files changed, 1352 insertions(+), 134 deletions(-) rename libraries/logger/{test/unit/coffee => logger-tests-coffee}/loggingManagerTests.coffee (100%) delete mode 100644 libraries/logger/logging-manager.coffee create mode 100644 libraries/logger/logging-manager.js create mode 100644 libraries/logger/package-lock.json create mode 100644 libraries/logger/test/unit/loggingManagerTests.js diff --git a/libraries/logger/index.js b/libraries/logger/index.js index dedfe4be5d..b8877921d5 100755 --- a/libraries/logger/index.js +++ b/libraries/logger/index.js @@ -1,2 +1 @@ -require("coffee-script/register") -module.exports = require('./logging-manager'); +module.exports = require('./logging-manager.js'); diff --git a/libraries/logger/test/unit/coffee/loggingManagerTests.coffee b/libraries/logger/logger-tests-coffee/loggingManagerTests.coffee similarity index 100% rename from libraries/logger/test/unit/coffee/loggingManagerTests.coffee rename to libraries/logger/logger-tests-coffee/loggingManagerTests.coffee diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee deleted file mode 100644 index a7d4e6d27b..0000000000 --- a/libraries/logger/logging-manager.coffee +++ /dev/null @@ -1,129 +0,0 @@ -bunyan = require('bunyan') -request = require('request') - -module.exports = Logger = - initialize: (name) -> - isProduction = process.env['NODE_ENV']?.toLowerCase() == 'production' - @defaultLevel = process.env['LOG_LEVEL'] or if isProduction then "warn" else "debug" - @loggerName = name - @logger = bunyan.createLogger - name: name - serializers: bunyan.stdSerializers - level: @defaultLevel - if isProduction - # check for log level override on startup - @.checkLogLevel() - # re-check log level every minute - checkLogLevel = () => @.checkLogLevel() - setInterval(checkLogLevel, 1000 * 60) - return @ - - checkLogLevel: () -> - options = - headers: - "Metadata-Flavor": "Google" - uri: "http://metadata.google.internal/computeMetadata/v1/project/attributes/#{@loggerName}-setLogLevelEndTime" - request options, (err, response, body) => - if parseInt(body) > Date.now() - @logger.level('trace') - else - @logger.level(@defaultLevel) - - initializeErrorReporting: (sentry_dsn, options) -> - raven = require "raven" - @raven = new raven.Client(sentry_dsn, options) - @lastErrorTimeStamp = 0 # for rate limiting on sentry reporting - @lastErrorCount = 0 - - captureException: (attributes, message, level) -> - # handle case of logger.error "message" - if typeof attributes is 'string' - attributes = {err: new Error(attributes)} - # extract any error object - error = attributes.err or attributes.error - # avoid reporting errors twice - for key, value of attributes - return if value instanceof Error && value.reportedToSentry - # include our log message in the error report - if not error? - error = {message: message} if typeof message is 'string' - else if message? - attributes.description = message - # report the error - if error? - # capture attributes and use *_id objects as tags - tags = {} - extra = {} - for key, value of attributes - tags[key] = value if key.match(/_id/) and typeof value == 'string' - extra[key] = value - # capture req object if available - req = attributes.req - if req? - extra.req = - method: req.method - url: req.originalUrl - query: req.query - headers: req.headers - ip: req.ip - # recreate error objects that have been converted to a normal object - if !(error instanceof Error) and typeof error is "object" - newError = new Error(error.message) - for own key, value of error - newError[key] = value - error = newError - # filter paths from the message to avoid duplicate errors in sentry - # (e.g. errors from `fs` methods which have a path attribute) - try - error.message = error.message.replace(" '#{error.path}'", '') if error.path - # send the error to sentry - try - @raven.captureException(error, {tags: tags, extra: extra, level: level}) - # put a flag on the errors to avoid reporting them multiple times - for key, value of attributes - value.reportedToSentry = true if value instanceof Error - catch - return # ignore any errors - - debug : () -> - @logger.debug.apply(@logger, arguments) - info : ()-> - @logger.info.apply(@logger, arguments) - log : ()-> - @logger.info.apply(@logger, arguments) - error: (attributes, message, args...)-> - @logger.error(attributes, message, args...) - if @raven? - MAX_ERRORS = 5 # maximum number of errors in 1 minute - now = new Date() - # have we recently reported an error? - recentSentryReport = (now - @lastErrorTimeStamp) < 60 * 1000 - # if so, increment the error count - if recentSentryReport - @lastErrorCount++ - else - @lastErrorCount = 0 - @lastErrorTimeStamp = now - # only report 5 errors every minute to avoid overload - if @lastErrorCount < MAX_ERRORS - # add a note if the rate limit has been hit - note = if @lastErrorCount+1 is MAX_ERRORS then "(rate limited)" else "" - # report the exception - @captureException(attributes, message, "error#{note}") - err: () -> - @error.apply(this, arguments) - warn: ()-> - @logger.warn.apply(@logger, arguments) - fatal: (attributes, message, callback = () ->) -> - @logger.fatal(attributes, message) - if @raven? - cb = (e) -> # call the callback once after 'logged' or 'error' event - callback() - cb = () -> - @captureException(attributes, message, "fatal") - @raven.once 'logged', cb - @raven.once 'error', cb - else - callback() - -Logger.initialize("default-sharelatex") diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js new file mode 100644 index 0000000000..f57ce9ca9d --- /dev/null +++ b/libraries/logger/logging-manager.js @@ -0,0 +1,221 @@ +/* + * decaffeinate suggestions: + * DS101: Remove unnecessary use of Array.from + * DS102: Remove unnecessary code created because of implicit returns + * DS203: Remove `|| {}` from converted for-own loops + * DS205: Consider reworking code to avoid use of IIFEs + * DS207: Consider shorter variations of null checks + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md + */ + +const bunyan = require('bunyan'); +const request = require('request'); + +const LOG_METHODS = [ + 'debug', 'info', 'log', 'error', 'err', 'warn', 'fatal' +] + +class Logger { + + constructor(name) { + const isProduction = (process.env['NODE_ENV'] || '').toLowerCase() === 'production'; + this.defaultLevel = process.env['LOG_LEVEL'] || (isProduction ? "warn" : "debug"); + this.loggerName = name; + this.logger = bunyan.createLogger({ + name, + serializers: bunyan.stdSerializers, + level: this.defaultLevel + }); + if (isProduction) { + // check for log level override on startup + this.checkLogLevel(); + // re-check log level every minute + const checkLogLevel = () => this.checkLogLevel(); + setInterval(checkLogLevel, 1000 * 60); + } + return this; + } + + checkLogLevel() { + const options = { + headers: { + "Metadata-Flavor": "Google" + }, + uri: `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` + }; + return request(options, (err, response, body) => { + if (parseInt(body) > Date.now()) { + return this.logger.level('trace'); + } else { + return this.logger.level(this.defaultLevel); + } + }); + } + + initializeErrorReporting(sentry_dsn, options) { + const raven = require("raven"); + this.raven = new raven.Client(sentry_dsn, options); + this.lastErrorTimeStamp = 0; // for rate limiting on sentry reporting + return this.lastErrorCount = 0; + } + + captureException(attributes, message, level) { + // handle case of logger.error "message" + let key, value; + if (typeof attributes === 'string') { + attributes = {err: new Error(attributes)}; + } + // extract any error object + let error = attributes.err || attributes.error; + // avoid reporting errors twice + for (key in attributes) { + value = attributes[key]; + if (value instanceof Error && value.reportedToSentry) { return; } + } + // include our log message in the error report + if ((error == null)) { + if (typeof message === 'string') { error = {message}; } + } else if (message != null) { + attributes.description = message; + } + // report the error + if (error != null) { + // capture attributes and use *_id objects as tags + const tags = {}; + const extra = {}; + for (key in attributes) { + value = attributes[key]; + if (key.match(/_id/) && (typeof value === 'string')) { tags[key] = value; } + extra[key] = value; + } + // capture req object if available + const { req } = attributes; + if (req != null) { + extra.req = { + method: req.method, + url: req.originalUrl, + query: req.query, + headers: req.headers, + ip: req.ip + }; + } + // recreate error objects that have been converted to a normal object + if (!(error instanceof Error) && (typeof error === "object")) { + const newError = new Error(error.message); + for (key of Object.keys(error || {})) { + value = error[key]; + newError[key] = value; + } + error = newError; + } + // filter paths from the message to avoid duplicate errors in sentry + // (e.g. errors from `fs` methods which have a path attribute) + try { + if (error.path) { error.message = error.message.replace(` '${error.path}'`, ''); } + } catch (error1) {} + // send the error to sentry + try { + this.raven.captureException(error, {tags, extra, level}); + // put a flag on the errors to avoid reporting them multiple times + return (() => { + const result = []; + for (key in attributes) { + value = attributes[key]; + if (value instanceof Error) { result.push(value.reportedToSentry = true); } else { + result.push(undefined); + } + } + return result; + })(); + } catch (error2) { + return; + } + } + } + + debug() { + return this.logger.debug.apply(this.logger, arguments); + } + + info(){ + return this.logger.info.apply(this.logger, arguments); + } + + log(){ + return this.logger.info.apply(this.logger, arguments); + } + + error(attributes, message, ...args){ + this.logger.error(attributes, message, ...Array.from(args)); + if (this.raven != null) { + const MAX_ERRORS = 5; // maximum number of errors in 1 minute + const now = new Date(); + // have we recently reported an error? + const recentSentryReport = (now - this.lastErrorTimeStamp) < (60 * 1000); + // if so, increment the error count + if (recentSentryReport) { + this.lastErrorCount++; + } else { + this.lastErrorCount = 0; + this.lastErrorTimeStamp = now; + } + // only report 5 errors every minute to avoid overload + if (this.lastErrorCount < MAX_ERRORS) { + // add a note if the rate limit has been hit + const note = (this.lastErrorCount+1) === MAX_ERRORS ? "(rate limited)" : ""; + // report the exception + return this.captureException(attributes, message, `error${note}`); + } + } + } + + err() { + return this.error.apply(this, arguments); + } + + warn(){ + return this.logger.warn.apply(this.logger, arguments); + } + + fatal(attributes, message, callback) { + if (callback == null) { callback = function() {}; } + this.logger.fatal(attributes, message); + if (this.raven != null) { + var cb = function(e) { // call the callback once after 'logged' or 'error' event + callback(); + return cb = function() {}; + }; + this.captureException(attributes, message, "fatal"); + this.raven.once('logged', cb); + return this.raven.once('error', cb); + } else { + return callback(); + } + } +} + +let defaultLogger +// initialize default logger if not already initialized +if (!global.__logger_sharelatex__default_logger__) { + global.__logger_sharelatex__default_logger__ = defaultLogger = new Logger("default-sharelatex") +} +else { + defaultLogger = global.__logger_sharelatex__default_logger__ +} + +// support old interface for creating new Logger instances +Logger.initialize = function initialize(name) { + return new Logger(name) +} +// add a static method for each log method that will use the default logger +for (const logMethod of LOG_METHODS) { + Logger[logMethod] = function () { + return defaultLogger[logMethod].apply(defaultLogger, arguments) + } +} +// return default logger +Logger.defaultLogger = function defaultLogger () { + return defaultLogger +} + +module.exports = Logger diff --git a/libraries/logger/package-lock.json b/libraries/logger/package-lock.json new file mode 100644 index 0000000000..2a3b42cf20 --- /dev/null +++ b/libraries/logger/package-lock.json @@ -0,0 +1,826 @@ +{ + "name": "logger-sharelatex", + "version": "1.6.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@sinonjs/commons": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.4.0.tgz", + "integrity": "sha512-9jHK3YF/8HtJ9wCAbG+j8cD0i0+ATS9A7gXFqS36TblLPNy6rEEc+SB0imo91eCboGaBYGV/MT1/br/J+EE7Tw==", + "dev": true, + "requires": { + "type-detect": "4.0.8" + } + }, + "@sinonjs/formatio": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.2.1.tgz", + "integrity": "sha512-tsHvOB24rvyvV2+zKMmPkZ7dXX6LSLKZ7aOtXY6Edklp0uRcgGpOsQTTGTcWViFyx4uhWc6GV8QdnALbIbIdeQ==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1", + "@sinonjs/samsam": "^3.1.0" + } + }, + "@sinonjs/samsam": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.2.0.tgz", + "integrity": "sha512-j5F1rScewLtx6pbTK0UAjA3jJj4RYiSKOix53YWv+Jzy/AZ69qHxUpU8fwVLjyKbEEud9QrLpv6Ggs7WqTimYw==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.0.2", + "array-from": "^2.1.1", + "lodash": "^4.17.11" + } + }, + "@sinonjs/text-encoding": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", + "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", + "dev": true + }, + "ajv": { + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", + "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "array-from": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", + "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "bunyan": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.5.1.tgz", + "integrity": "sha1-X259RMQ7lS9WsPQTCeOrEjkbTi0=", + "requires": { + "dtrace-provider": "~0.6", + "mv": "~2", + "safe-json-stringify": "~1" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "chai": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", + "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.0", + "type-detect": "^4.0.5" + } + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true + }, + "combined-stream": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", + "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" + }, + "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=" + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "dtrace-provider": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/dtrace-provider/-/dtrace-provider-0.6.0.tgz", + "integrity": "sha1-CweNVReTfYcxAUUtkUZzdVe3XlE=", + "optional": true, + "requires": { + "nan": "^2.0.8" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", + "optional": true, + "requires": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "just-extend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.0.2.tgz", + "integrity": "sha512-FrLwOgm+iXrPV+5zDU6Jqu4gCRXbWEQg2O3SKONsWE4w7AXFRkryS53bpWdaL9cNol+AmR3AEYz6kn+o0fCPnw==", + "dev": true + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "lolex": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-3.1.0.tgz", + "integrity": "sha512-zFo5MgCJ0rZ7gQg69S4pqBsLURbFw11X68C18OcJjJQbqaXm2NoTrGl1IMM3TIz0/BnN1tIs2tzmmqvCsOMMjw==", + "dev": true + }, + "lsmod": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lsmod/-/lsmod-1.0.0.tgz", + "integrity": "sha1-mgD3bco26yP6BTUK/htYXUKZ5ks=" + }, + "mime-db": { + "version": "1.38.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", + "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==" + }, + "mime-types": { + "version": "2.1.22", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", + "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", + "requires": { + "mime-db": "~1.38.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + } + }, + "mocha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", + "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "dev": true, + "requires": { + "browser-stdout": "1.3.1", + "commander": "2.15.1", + "debug": "3.1.0", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.5", + "he": "1.1.1", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "supports-color": "5.4.0" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "mv": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/mv/-/mv-2.1.1.tgz", + "integrity": "sha1-rmzg1vbV4KT32JN5jQPB6pVZtqI=", + "optional": true, + "requires": { + "mkdirp": "~0.5.1", + "ncp": "~2.0.0", + "rimraf": "~2.4.0" + } + }, + "nan": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", + "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==", + "optional": true + }, + "ncp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", + "integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=", + "optional": true + }, + "nise": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/nise/-/nise-1.4.10.tgz", + "integrity": "sha512-sa0RRbj53dovjc7wombHmVli9ZihXbXCQ2uH3TNm03DyvOSIQbxg+pbqDKrk2oxMK1rtLGVlKxcB9rrc6X5YjA==", + "dev": true, + "requires": { + "@sinonjs/formatio": "^3.1.0", + "@sinonjs/text-encoding": "^0.7.1", + "just-extend": "^4.0.2", + "lolex": "^2.3.2", + "path-to-regexp": "^1.7.0" + }, + "dependencies": { + "lolex": { + "version": "2.7.5", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.7.5.tgz", + "integrity": "sha512-l9x0+1offnKKIzYVjyXU2SiwhXDLekRzKyhnbyldPHvC7BvLPVpdNUNR2KeMAiCN2D/kLNttZgQD5WjSxuBx3Q==", + "dev": true + } + } + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-to-regexp": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", + "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", + "dev": true, + "requires": { + "isarray": "0.0.1" + } + }, + "pathval": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", + "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", + "dev": true + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "psl": { + "version": "1.1.31", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", + "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==" + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "raven": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/raven/-/raven-1.2.1.tgz", + "integrity": "sha1-lJwTTbAooZC3u/j3kKrlQbfAIL0=", + "requires": { + "cookie": "0.3.1", + "json-stringify-safe": "5.0.1", + "lsmod": "1.0.0", + "stack-trace": "0.0.9", + "uuid": "3.0.0" + } + }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + } + } + }, + "require-like": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/require-like/-/require-like-0.1.2.tgz", + "integrity": "sha1-rW8wwTvs15cBDEaK+ndcDAprR/o=", + "dev": true + }, + "rimraf": { + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz", + "integrity": "sha1-7nEM5dk6j9uFb7Xqj/Di11k0sto=", + "optional": true, + "requires": { + "glob": "^6.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safe-json-stringify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz", + "integrity": "sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==", + "optional": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "sandboxed-module": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/sandboxed-module/-/sandboxed-module-2.0.3.tgz", + "integrity": "sha1-x+VFkzm7y6KMUwPusz9ug4e/upY=", + "dev": true, + "requires": { + "require-like": "0.1.2", + "stack-trace": "0.0.9" + } + }, + "sinon": { + "version": "7.2.7", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.2.7.tgz", + "integrity": "sha512-rlrre9F80pIQr3M36gOdoCEWzFAMDgHYD8+tocqOw+Zw9OZ8F84a80Ds69eZfcjnzDqqG88ulFld0oin/6rG/g==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.3.1", + "@sinonjs/formatio": "^3.2.1", + "@sinonjs/samsam": "^3.2.0", + "diff": "^3.5.0", + "lolex": "^3.1.0", + "nise": "^1.4.10", + "supports-color": "^5.5.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "sinon-chai": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/sinon-chai/-/sinon-chai-3.3.0.tgz", + "integrity": "sha512-r2JhDY7gbbmh5z3Q62pNbrjxZdOAjpsqW/8yxAZRSqLZqowmfGZPGUZPFf3UX36NLis0cv8VEM5IJh9HgkSOAA==", + "dev": true + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "stack-trace": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.9.tgz", + "integrity": "sha1-qPbq7KkGdMMz58Q5U/J1tFFRBpU=" + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + } + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "requires": { + "punycode": "^2.1.0" + } + }, + "uuid": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.0.0.tgz", + "integrity": "sha1-Zyj8BFnEUNeWqZwxg3VpvfZy1yg=" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + } + } +} diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 96d8d7dd8a..cd6b0ac64e 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -8,18 +8,17 @@ }, "version": "1.6.0", "scripts": { - "test": "mocha --require coffee-script/register test/**/*.coffee" + "test": "mocha test/**/*.js" }, "dependencies": { "bunyan": "1.5.1", - "coffee-script": "1.12.4", "raven": "^1.1.3", "request": "^2.88.0" }, "devDependencies": { "chai": "^4.2.0", "mocha": "^5.2.0", - "sandboxed-module": "0.2.0", + "sandboxed-module": "2.0.3", "sinon": "^7.2.3", "sinon-chai": "^3.3.0" } diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js new file mode 100644 index 0000000000..a808ac5f2c --- /dev/null +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -0,0 +1,302 @@ +/* + * decaffeinate suggestions: + * DS102: Remove unnecessary code created because of implicit returns + * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md + */ +const SandboxedModule = require("sandboxed-module"); +const chai = require("chai"); +const path = require("path"); +const sinon = require("sinon"); +const sinonChai = require("sinon-chai"); + +chai.use(sinonChai); +chai.should(); + +const modulePath = path.join(__dirname, '../../logging-manager.js'); + +describe('LoggingManager', function() { + + beforeEach(function() { + this.start = Date.now(); + this.clock = sinon.useFakeTimers(this.start); + this.captureException = sinon.stub(); + this.mockBunyanLogger = { + debug: sinon.stub(), + error: sinon.stub(), + fatal: sinon.stub(), + info: sinon.stub(), + level: sinon.stub(), + warn: sinon.stub() + }; + this.mockRavenClient = { + captureException: this.captureException, + once: sinon.stub().yields() + }; + this.LoggingManager = SandboxedModule.require(modulePath, { + globals: { console }, + requires: { + bunyan: (this.Bunyan = {createLogger: sinon.stub().returns(this.mockBunyanLogger)}), + raven: (this.Raven = {Client: sinon.stub().returns(this.mockRavenClient)}), + request: (this.Request = sinon.stub()), + }, + }); + this.loggerName = "test"; + this.logger = this.LoggingManager.initialize(this.loggerName); + this.logger.initializeErrorReporting("test_dsn"); + }); + + afterEach(function() { + this.clock.restore(); + }); + + describe('initialize', function() { + beforeEach(function() { + this.checkLogLevelStub = sinon.stub(this.LoggingManager.prototype, "checkLogLevel"); + this.Bunyan.createLogger.reset(); + }); + + afterEach(function () { + this.checkLogLevelStub.restore() + }) + + describe("not in production", function() { + beforeEach(function() { + this.logger = this.LoggingManager.initialize(this.loggerName) + }); + + it('should default to log level debug', function() { + this.Bunyan.createLogger.should.have.been.calledWithMatch({level: "debug"}); + }); + + it('should not run checkLogLevel', function() { + this.checkLogLevelStub.should.not.have.been.called; + }); + }); + + describe("in production", function() { + beforeEach(function() { + process.env.NODE_ENV = 'production'; + this.logger = this.LoggingManager.initialize(this.loggerName) + }); + + afterEach(() => delete process.env.NODE_ENV); + + it('should default to log level warn', function() { + this.Bunyan.createLogger.should.have.been.calledWithMatch({level: "warn"}); + }); + + it('should run checkLogLevel', function() { + this.checkLogLevelStub.should.have.been.calledOnce; + }); + + describe('after 1 minute', () => + it('should run checkLogLevel again', function() { + this.clock.tick(61*1000); + this.checkLogLevelStub.should.have.been.calledTwice; + }) + ); + + describe('after 2 minutes', () => + it('should run checkLogLevel again', function() { + this.clock.tick(121*1000); + this.checkLogLevelStub.should.have.been.calledThrice; + }) + ); + }); + + describe("when LOG_LEVEL set in env", function() { + beforeEach(function() { + process.env.LOG_LEVEL = "trace"; + this.LoggingManager.initialize(); + }); + + afterEach(() => delete process.env.LOG_LEVEL); + + it("should use custom log level", function() { + this.Bunyan.createLogger.should.have.been.calledWithMatch({level: "trace"}); + }); + }); + }); + + describe('bunyan logging', function() { + beforeEach(function() { + this.logArgs = [ {foo: "bar"}, "foo", "bar" ];}); + + it('should log debug', function() { + this.logger.debug(this.logArgs); + this.mockBunyanLogger.debug.should.have.been.calledWith(this.logArgs); + }); + + it('should log error', function() { + this.logger.error(this.logArgs); + this.mockBunyanLogger.error.should.have.been.calledWith(this.logArgs); + }); + + it('should log fatal', function() { + this.logger.fatal(this.logArgs); + this.mockBunyanLogger.fatal.should.have.been.calledWith(this.logArgs); + }); + + it('should log info', function() { + this.logger.info(this.logArgs); + this.mockBunyanLogger.info.should.have.been.calledWith(this.logArgs); + }); + + it('should log warn', function() { + this.logger.warn(this.logArgs); + this.mockBunyanLogger.warn.should.have.been.calledWith(this.logArgs); + }); + + it('should log err', function() { + this.logger.err(this.logArgs); + this.mockBunyanLogger.error.should.have.been.calledWith(this.logArgs); + }); + + it('should log log', function() { + this.logger.log(this.logArgs); + this.mockBunyanLogger.info.should.have.been.calledWith(this.logArgs); + }); + }); + + describe('logger.error', function() { + it('should report a single error to sentry', function() { + this.logger.error({foo:'bar'}, "message"); + this.captureException.called.should.equal(true); + }); + + it('should report the same error to sentry only once', function() { + const error1 = new Error('this is the error'); + this.logger.error({foo: error1}, "first message"); + this.logger.error({bar: error1}, "second message"); + this.captureException.callCount.should.equal(1); + }); + + it('should report two different errors to sentry individually', function() { + const error1 = new Error('this is the error'); + const error2 = new Error('this is the error'); + this.logger.error({foo: error1}, "first message"); + this.logger.error({bar: error2}, "second message"); + this.captureException.callCount.should.equal(2); + }); + + it('should remove the path from fs errors', function() { + const fsError = new Error("Error: ENOENT: no such file or directory, stat '/tmp/3279b8d0-da10-11e8-8255-efd98985942b'"); + fsError.path = "/tmp/3279b8d0-da10-11e8-8255-efd98985942b"; + this.logger.error({err: fsError}, "message"); + this.captureException.calledWith(sinon.match.has('message', 'Error: ENOENT: no such file or directory, stat')).should.equal(true); + }); + + it('for multiple errors should only report a maximum of 5 errors to sentry', function() { + this.logger.error({foo:'bar'}, "message"); + this.logger.error({foo:'bar'}, "message"); + this.logger.error({foo:'bar'}, "message"); + this.logger.error({foo:'bar'}, "message"); + this.logger.error({foo:'bar'}, "message"); + this.logger.error({foo:'bar'}, "message"); + this.logger.error({foo:'bar'}, "message"); + this.logger.error({foo:'bar'}, "message"); + this.logger.error({foo:'bar'}, "message"); + this.captureException.callCount.should.equal(5); + }); + + it('for multiple errors with a minute delay should report 10 errors to sentry', function() { + // the first five errors should be reported to sentry + this.logger.error({foo:'bar'}, "message"); + this.logger.error({foo:'bar'}, "message"); + this.logger.error({foo:'bar'}, "message"); + this.logger.error({foo:'bar'}, "message"); + this.logger.error({foo:'bar'}, "message"); + // the following errors should not be reported + this.logger.error({foo:'bar'}, "message"); + this.logger.error({foo:'bar'}, "message"); + this.logger.error({foo:'bar'}, "message"); + this.logger.error({foo:'bar'}, "message"); + // allow a minute to pass + this.clock.tick(this.start+ (61*1000)); + // after a minute the next five errors should be reported to sentry + this.logger.error({foo:'bar'}, "message"); + this.logger.error({foo:'bar'}, "message"); + this.logger.error({foo:'bar'}, "message"); + this.logger.error({foo:'bar'}, "message"); + this.logger.error({foo:'bar'}, "message"); + // the following errors should not be reported to sentry + this.logger.error({foo:'bar'}, "message"); + this.logger.error({foo:'bar'}, "message"); + this.logger.error({foo:'bar'}, "message"); + this.logger.error({foo:'bar'}, "message"); + this.captureException.callCount.should.equal(10); + }); + }); + + describe('checkLogLevel', function() { + it('should request log level override from google meta data service', function() { + this.logger.checkLogLevel(); + const options = { + headers: { + "Metadata-Flavor": "Google" + }, + uri: `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` + }; + this.Request.should.have.been.calledWithMatch(options); + }); + + describe('when request has error', function() { + beforeEach(function() { + this.Request.yields("error"); + this.logger.checkLogLevel(); + }); + + it("should only set default level", function() { + this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith('debug'); + }); + }); + + describe('when statusCode is not 200', function() { + beforeEach(function() { + this.Request.yields(null, {statusCode: 404}); + this.logger.checkLogLevel(); + }); + + it("should only set default level", function() { + this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith('debug'); + }); + }); + + describe('when time value returned that is less than current time', function() { + beforeEach(function() { + this.Request.yields(null, {statusCode: 200}, '1'); + this.logger.checkLogLevel(); + }); + + it("should only set default level", function() { + this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith('debug'); + }); + }); + + describe('when time value returned that is less than current time', function() { + describe('when level is already set', function() { + beforeEach(function() { + this.mockBunyanLogger.level.returns(10); + this.Request.yields(null, {statusCode: 200}, this.start + 1000); + this.logger.checkLogLevel(); + }); + + it("should set trace level", function() { + this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith('trace'); + }); + }); + + describe('when level is not already set', function() { + beforeEach(function() { + this.mockBunyanLogger.level.returns(20); + this.Request.yields(null, {statusCode: 200}, this.start + 1000); + this.logger.checkLogLevel(); + }); + + it("should set trace level", function() { + this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith('trace'); + }); + }); + }); + }); +}); From 83597e8723d474812a24bf2592e00c04ff8e5367 Mon Sep 17 00:00:00 2001 From: Ersun Warncke Date: Fri, 8 Mar 2019 10:09:44 -0400 Subject: [PATCH 38/93] use ring buffer for logging and include with error --- libraries/logger/index.js | 2 +- .../loggingManagerTests.coffee | 234 ------- libraries/logger/logging-manager.js | 417 +++++++------ libraries/logger/package-lock.json | 99 ++- libraries/logger/package.json | 16 +- .../logger/test/unit/loggingManagerTests.js | 571 ++++++++++-------- 6 files changed, 615 insertions(+), 724 deletions(-) delete mode 100644 libraries/logger/logger-tests-coffee/loggingManagerTests.coffee diff --git a/libraries/logger/index.js b/libraries/logger/index.js index b8877921d5..aeca420019 100755 --- a/libraries/logger/index.js +++ b/libraries/logger/index.js @@ -1 +1 @@ -module.exports = require('./logging-manager.js'); +module.exports = require("./logging-manager.js"); diff --git a/libraries/logger/logger-tests-coffee/loggingManagerTests.coffee b/libraries/logger/logger-tests-coffee/loggingManagerTests.coffee deleted file mode 100644 index 04dd848c25..0000000000 --- a/libraries/logger/logger-tests-coffee/loggingManagerTests.coffee +++ /dev/null @@ -1,234 +0,0 @@ -SandboxedModule = require("sandboxed-module") -chai = require("chai") -path = require("path") -sinon = require("sinon") -sinonChai = require("sinon-chai") - -chai.use(sinonChai) -chai.should() - -modulePath = path.join __dirname, '../../../logging-manager.coffee' - -describe 'LoggingManager', -> - - beforeEach -> - @start = Date.now() - @clock = sinon.useFakeTimers(@start) - @captureException = sinon.stub() - @mockBunyanLogger = - debug: sinon.stub() - error: sinon.stub() - fatal: sinon.stub() - info: sinon.stub() - level: sinon.stub() - warn: sinon.stub() - @mockRavenClient = - captureException: @captureException - once: sinon.stub().yields() - @LoggingManager = SandboxedModule.require modulePath, requires: - bunyan: @Bunyan = createLogger: sinon.stub().returns(@mockBunyanLogger) - raven: @Raven = Client: sinon.stub().returns(@mockRavenClient) - request: @Request = sinon.stub() - @loggerName = "test" - @logger = @LoggingManager.initialize(@loggerName) - @logger.initializeErrorReporting("test_dsn") - - afterEach -> - @clock.restore() - - describe 'initialize', -> - beforeEach -> - @LoggingManager.checkLogLevel = sinon.stub() - @Bunyan.createLogger.reset() - - describe "not in production", -> - beforeEach -> - @LoggingManager.initialize() - - it 'should default to log level debug', -> - @Bunyan.createLogger.should.have.been.calledWithMatch level: "debug" - - it 'should not run checkLogLevel', -> - @LoggingManager.checkLogLevel.should.not.have.been.called - - describe "in production", -> - beforeEach -> - process.env.NODE_ENV = 'production' - @LoggingManager.initialize() - - afterEach -> - delete process.env.NODE_ENV - - it 'should default to log level warn', -> - @Bunyan.createLogger.should.have.been.calledWithMatch level: "warn" - - it 'should run checkLogLevel', -> - @LoggingManager.checkLogLevel.should.have.been.calledOnce - - describe 'after 1 minute', -> - it 'should run checkLogLevel again', -> - @clock.tick(61*1000) - @LoggingManager.checkLogLevel.should.have.been.calledTwice - - describe 'after 2 minutes', -> - it 'should run checkLogLevel again', -> - @clock.tick(121*1000) - @LoggingManager.checkLogLevel.should.have.been.calledThrice - - describe "when LOG_LEVEL set in env", -> - beforeEach -> - process.env.LOG_LEVEL = "trace" - @LoggingManager.initialize() - - afterEach -> - delete process.env.LOG_LEVEL - - it "should use custom log level", -> - @Bunyan.createLogger.should.have.been.calledWithMatch level: "trace" - - describe 'bunyan logging', -> - beforeEach -> - @logArgs = [ foo: "bar", "foo", "bar" ] - - it 'should log debug', -> - @logger.debug @logArgs - @mockBunyanLogger.debug.should.have.been.calledWith @logArgs - - it 'should log error', -> - @logger.error @logArgs - @mockBunyanLogger.error.should.have.been.calledWith @logArgs - - it 'should log fatal', -> - @logger.fatal @logArgs - @mockBunyanLogger.fatal.should.have.been.calledWith @logArgs - - it 'should log info', -> - @logger.info @logArgs - @mockBunyanLogger.info.should.have.been.calledWith @logArgs - - it 'should log warn', -> - @logger.warn @logArgs - @mockBunyanLogger.warn.should.have.been.calledWith @logArgs - - it 'should log err', -> - @logger.err @logArgs - @mockBunyanLogger.error.should.have.been.calledWith @logArgs - - it 'should log log', -> - @logger.log @logArgs - @mockBunyanLogger.info.should.have.been.calledWith @logArgs - - describe 'logger.error', -> - it 'should report a single error to sentry', () -> - @logger.error {foo:'bar'}, "message" - @captureException.called.should.equal true - - it 'should report the same error to sentry only once', () -> - error1 = new Error('this is the error') - @logger.error {foo: error1}, "first message" - @logger.error {bar: error1}, "second message" - @captureException.callCount.should.equal 1 - - it 'should report two different errors to sentry individually', () -> - error1 = new Error('this is the error') - error2 = new Error('this is the error') - @logger.error {foo: error1}, "first message" - @logger.error {bar: error2}, "second message" - @captureException.callCount.should.equal 2 - - it 'should remove the path from fs errors', () -> - fsError = new Error("Error: ENOENT: no such file or directory, stat '/tmp/3279b8d0-da10-11e8-8255-efd98985942b'") - fsError.path = "/tmp/3279b8d0-da10-11e8-8255-efd98985942b" - @logger.error {err: fsError}, "message" - @captureException.calledWith(sinon.match.has('message', 'Error: ENOENT: no such file or directory, stat')).should.equal true - - it 'for multiple errors should only report a maximum of 5 errors to sentry', () -> - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @captureException.callCount.should.equal 5 - - it 'for multiple errors with a minute delay should report 10 errors to sentry', () -> - # the first five errors should be reported to sentry - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - # the following errors should not be reported - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - # allow a minute to pass - @clock.tick(@start+ 61*1000) - # after a minute the next five errors should be reported to sentry - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - # the following errors should not be reported to sentry - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @logger.error {foo:'bar'}, "message" - @captureException.callCount.should.equal 10 - - describe 'checkLogLevel', -> - it 'should request log level override from google meta data service', -> - @LoggingManager.checkLogLevel() - options = - headers: - "Metadata-Flavor": "Google" - uri: "http://metadata.google.internal/computeMetadata/v1/project/attributes/#{@loggerName}-setLogLevelEndTime" - @Request.should.have.been.calledWithMatch options - - describe 'when request has error', -> - beforeEach -> - @Request.yields "error" - @LoggingManager.checkLogLevel() - - it "should only set default level", -> - @mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith('debug') - - describe 'when statusCode is not 200', -> - beforeEach -> - @Request.yields null, statusCode: 404 - @LoggingManager.checkLogLevel() - - it "should only set default level", -> - @mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith('debug') - - describe 'when time value returned that is less than current time', -> - beforeEach -> - @Request.yields null, statusCode: 200, '1' - @LoggingManager.checkLogLevel() - - it "should only set default level", -> - @mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith('debug') - - describe 'when time value returned that is less than current time', -> - describe 'when level is already set', -> - beforeEach -> - @mockBunyanLogger.level.returns(10) - @Request.yields null, statusCode: 200, @start + 1000 - @LoggingManager.checkLogLevel() - - it "should set trace level", -> - @mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith('trace') - - describe 'when level is not already set', -> - beforeEach -> - @mockBunyanLogger.level.returns(20) - @Request.yields null, statusCode: 200, @start + 1000 - @LoggingManager.checkLogLevel() - - it "should set trace level", -> - @mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith('trace') diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index f57ce9ca9d..d791844204 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -1,221 +1,220 @@ -/* - * decaffeinate suggestions: - * DS101: Remove unnecessary use of Array.from - * DS102: Remove unnecessary code created because of implicit returns - * DS203: Remove `|| {}` from converted for-own loops - * DS205: Consider reworking code to avoid use of IIFEs - * DS207: Consider shorter variations of null checks - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ +const bunyan = require("bunyan"); +const request = require("request"); -const bunyan = require('bunyan'); -const request = require('request'); +Logger = module.exports = { + initialize(name) { + this.isProduction = + (process.env["NODE_ENV"] || "").toLowerCase() === "production"; + this.defaultLevel = + process.env["LOG_LEVEL"] || (this.isProduction ? "warn" : "debug"); + this.loggerName = name; + this.ringBuffer = new bunyan.RingBuffer({ + limit: process.env["LOG_RING_BUFFER_SIZE"] || 30 + }); + this.logger = bunyan.createLogger({ + name, + serializers: bunyan.stdSerializers, + streams: [ + { + level: this.defaultLevel, + stream: process.stdout + }, + { + level: "trace", + type: "raw", + stream: this.ringBuffer + } + ] + }); + if (this.isProduction) { + // clear interval if already set + if (this.checkInterval) { + clearInterval(this.checkInterval); + } + // check for log level override on startup + this.checkLogLevel(); + // re-check log level every minute + const checkLogLevel = () => this.checkLogLevel(); + this.checkInterval = setInterval(checkLogLevel, 1000 * 60); + } + return this; + }, -const LOG_METHODS = [ - 'debug', 'info', 'log', 'error', 'err', 'warn', 'fatal' -] + checkLogLevel() { + const options = { + headers: { + "Metadata-Flavor": "Google" + }, + uri: `http://metadata.google.internal/computeMetadata/v1/project/attributes/${ + this.loggerName + }-setLogLevelEndTime` + }; + request(options, (err, response, body) => { + if (parseInt(body) > Date.now()) { + this.logger.level("trace"); + } else { + this.logger.level(this.defaultLevel); + } + }); + }, -class Logger { + initializeErrorReporting(sentry_dsn, options) { + const raven = require("raven"); + this.raven = new raven.Client(sentry_dsn, options); + this.lastErrorTimeStamp = 0; // for rate limiting on sentry reporting + this.lastErrorCount = 0; + }, - constructor(name) { - const isProduction = (process.env['NODE_ENV'] || '').toLowerCase() === 'production'; - this.defaultLevel = process.env['LOG_LEVEL'] || (isProduction ? "warn" : "debug"); - this.loggerName = name; - this.logger = bunyan.createLogger({ - name, - serializers: bunyan.stdSerializers, - level: this.defaultLevel - }); - if (isProduction) { - // check for log level override on startup - this.checkLogLevel(); - // re-check log level every minute - const checkLogLevel = () => this.checkLogLevel(); - setInterval(checkLogLevel, 1000 * 60); - } - return this; - } + captureException(attributes, message, level) { + // handle case of logger.error "message" + let key, value; + if (typeof attributes === "string") { + attributes = { err: new Error(attributes) }; + } + // extract any error object + let error = attributes.err || attributes.error; + // avoid reporting errors twice + for (key in attributes) { + value = attributes[key]; + if (value instanceof Error && value.reportedToSentry) { + return; + } + } + // include our log message in the error report + if (error == null) { + if (typeof message === "string") { + error = { message }; + } + } else if (message != null) { + attributes.description = message; + } + // report the error + if (error != null) { + // capture attributes and use *_id objects as tags + const tags = {}; + const extra = {}; + for (key in attributes) { + value = attributes[key]; + if (key.match(/_id/) && typeof value === "string") { + tags[key] = value; + } + extra[key] = value; + } + // capture req object if available + const { req } = attributes; + if (req != null) { + extra.req = { + method: req.method, + url: req.originalUrl, + query: req.query, + headers: req.headers, + ip: req.ip + }; + } + // recreate error objects that have been converted to a normal object + if (!(error instanceof Error) && typeof error === "object") { + const newError = new Error(error.message); + for (key of Object.keys(error || {})) { + value = error[key]; + newError[key] = value; + } + error = newError; + } + // filter paths from the message to avoid duplicate errors in sentry + // (e.g. errors from `fs` methods which have a path attribute) + try { + if (error.path) { + error.message = error.message.replace(` '${error.path}'`, ""); + } + } catch (error1) {} + // send the error to sentry + try { + this.raven.captureException(error, { tags, extra, level }); + // put a flag on the errors to avoid reporting them multiple times + return (() => { + const result = []; + for (key in attributes) { + value = attributes[key]; + if (value instanceof Error) { + result.push((value.reportedToSentry = true)); + } else { + result.push(undefined); + } + } + return result; + })(); + } catch (error2) { + return; + } + } + }, - checkLogLevel() { - const options = { - headers: { - "Metadata-Flavor": "Google" - }, - uri: `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` - }; - return request(options, (err, response, body) => { - if (parseInt(body) > Date.now()) { - return this.logger.level('trace'); - } else { - return this.logger.level(this.defaultLevel); - } - }); - } + debug() { + return this.logger.debug.apply(this.logger, arguments); + }, - initializeErrorReporting(sentry_dsn, options) { - const raven = require("raven"); - this.raven = new raven.Client(sentry_dsn, options); - this.lastErrorTimeStamp = 0; // for rate limiting on sentry reporting - return this.lastErrorCount = 0; - } + info() { + return this.logger.info.apply(this.logger, arguments); + }, - captureException(attributes, message, level) { - // handle case of logger.error "message" - let key, value; - if (typeof attributes === 'string') { - attributes = {err: new Error(attributes)}; - } - // extract any error object - let error = attributes.err || attributes.error; - // avoid reporting errors twice - for (key in attributes) { - value = attributes[key]; - if (value instanceof Error && value.reportedToSentry) { return; } - } - // include our log message in the error report - if ((error == null)) { - if (typeof message === 'string') { error = {message}; } - } else if (message != null) { - attributes.description = message; - } - // report the error - if (error != null) { - // capture attributes and use *_id objects as tags - const tags = {}; - const extra = {}; - for (key in attributes) { - value = attributes[key]; - if (key.match(/_id/) && (typeof value === 'string')) { tags[key] = value; } - extra[key] = value; - } - // capture req object if available - const { req } = attributes; - if (req != null) { - extra.req = { - method: req.method, - url: req.originalUrl, - query: req.query, - headers: req.headers, - ip: req.ip - }; - } - // recreate error objects that have been converted to a normal object - if (!(error instanceof Error) && (typeof error === "object")) { - const newError = new Error(error.message); - for (key of Object.keys(error || {})) { - value = error[key]; - newError[key] = value; - } - error = newError; - } - // filter paths from the message to avoid duplicate errors in sentry - // (e.g. errors from `fs` methods which have a path attribute) - try { - if (error.path) { error.message = error.message.replace(` '${error.path}'`, ''); } - } catch (error1) {} - // send the error to sentry - try { - this.raven.captureException(error, {tags, extra, level}); - // put a flag on the errors to avoid reporting them multiple times - return (() => { - const result = []; - for (key in attributes) { - value = attributes[key]; - if (value instanceof Error) { result.push(value.reportedToSentry = true); } else { - result.push(undefined); - } - } - return result; - })(); - } catch (error2) { - return; - } - } - } + log() { + return this.logger.info.apply(this.logger, arguments); + }, - debug() { - return this.logger.debug.apply(this.logger, arguments); - } + error(attributes, message, ...args) { + if (this.isProduction) { + attributes.logBuffer = this.ringBuffer.records; + } + this.logger.error(attributes, message, ...Array.from(args)); + if (this.raven != null) { + const MAX_ERRORS = 5; // maximum number of errors in 1 minute + const now = new Date(); + // have we recently reported an error? + const recentSentryReport = now - this.lastErrorTimeStamp < 60 * 1000; + // if so, increment the error count + if (recentSentryReport) { + this.lastErrorCount++; + } else { + this.lastErrorCount = 0; + this.lastErrorTimeStamp = now; + } + // only report 5 errors every minute to avoid overload + if (this.lastErrorCount < MAX_ERRORS) { + // add a note if the rate limit has been hit + const note = + this.lastErrorCount + 1 === MAX_ERRORS ? "(rate limited)" : ""; + // report the exception + return this.captureException(attributes, message, `error${note}`); + } + } + }, - info(){ - return this.logger.info.apply(this.logger, arguments); - } + err() { + return this.error.apply(this, arguments); + }, - log(){ - return this.logger.info.apply(this.logger, arguments); - } + warn() { + return this.logger.warn.apply(this.logger, arguments); + }, - error(attributes, message, ...args){ - this.logger.error(attributes, message, ...Array.from(args)); - if (this.raven != null) { - const MAX_ERRORS = 5; // maximum number of errors in 1 minute - const now = new Date(); - // have we recently reported an error? - const recentSentryReport = (now - this.lastErrorTimeStamp) < (60 * 1000); - // if so, increment the error count - if (recentSentryReport) { - this.lastErrorCount++; - } else { - this.lastErrorCount = 0; - this.lastErrorTimeStamp = now; - } - // only report 5 errors every minute to avoid overload - if (this.lastErrorCount < MAX_ERRORS) { - // add a note if the rate limit has been hit - const note = (this.lastErrorCount+1) === MAX_ERRORS ? "(rate limited)" : ""; - // report the exception - return this.captureException(attributes, message, `error${note}`); - } - } - } + fatal(attributes, message, callback) { + if (callback == null) { + callback = function() {}; + } + this.logger.fatal(attributes, message); + if (this.raven != null) { + var cb = function(e) { + // call the callback once after 'logged' or 'error' event + callback(); + return (cb = function() {}); + }; + this.captureException(attributes, message, "fatal"); + this.raven.once("logged", cb); + return this.raven.once("error", cb); + } else { + return callback(); + } + } +}; - err() { - return this.error.apply(this, arguments); - } - - warn(){ - return this.logger.warn.apply(this.logger, arguments); - } - - fatal(attributes, message, callback) { - if (callback == null) { callback = function() {}; } - this.logger.fatal(attributes, message); - if (this.raven != null) { - var cb = function(e) { // call the callback once after 'logged' or 'error' event - callback(); - return cb = function() {}; - }; - this.captureException(attributes, message, "fatal"); - this.raven.once('logged', cb); - return this.raven.once('error', cb); - } else { - return callback(); - } - } -} - -let defaultLogger -// initialize default logger if not already initialized -if (!global.__logger_sharelatex__default_logger__) { - global.__logger_sharelatex__default_logger__ = defaultLogger = new Logger("default-sharelatex") -} -else { - defaultLogger = global.__logger_sharelatex__default_logger__ -} - -// support old interface for creating new Logger instances -Logger.initialize = function initialize(name) { - return new Logger(name) -} -// add a static method for each log method that will use the default logger -for (const logMethod of LOG_METHODS) { - Logger[logMethod] = function () { - return defaultLogger[logMethod].apply(defaultLogger, arguments) - } -} -// return default logger -Logger.defaultLogger = function defaultLogger () { - return defaultLogger -} - -module.exports = Logger +Logger.initialize("default-sharelatex"); diff --git a/libraries/logger/package-lock.json b/libraries/logger/package-lock.json index 2a3b42cf20..c76f298483 100644 --- a/libraries/logger/package-lock.json +++ b/libraries/logger/package-lock.json @@ -76,6 +76,14 @@ "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, + "async-hook-jl": { + "version": "1.7.6", + "resolved": "https://registry.npmjs.org/async-hook-jl/-/async-hook-jl-1.7.6.tgz", + "integrity": "sha512-gFaHkFfSxTjvoxDMYqDuGHlcRyUuamF8s+ZTtJdDzqjws4mCt7v0vuV79/E2Wr2/riMQgtG4/yUtXWs1gZ7JMg==", + "requires": { + "stack-chain": "^1.3.7" + } + }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -120,11 +128,12 @@ "dev": true }, "bunyan": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.5.1.tgz", - "integrity": "sha1-X259RMQ7lS9WsPQTCeOrEjkbTi0=", + "version": "1.8.12", + "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.12.tgz", + "integrity": "sha1-8VDw9nSKvdcq6uhPBEA74u8RN5c=", "requires": { - "dtrace-provider": "~0.6", + "dtrace-provider": "~0.8", + "moment": "^2.10.6", "mv": "~2", "safe-json-stringify": "~1" } @@ -154,6 +163,16 @@ "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", "dev": true }, + "cls-hooked": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/cls-hooked/-/cls-hooked-4.2.2.tgz", + "integrity": "sha512-J4Xj5f5wq/4jAvcdgoGsL3G103BtWpZrMo8NEinRltN+xpTZdI+M38pyQqhuFU/P792xkMFvnKSf+Lm81U1bxw==", + "requires": { + "async-hook-jl": "^1.7.6", + "emitter-listener": "^1.0.1", + "semver": "^5.4.1" + } + }, "combined-stream": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", @@ -221,12 +240,12 @@ "dev": true }, "dtrace-provider": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/dtrace-provider/-/dtrace-provider-0.6.0.tgz", - "integrity": "sha1-CweNVReTfYcxAUUtkUZzdVe3XlE=", + "version": "0.8.7", + "resolved": "https://registry.npmjs.org/dtrace-provider/-/dtrace-provider-0.8.7.tgz", + "integrity": "sha1-3JObTT4GIM/gwc2APQ0tftBP/QQ=", "optional": true, "requires": { - "nan": "^2.0.8" + "nan": "^2.10.0" } }, "ecc-jsbn": { @@ -238,6 +257,14 @@ "safer-buffer": "^2.1.0" } }, + "emitter-listener": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/emitter-listener/-/emitter-listener-1.1.2.tgz", + "integrity": "sha512-Bt1sBAGFHY9DKY+4/2cV6izcKJUf5T7/gkdmkxzX/qv9CcGH8xSwVRW5mtX03SWJtRTWSOpzCuWN9rBFYZepZQ==", + "requires": { + "shimmer": "^1.2.0" + } + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -507,6 +534,12 @@ } } }, + "moment": { + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", + "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==", + "optional": true + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -611,15 +644,22 @@ "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, "raven": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/raven/-/raven-1.2.1.tgz", - "integrity": "sha1-lJwTTbAooZC3u/j3kKrlQbfAIL0=", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/raven/-/raven-1.1.3.tgz", + "integrity": "sha1-QnPBrm005CMPUbLAEEGjK5Iygio=", "requires": { "cookie": "0.3.1", "json-stringify-safe": "5.0.1", "lsmod": "1.0.0", "stack-trace": "0.0.9", "uuid": "3.0.0" + }, + "dependencies": { + "uuid": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.0.0.tgz", + "integrity": "sha1-Zyj8BFnEUNeWqZwxg3VpvfZy1yg=" + } } }, "request": { @@ -697,18 +737,28 @@ "stack-trace": "0.0.9" } }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" + }, + "shimmer": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz", + "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==" + }, "sinon": { - "version": "7.2.7", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.2.7.tgz", - "integrity": "sha512-rlrre9F80pIQr3M36gOdoCEWzFAMDgHYD8+tocqOw+Zw9OZ8F84a80Ds69eZfcjnzDqqG88ulFld0oin/6rG/g==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.2.3.tgz", + "integrity": "sha512-i6j7sqcLEqTYqUcMV327waI745VASvYuSuQMCjbAwlpAeuCgKZ3LtrjDxAbu+GjNQR0FEDpywtwGCIh8GicNyg==", "dev": true, "requires": { - "@sinonjs/commons": "^1.3.1", - "@sinonjs/formatio": "^3.2.1", - "@sinonjs/samsam": "^3.2.0", + "@sinonjs/commons": "^1.3.0", + "@sinonjs/formatio": "^3.1.0", + "@sinonjs/samsam": "^3.0.2", "diff": "^3.5.0", - "lolex": "^3.1.0", - "nise": "^1.4.10", + "lolex": "^3.0.0", + "nise": "^1.4.8", "supports-color": "^5.5.0" }, "dependencies": { @@ -745,6 +795,11 @@ "tweetnacl": "~0.14.0" } }, + "stack-chain": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/stack-chain/-/stack-chain-1.3.7.tgz", + "integrity": "sha1-0ZLJ/06moiyUxN1FkXHj8AzqEoU=" + }, "stack-trace": { "version": "0.0.9", "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.9.tgz", @@ -803,9 +858,9 @@ } }, "uuid": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.0.0.tgz", - "integrity": "sha1-Zyj8BFnEUNeWqZwxg3VpvfZy1yg=" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" }, "verror": { "version": "1.10.0", diff --git a/libraries/logger/package.json b/libraries/logger/package.json index cd6b0ac64e..692ba2b815 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -6,20 +6,20 @@ "type": "git", "url": "http://github.com/sharelatex/logger-sharelatex.git" }, - "version": "1.6.0", + "version": "1.7.0", "scripts": { "test": "mocha test/**/*.js" }, "dependencies": { - "bunyan": "1.5.1", - "raven": "^1.1.3", - "request": "^2.88.0" + "bunyan": "1.8.12", + "raven": "1.1.3", + "request": "2.88.0" }, "devDependencies": { - "chai": "^4.2.0", - "mocha": "^5.2.0", + "chai": "4.2.0", + "mocha": "5.2.0", "sandboxed-module": "2.0.3", - "sinon": "^7.2.3", - "sinon-chai": "^3.3.0" + "sinon": "7.2.3", + "sinon-chai": "3.3.0" } } diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index a808ac5f2c..a1f505d258 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -1,9 +1,5 @@ -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ const SandboxedModule = require("sandboxed-module"); +const bunyan = require("bunyan"); const chai = require("chai"); const path = require("path"); const sinon = require("sinon"); @@ -12,291 +8,366 @@ const sinonChai = require("sinon-chai"); chai.use(sinonChai); chai.should(); -const modulePath = path.join(__dirname, '../../logging-manager.js'); +const modulePath = path.join(__dirname, "../../logging-manager.js"); -describe('LoggingManager', function() { +describe("LoggingManager", function() { + beforeEach(function() { + this.start = Date.now(); + this.clock = sinon.useFakeTimers(this.start); + this.captureException = sinon.stub(); + this.mockBunyanLogger = { + debug: sinon.stub(), + error: sinon.stub(), + fatal: sinon.stub(), + info: sinon.stub(), + level: sinon.stub(), + warn: sinon.stub() + }; + this.mockRavenClient = { + captureException: this.captureException, + once: sinon.stub().yields() + }; + this.LoggingManager = SandboxedModule.require(modulePath, { + globals: { console }, + requires: { + bunyan: (this.Bunyan = { + createLogger: sinon.stub().returns(this.mockBunyanLogger), + RingBuffer: bunyan.RingBuffer + }), + raven: (this.Raven = { + Client: sinon.stub().returns(this.mockRavenClient) + }), + request: (this.Request = sinon.stub()) + } + }); + this.loggerName = "test"; + this.logger = this.LoggingManager.initialize(this.loggerName); + this.logger.initializeErrorReporting("test_dsn"); + }); - beforeEach(function() { - this.start = Date.now(); - this.clock = sinon.useFakeTimers(this.start); - this.captureException = sinon.stub(); - this.mockBunyanLogger = { - debug: sinon.stub(), - error: sinon.stub(), - fatal: sinon.stub(), - info: sinon.stub(), - level: sinon.stub(), - warn: sinon.stub() - }; - this.mockRavenClient = { - captureException: this.captureException, - once: sinon.stub().yields() - }; - this.LoggingManager = SandboxedModule.require(modulePath, { - globals: { console }, - requires: { - bunyan: (this.Bunyan = {createLogger: sinon.stub().returns(this.mockBunyanLogger)}), - raven: (this.Raven = {Client: sinon.stub().returns(this.mockRavenClient)}), - request: (this.Request = sinon.stub()), - }, - }); - this.loggerName = "test"; - this.logger = this.LoggingManager.initialize(this.loggerName); - this.logger.initializeErrorReporting("test_dsn"); - }); + afterEach(function() { + this.clock.restore(); + }); - afterEach(function() { - this.clock.restore(); - }); + describe("initialize", function() { + beforeEach(function() { + this.checkLogLevelStub = sinon.stub(this.LoggingManager, "checkLogLevel"); + this.Bunyan.createLogger.reset(); + }); - describe('initialize', function() { - beforeEach(function() { - this.checkLogLevelStub = sinon.stub(this.LoggingManager.prototype, "checkLogLevel"); - this.Bunyan.createLogger.reset(); - }); + afterEach(function() { + this.checkLogLevelStub.restore(); + }); - afterEach(function () { - this.checkLogLevelStub.restore() - }) + describe("not in production", function() { + beforeEach(function() { + this.logger = this.LoggingManager.initialize(this.loggerName); + }); - describe("not in production", function() { - beforeEach(function() { - this.logger = this.LoggingManager.initialize(this.loggerName) - }); + it("should default to log level debug", function() { + this.Bunyan.createLogger.firstCall.args[0].streams[0].level.should.equal( + "debug" + ); + }); - it('should default to log level debug', function() { - this.Bunyan.createLogger.should.have.been.calledWithMatch({level: "debug"}); - }); + it("should not run checkLogLevel", function() { + this.checkLogLevelStub.should.not.have.been.called; + }); + }); - it('should not run checkLogLevel', function() { - this.checkLogLevelStub.should.not.have.been.called; - }); - }); + describe("in production", function() { + beforeEach(function() { + process.env.NODE_ENV = "production"; + this.logger = this.LoggingManager.initialize(this.loggerName); + }); - describe("in production", function() { - beforeEach(function() { - process.env.NODE_ENV = 'production'; - this.logger = this.LoggingManager.initialize(this.loggerName) - }); + afterEach(() => delete process.env.NODE_ENV); - afterEach(() => delete process.env.NODE_ENV); + it("should default to log level warn", function() { + this.Bunyan.createLogger.firstCall.args[0].streams[0].level.should.equal( + "warn" + ); + }); - it('should default to log level warn', function() { - this.Bunyan.createLogger.should.have.been.calledWithMatch({level: "warn"}); - }); + it("should run checkLogLevel", function() { + this.checkLogLevelStub.should.have.been.calledOnce; + }); - it('should run checkLogLevel', function() { - this.checkLogLevelStub.should.have.been.calledOnce; - }); + describe("after 1 minute", () => + it("should run checkLogLevel again", function() { + this.clock.tick(61 * 1000); + this.checkLogLevelStub.should.have.been.calledTwice; + })); - describe('after 1 minute', () => - it('should run checkLogLevel again', function() { - this.clock.tick(61*1000); - this.checkLogLevelStub.should.have.been.calledTwice; - }) - ); + describe("after 2 minutes", () => + it("should run checkLogLevel again", function() { + this.clock.tick(121 * 1000); + this.checkLogLevelStub.should.have.been.calledThrice; + })); + }); - describe('after 2 minutes', () => - it('should run checkLogLevel again', function() { - this.clock.tick(121*1000); - this.checkLogLevelStub.should.have.been.calledThrice; - }) - ); - }); + describe("when LOG_LEVEL set in env", function() { + beforeEach(function() { + process.env.LOG_LEVEL = "trace"; + this.LoggingManager.initialize(); + }); - describe("when LOG_LEVEL set in env", function() { - beforeEach(function() { - process.env.LOG_LEVEL = "trace"; - this.LoggingManager.initialize(); - }); + afterEach(() => delete process.env.LOG_LEVEL); - afterEach(() => delete process.env.LOG_LEVEL); + it("should use custom log level", function() { + this.Bunyan.createLogger.firstCall.args[0].streams[0].level.should.equal( + "trace" + ); + }); + }); + }); - it("should use custom log level", function() { - this.Bunyan.createLogger.should.have.been.calledWithMatch({level: "trace"}); - }); - }); - }); + describe("bunyan logging", function() { + beforeEach(function() { + this.logArgs = [{ foo: "bar" }, "foo", "bar"]; + }); - describe('bunyan logging', function() { - beforeEach(function() { - this.logArgs = [ {foo: "bar"}, "foo", "bar" ];}); + it("should log debug", function() { + this.logger.debug(this.logArgs); + this.mockBunyanLogger.debug.should.have.been.calledWith(this.logArgs); + }); - it('should log debug', function() { - this.logger.debug(this.logArgs); - this.mockBunyanLogger.debug.should.have.been.calledWith(this.logArgs); - }); + it("should log error", function() { + this.logger.error(this.logArgs); + this.mockBunyanLogger.error.should.have.been.calledWith(this.logArgs); + }); - it('should log error', function() { - this.logger.error(this.logArgs); - this.mockBunyanLogger.error.should.have.been.calledWith(this.logArgs); - }); + it("should log fatal", function() { + this.logger.fatal(this.logArgs); + this.mockBunyanLogger.fatal.should.have.been.calledWith(this.logArgs); + }); - it('should log fatal', function() { - this.logger.fatal(this.logArgs); - this.mockBunyanLogger.fatal.should.have.been.calledWith(this.logArgs); - }); + it("should log info", function() { + this.logger.info(this.logArgs); + this.mockBunyanLogger.info.should.have.been.calledWith(this.logArgs); + }); - it('should log info', function() { - this.logger.info(this.logArgs); - this.mockBunyanLogger.info.should.have.been.calledWith(this.logArgs); - }); + it("should log warn", function() { + this.logger.warn(this.logArgs); + this.mockBunyanLogger.warn.should.have.been.calledWith(this.logArgs); + }); - it('should log warn', function() { - this.logger.warn(this.logArgs); - this.mockBunyanLogger.warn.should.have.been.calledWith(this.logArgs); - }); + it("should log err", function() { + this.logger.err(this.logArgs); + this.mockBunyanLogger.error.should.have.been.calledWith(this.logArgs); + }); - it('should log err', function() { - this.logger.err(this.logArgs); - this.mockBunyanLogger.error.should.have.been.calledWith(this.logArgs); - }); + it("should log log", function() { + this.logger.log(this.logArgs); + this.mockBunyanLogger.info.should.have.been.calledWith(this.logArgs); + }); + }); - it('should log log', function() { - this.logger.log(this.logArgs); - this.mockBunyanLogger.info.should.have.been.calledWith(this.logArgs); - }); - }); + describe("logger.error", function() { + it("should report a single error to sentry", function() { + this.logger.error({ foo: "bar" }, "message"); + this.captureException.called.should.equal(true); + }); - describe('logger.error', function() { - it('should report a single error to sentry', function() { - this.logger.error({foo:'bar'}, "message"); - this.captureException.called.should.equal(true); - }); + it("should report the same error to sentry only once", function() { + const error1 = new Error("this is the error"); + this.logger.error({ foo: error1 }, "first message"); + this.logger.error({ bar: error1 }, "second message"); + this.captureException.callCount.should.equal(1); + }); - it('should report the same error to sentry only once', function() { - const error1 = new Error('this is the error'); - this.logger.error({foo: error1}, "first message"); - this.logger.error({bar: error1}, "second message"); - this.captureException.callCount.should.equal(1); - }); + it("should report two different errors to sentry individually", function() { + const error1 = new Error("this is the error"); + const error2 = new Error("this is the error"); + this.logger.error({ foo: error1 }, "first message"); + this.logger.error({ bar: error2 }, "second message"); + this.captureException.callCount.should.equal(2); + }); - it('should report two different errors to sentry individually', function() { - const error1 = new Error('this is the error'); - const error2 = new Error('this is the error'); - this.logger.error({foo: error1}, "first message"); - this.logger.error({bar: error2}, "second message"); - this.captureException.callCount.should.equal(2); - }); + it("should remove the path from fs errors", function() { + const fsError = new Error( + "Error: ENOENT: no such file or directory, stat '/tmp/3279b8d0-da10-11e8-8255-efd98985942b'" + ); + fsError.path = "/tmp/3279b8d0-da10-11e8-8255-efd98985942b"; + this.logger.error({ err: fsError }, "message"); + this.captureException + .calledWith( + sinon.match.has( + "message", + "Error: ENOENT: no such file or directory, stat" + ) + ) + .should.equal(true); + }); - it('should remove the path from fs errors', function() { - const fsError = new Error("Error: ENOENT: no such file or directory, stat '/tmp/3279b8d0-da10-11e8-8255-efd98985942b'"); - fsError.path = "/tmp/3279b8d0-da10-11e8-8255-efd98985942b"; - this.logger.error({err: fsError}, "message"); - this.captureException.calledWith(sinon.match.has('message', 'Error: ENOENT: no such file or directory, stat')).should.equal(true); - }); + it("for multiple errors should only report a maximum of 5 errors to sentry", function() { + this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: "bar" }, "message"); + this.captureException.callCount.should.equal(5); + }); - it('for multiple errors should only report a maximum of 5 errors to sentry', function() { - this.logger.error({foo:'bar'}, "message"); - this.logger.error({foo:'bar'}, "message"); - this.logger.error({foo:'bar'}, "message"); - this.logger.error({foo:'bar'}, "message"); - this.logger.error({foo:'bar'}, "message"); - this.logger.error({foo:'bar'}, "message"); - this.logger.error({foo:'bar'}, "message"); - this.logger.error({foo:'bar'}, "message"); - this.logger.error({foo:'bar'}, "message"); - this.captureException.callCount.should.equal(5); - }); + it("for multiple errors with a minute delay should report 10 errors to sentry", function() { + // the first five errors should be reported to sentry + this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: "bar" }, "message"); + // the following errors should not be reported + this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: "bar" }, "message"); + // allow a minute to pass + this.clock.tick(this.start + 61 * 1000); + // after a minute the next five errors should be reported to sentry + this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: "bar" }, "message"); + // the following errors should not be reported to sentry + this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: "bar" }, "message"); + this.captureException.callCount.should.equal(10); + }); + }); - it('for multiple errors with a minute delay should report 10 errors to sentry', function() { - // the first five errors should be reported to sentry - this.logger.error({foo:'bar'}, "message"); - this.logger.error({foo:'bar'}, "message"); - this.logger.error({foo:'bar'}, "message"); - this.logger.error({foo:'bar'}, "message"); - this.logger.error({foo:'bar'}, "message"); - // the following errors should not be reported - this.logger.error({foo:'bar'}, "message"); - this.logger.error({foo:'bar'}, "message"); - this.logger.error({foo:'bar'}, "message"); - this.logger.error({foo:'bar'}, "message"); - // allow a minute to pass - this.clock.tick(this.start+ (61*1000)); - // after a minute the next five errors should be reported to sentry - this.logger.error({foo:'bar'}, "message"); - this.logger.error({foo:'bar'}, "message"); - this.logger.error({foo:'bar'}, "message"); - this.logger.error({foo:'bar'}, "message"); - this.logger.error({foo:'bar'}, "message"); - // the following errors should not be reported to sentry - this.logger.error({foo:'bar'}, "message"); - this.logger.error({foo:'bar'}, "message"); - this.logger.error({foo:'bar'}, "message"); - this.logger.error({foo:'bar'}, "message"); - this.captureException.callCount.should.equal(10); - }); - }); + describe("checkLogLevel", function() { + it("should request log level override from google meta data service", function() { + this.logger.checkLogLevel(); + const options = { + headers: { + "Metadata-Flavor": "Google" + }, + uri: `http://metadata.google.internal/computeMetadata/v1/project/attributes/${ + this.loggerName + }-setLogLevelEndTime` + }; + this.Request.should.have.been.calledWithMatch(options); + }); - describe('checkLogLevel', function() { - it('should request log level override from google meta data service', function() { - this.logger.checkLogLevel(); - const options = { - headers: { - "Metadata-Flavor": "Google" - }, - uri: `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` - }; - this.Request.should.have.been.calledWithMatch(options); - }); + describe("when request has error", function() { + beforeEach(function() { + this.Request.yields("error"); + this.logger.checkLogLevel(); + }); - describe('when request has error', function() { - beforeEach(function() { - this.Request.yields("error"); - this.logger.checkLogLevel(); - }); + it("should only set default level", function() { + this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith( + "debug" + ); + }); + }); - it("should only set default level", function() { - this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith('debug'); - }); - }); + describe("when statusCode is not 200", function() { + beforeEach(function() { + this.Request.yields(null, { statusCode: 404 }); + this.logger.checkLogLevel(); + }); - describe('when statusCode is not 200', function() { - beforeEach(function() { - this.Request.yields(null, {statusCode: 404}); - this.logger.checkLogLevel(); - }); + it("should only set default level", function() { + this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith( + "debug" + ); + }); + }); - it("should only set default level", function() { - this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith('debug'); - }); - }); + describe("when time value returned that is less than current time", function() { + beforeEach(function() { + this.Request.yields(null, { statusCode: 200 }, "1"); + this.logger.checkLogLevel(); + }); - describe('when time value returned that is less than current time', function() { - beforeEach(function() { - this.Request.yields(null, {statusCode: 200}, '1'); - this.logger.checkLogLevel(); - }); + it("should only set default level", function() { + this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith( + "debug" + ); + }); + }); - it("should only set default level", function() { - this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith('debug'); - }); - }); + describe("when time value returned that is less than current time", function() { + describe("when level is already set", function() { + beforeEach(function() { + this.mockBunyanLogger.level.returns(10); + this.Request.yields(null, { statusCode: 200 }, this.start + 1000); + this.logger.checkLogLevel(); + }); - describe('when time value returned that is less than current time', function() { - describe('when level is already set', function() { - beforeEach(function() { - this.mockBunyanLogger.level.returns(10); - this.Request.yields(null, {statusCode: 200}, this.start + 1000); - this.logger.checkLogLevel(); - }); + it("should set trace level", function() { + this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith( + "trace" + ); + }); + }); - it("should set trace level", function() { - this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith('trace'); - }); - }); + describe("when level is not already set", function() { + beforeEach(function() { + this.mockBunyanLogger.level.returns(20); + this.Request.yields(null, { statusCode: 200 }, this.start + 1000); + this.logger.checkLogLevel(); + }); - describe('when level is not already set', function() { - beforeEach(function() { - this.mockBunyanLogger.level.returns(20); - this.Request.yields(null, {statusCode: 200}, this.start + 1000); - this.logger.checkLogLevel(); - }); + it("should set trace level", function() { + this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith( + "trace" + ); + }); + }); + }); + }); - it("should set trace level", function() { - this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith('trace'); - }); - }); - }); - }); + describe("ringbuffer", function() { + beforeEach(function() { + this.logBufferMock = [ + { + msg: "log 1" + }, + { + msg: "log 2" + } + ]; + }); + + describe("in production", function() { + beforeEach(function() { + process.env["NODE_ENV"] = "production"; + this.logger = this.LoggingManager.initialize(this.loggerName); + this.logger.ringBuffer.records = this.logBufferMock; + this.logger.error({}, "error"); + }); + + afterEach(function() { + process.env["NODE_ENV"] = undefined; + }); + + it("should include buffered logs in error log", function() { + this.mockBunyanLogger.error.lastCall.args[0].logBuffer.should.equal( + this.logBufferMock + ); + }); + }); + + describe("not in production", function() { + beforeEach(function() { + this.logger = this.LoggingManager.initialize(this.loggerName); + this.logger.ringBuffer.records = this.logBufferMock; + this.logger.error({}, "error"); + }); + + it("should not include buffered logs in error log", function() { + chai.expect(this.mockBunyanLogger.error.lastCall.args[0].logBuffer).be + .undefined; + }); + }); + }); }); From a2b5793f499044678fadd5e7ecfa995abd2b42ad Mon Sep 17 00:00:00 2001 From: Ersun Warncke Date: Fri, 8 Mar 2019 12:06:24 -0400 Subject: [PATCH 39/93] add eslint and prettier --- libraries/logger/.eslintrc | 75 ++ libraries/logger/.prettierrc | 4 + libraries/logger/index.js | 2 +- libraries/logger/logging-manager.js | 162 ++-- libraries/logger/package-lock.json | 881 ------------------ libraries/logger/package.json | 4 +- .../logger/test/unit/loggingManagerTests.js | 502 +++++----- 7 files changed, 415 insertions(+), 1215 deletions(-) create mode 100644 libraries/logger/.eslintrc create mode 100644 libraries/logger/.prettierrc delete mode 100644 libraries/logger/package-lock.json diff --git a/libraries/logger/.eslintrc b/libraries/logger/.eslintrc new file mode 100644 index 0000000000..5ca14a0e9f --- /dev/null +++ b/libraries/logger/.eslintrc @@ -0,0 +1,75 @@ +{ + "extends": [ + "standard", + "standard-react", + "prettier", + "prettier/react", + "prettier/standard", + "plugin:jsx-a11y/recommended" + ], + "plugins": [ + "jsx-a11y", + "mocha", + "chai-expect", + "chai-friendly" + ], + "env": { + "mocha": true + }, + "globals": { + "expect": true, + "define": true, + "$": true, + "angular": true, + // Injected in layout.pug + "user_id": true, + "ace": true + }, + "settings": { + // Tell eslint-plugin-react to detect which version of React we are using + "react": { + "version": "detect" + } + }, + "rules": { + "max-len": ["error", { + "ignoreUrls": true, + // Ignore long describe/it test blocks, long import/require statements + "ignorePattern": "(^\\s*(it|describe)\\s*\\(['\"]|^import\\s*.*\\s*from\\s*['\"]|^.*\\s*=\\s*require\\(['\"])" + }], + + // Fix conflict between prettier & standard by overriding to prefer + // double quotes + "jsx-quotes": ["error", "prefer-double"], + + // Override weird behaviour of jsx-a11y label-has-for (says labels must be + // nested *and* have for/id attributes) + "jsx-a11y/label-has-for": [ + "error", + { + "required": { + "some": [ + "nesting", + "id" + ] + } + } + ], + + // Add some mocha specific rules + "mocha/handle-done-callback": "error", + "mocha/no-exclusive-tests": "error", + "mocha/no-global-tests": "error", + "mocha/no-identical-title": "error", + "mocha/no-nested-tests": "error", + "mocha/no-pending-tests": "error", + "mocha/no-skipped-tests": "error", + + // Add some chai specific rules + "chai-expect/missing-assertion": "error", + "chai-expect/terminating-properties": "error", + // Swap the no-unused-expressions rule with a more chai-friendly one + "no-unused-expressions": 0, + "chai-friendly/no-unused-expressions": "error" + } +} diff --git a/libraries/logger/.prettierrc b/libraries/logger/.prettierrc new file mode 100644 index 0000000000..b2095be81e --- /dev/null +++ b/libraries/logger/.prettierrc @@ -0,0 +1,4 @@ +{ + "semi": false, + "singleQuote": true +} diff --git a/libraries/logger/index.js b/libraries/logger/index.js index aeca420019..6cd6f9ef8b 100755 --- a/libraries/logger/index.js +++ b/libraries/logger/index.js @@ -1 +1 @@ -module.exports = require("./logging-manager.js"); +module.exports = require('./logging-manager.js') diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index d791844204..04e3bc18b2 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -1,16 +1,16 @@ -const bunyan = require("bunyan"); -const request = require("request"); +const bunyan = require('bunyan') +const request = require('request') Logger = module.exports = { initialize(name) { this.isProduction = - (process.env["NODE_ENV"] || "").toLowerCase() === "production"; + (process.env['NODE_ENV'] || '').toLowerCase() === 'production' this.defaultLevel = - process.env["LOG_LEVEL"] || (this.isProduction ? "warn" : "debug"); - this.loggerName = name; + process.env['LOG_LEVEL'] || (this.isProduction ? 'warn' : 'debug') + this.loggerName = name this.ringBuffer = new bunyan.RingBuffer({ - limit: process.env["LOG_RING_BUFFER_SIZE"] || 30 - }); + limit: process.env['LOG_RING_BUFFER_SIZE'] || 30 + }) this.logger = bunyan.createLogger({ name, serializers: bunyan.stdSerializers, @@ -20,88 +20,88 @@ Logger = module.exports = { stream: process.stdout }, { - level: "trace", - type: "raw", + level: 'trace', + type: 'raw', stream: this.ringBuffer } ] - }); + }) if (this.isProduction) { // clear interval if already set if (this.checkInterval) { - clearInterval(this.checkInterval); + clearInterval(this.checkInterval) } // check for log level override on startup - this.checkLogLevel(); + this.checkLogLevel() // re-check log level every minute - const checkLogLevel = () => this.checkLogLevel(); - this.checkInterval = setInterval(checkLogLevel, 1000 * 60); + const checkLogLevel = () => this.checkLogLevel() + this.checkInterval = setInterval(checkLogLevel, 1000 * 60) } - return this; + return this }, checkLogLevel() { const options = { headers: { - "Metadata-Flavor": "Google" + 'Metadata-Flavor': 'Google' }, uri: `http://metadata.google.internal/computeMetadata/v1/project/attributes/${ this.loggerName }-setLogLevelEndTime` - }; + } request(options, (err, response, body) => { if (parseInt(body) > Date.now()) { - this.logger.level("trace"); + this.logger.level('trace') } else { - this.logger.level(this.defaultLevel); + this.logger.level(this.defaultLevel) } - }); + }) }, initializeErrorReporting(sentry_dsn, options) { - const raven = require("raven"); - this.raven = new raven.Client(sentry_dsn, options); - this.lastErrorTimeStamp = 0; // for rate limiting on sentry reporting - this.lastErrorCount = 0; + const raven = require('raven') + this.raven = new raven.Client(sentry_dsn, options) + this.lastErrorTimeStamp = 0 // for rate limiting on sentry reporting + this.lastErrorCount = 0 }, captureException(attributes, message, level) { // handle case of logger.error "message" - let key, value; - if (typeof attributes === "string") { - attributes = { err: new Error(attributes) }; + let key, value + if (typeof attributes === 'string') { + attributes = { err: new Error(attributes) } } // extract any error object - let error = attributes.err || attributes.error; + let error = attributes.err || attributes.error // avoid reporting errors twice for (key in attributes) { - value = attributes[key]; + value = attributes[key] if (value instanceof Error && value.reportedToSentry) { - return; + return } } // include our log message in the error report if (error == null) { - if (typeof message === "string") { - error = { message }; + if (typeof message === 'string') { + error = { message } } } else if (message != null) { - attributes.description = message; + attributes.description = message } // report the error if (error != null) { // capture attributes and use *_id objects as tags - const tags = {}; - const extra = {}; + const tags = {} + const extra = {} for (key in attributes) { - value = attributes[key]; - if (key.match(/_id/) && typeof value === "string") { - tags[key] = value; + value = attributes[key] + if (key.match(/_id/) && typeof value === 'string') { + tags[key] = value } - extra[key] = value; + extra[key] = value } // capture req object if available - const { req } = attributes; + const { req } = attributes if (req != null) { extra.req = { method: req.method, @@ -109,112 +109,112 @@ Logger = module.exports = { query: req.query, headers: req.headers, ip: req.ip - }; + } } // recreate error objects that have been converted to a normal object - if (!(error instanceof Error) && typeof error === "object") { - const newError = new Error(error.message); + if (!(error instanceof Error) && typeof error === 'object') { + const newError = new Error(error.message) for (key of Object.keys(error || {})) { - value = error[key]; - newError[key] = value; + value = error[key] + newError[key] = value } - error = newError; + error = newError } // filter paths from the message to avoid duplicate errors in sentry // (e.g. errors from `fs` methods which have a path attribute) try { if (error.path) { - error.message = error.message.replace(` '${error.path}'`, ""); + error.message = error.message.replace(` '${error.path}'`, '') } } catch (error1) {} // send the error to sentry try { - this.raven.captureException(error, { tags, extra, level }); + this.raven.captureException(error, { tags, extra, level }) // put a flag on the errors to avoid reporting them multiple times return (() => { - const result = []; + const result = [] for (key in attributes) { - value = attributes[key]; + value = attributes[key] if (value instanceof Error) { - result.push((value.reportedToSentry = true)); + result.push((value.reportedToSentry = true)) } else { - result.push(undefined); + result.push(undefined) } } - return result; - })(); + return result + })() } catch (error2) { - return; + return } } }, debug() { - return this.logger.debug.apply(this.logger, arguments); + return this.logger.debug.apply(this.logger, arguments) }, info() { - return this.logger.info.apply(this.logger, arguments); + return this.logger.info.apply(this.logger, arguments) }, log() { - return this.logger.info.apply(this.logger, arguments); + return this.logger.info.apply(this.logger, arguments) }, error(attributes, message, ...args) { if (this.isProduction) { - attributes.logBuffer = this.ringBuffer.records; + attributes.logBuffer = this.ringBuffer.records } - this.logger.error(attributes, message, ...Array.from(args)); + this.logger.error(attributes, message, ...Array.from(args)) if (this.raven != null) { - const MAX_ERRORS = 5; // maximum number of errors in 1 minute - const now = new Date(); + const MAX_ERRORS = 5 // maximum number of errors in 1 minute + const now = new Date() // have we recently reported an error? - const recentSentryReport = now - this.lastErrorTimeStamp < 60 * 1000; + const recentSentryReport = now - this.lastErrorTimeStamp < 60 * 1000 // if so, increment the error count if (recentSentryReport) { - this.lastErrorCount++; + this.lastErrorCount++ } else { - this.lastErrorCount = 0; - this.lastErrorTimeStamp = now; + this.lastErrorCount = 0 + this.lastErrorTimeStamp = now } // only report 5 errors every minute to avoid overload if (this.lastErrorCount < MAX_ERRORS) { // add a note if the rate limit has been hit const note = - this.lastErrorCount + 1 === MAX_ERRORS ? "(rate limited)" : ""; + this.lastErrorCount + 1 === MAX_ERRORS ? '(rate limited)' : '' // report the exception - return this.captureException(attributes, message, `error${note}`); + return this.captureException(attributes, message, `error${note}`) } } }, err() { - return this.error.apply(this, arguments); + return this.error.apply(this, arguments) }, warn() { - return this.logger.warn.apply(this.logger, arguments); + return this.logger.warn.apply(this.logger, arguments) }, fatal(attributes, message, callback) { if (callback == null) { - callback = function() {}; + callback = function() {} } - this.logger.fatal(attributes, message); + this.logger.fatal(attributes, message) if (this.raven != null) { var cb = function(e) { // call the callback once after 'logged' or 'error' event - callback(); - return (cb = function() {}); - }; - this.captureException(attributes, message, "fatal"); - this.raven.once("logged", cb); - return this.raven.once("error", cb); + callback() + return (cb = function() {}) + } + this.captureException(attributes, message, 'fatal') + this.raven.once('logged', cb) + return this.raven.once('error', cb) } else { - return callback(); + return callback() } } -}; +} -Logger.initialize("default-sharelatex"); +Logger.initialize('default-sharelatex') diff --git a/libraries/logger/package-lock.json b/libraries/logger/package-lock.json deleted file mode 100644 index c76f298483..0000000000 --- a/libraries/logger/package-lock.json +++ /dev/null @@ -1,881 +0,0 @@ -{ - "name": "logger-sharelatex", - "version": "1.6.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@sinonjs/commons": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.4.0.tgz", - "integrity": "sha512-9jHK3YF/8HtJ9wCAbG+j8cD0i0+ATS9A7gXFqS36TblLPNy6rEEc+SB0imo91eCboGaBYGV/MT1/br/J+EE7Tw==", - "dev": true, - "requires": { - "type-detect": "4.0.8" - } - }, - "@sinonjs/formatio": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.2.1.tgz", - "integrity": "sha512-tsHvOB24rvyvV2+zKMmPkZ7dXX6LSLKZ7aOtXY6Edklp0uRcgGpOsQTTGTcWViFyx4uhWc6GV8QdnALbIbIdeQ==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1", - "@sinonjs/samsam": "^3.1.0" - } - }, - "@sinonjs/samsam": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.2.0.tgz", - "integrity": "sha512-j5F1rScewLtx6pbTK0UAjA3jJj4RYiSKOix53YWv+Jzy/AZ69qHxUpU8fwVLjyKbEEud9QrLpv6Ggs7WqTimYw==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.0.2", - "array-from": "^2.1.1", - "lodash": "^4.17.11" - } - }, - "@sinonjs/text-encoding": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", - "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", - "dev": true - }, - "ajv": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", - "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "array-from": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", - "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", - "dev": true - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - }, - "assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "dev": true - }, - "async-hook-jl": { - "version": "1.7.6", - "resolved": "https://registry.npmjs.org/async-hook-jl/-/async-hook-jl-1.7.6.tgz", - "integrity": "sha512-gFaHkFfSxTjvoxDMYqDuGHlcRyUuamF8s+ZTtJdDzqjws4mCt7v0vuV79/E2Wr2/riMQgtG4/yUtXWs1gZ7JMg==", - "requires": { - "stack-chain": "^1.3.7" - } - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, - "bunyan": { - "version": "1.8.12", - "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.12.tgz", - "integrity": "sha1-8VDw9nSKvdcq6uhPBEA74u8RN5c=", - "requires": { - "dtrace-provider": "~0.8", - "moment": "^2.10.6", - "mv": "~2", - "safe-json-stringify": "~1" - } - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" - }, - "chai": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", - "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", - "dev": true, - "requires": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^3.0.1", - "get-func-name": "^2.0.0", - "pathval": "^1.1.0", - "type-detect": "^4.0.5" - } - }, - "check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", - "dev": true - }, - "cls-hooked": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/cls-hooked/-/cls-hooked-4.2.2.tgz", - "integrity": "sha512-J4Xj5f5wq/4jAvcdgoGsL3G103BtWpZrMo8NEinRltN+xpTZdI+M38pyQqhuFU/P792xkMFvnKSf+Lm81U1bxw==", - "requires": { - "async-hook-jl": "^1.7.6", - "emitter-listener": "^1.0.1", - "semver": "^5.4.1" - } - }, - "combined-stream": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "cookie": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" - }, - "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=" - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "requires": { - "assert-plus": "^1.0.0" - } - }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-eql": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", - "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", - "dev": true, - "requires": { - "type-detect": "^4.0.0" - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, - "dtrace-provider": { - "version": "0.8.7", - "resolved": "https://registry.npmjs.org/dtrace-provider/-/dtrace-provider-0.8.7.tgz", - "integrity": "sha1-3JObTT4GIM/gwc2APQ0tftBP/QQ=", - "optional": true, - "requires": { - "nan": "^2.10.0" - } - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "emitter-listener": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/emitter-listener/-/emitter-listener-1.1.2.tgz", - "integrity": "sha512-Bt1sBAGFHY9DKY+4/2cV6izcKJUf5T7/gkdmkxzX/qv9CcGH8xSwVRW5mtX03SWJtRTWSOpzCuWN9rBFYZepZQ==", - "requires": { - "shimmer": "^1.2.0" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", - "dev": true - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "requires": { - "assert-plus": "^1.0.0" - } - }, - "glob": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", - "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", - "optional": true, - "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", - "dev": true - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "just-extend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.0.2.tgz", - "integrity": "sha512-FrLwOgm+iXrPV+5zDU6Jqu4gCRXbWEQg2O3SKONsWE4w7AXFRkryS53bpWdaL9cNol+AmR3AEYz6kn+o0fCPnw==", - "dev": true - }, - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true - }, - "lolex": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-3.1.0.tgz", - "integrity": "sha512-zFo5MgCJ0rZ7gQg69S4pqBsLURbFw11X68C18OcJjJQbqaXm2NoTrGl1IMM3TIz0/BnN1tIs2tzmmqvCsOMMjw==", - "dev": true - }, - "lsmod": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lsmod/-/lsmod-1.0.0.tgz", - "integrity": "sha1-mgD3bco26yP6BTUK/htYXUKZ5ks=" - }, - "mime-db": { - "version": "1.38.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", - "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==" - }, - "mime-types": { - "version": "2.1.22", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", - "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", - "requires": { - "mime-db": "~1.38.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "requires": { - "minimist": "0.0.8" - } - }, - "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", - "dev": true, - "requires": { - "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", - "growl": "1.10.5", - "he": "1.1.1", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" - }, - "dependencies": { - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } - } - }, - "moment": { - "version": "2.24.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", - "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==", - "optional": true - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "mv": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/mv/-/mv-2.1.1.tgz", - "integrity": "sha1-rmzg1vbV4KT32JN5jQPB6pVZtqI=", - "optional": true, - "requires": { - "mkdirp": "~0.5.1", - "ncp": "~2.0.0", - "rimraf": "~2.4.0" - } - }, - "nan": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", - "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==", - "optional": true - }, - "ncp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", - "integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=", - "optional": true - }, - "nise": { - "version": "1.4.10", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.4.10.tgz", - "integrity": "sha512-sa0RRbj53dovjc7wombHmVli9ZihXbXCQ2uH3TNm03DyvOSIQbxg+pbqDKrk2oxMK1rtLGVlKxcB9rrc6X5YjA==", - "dev": true, - "requires": { - "@sinonjs/formatio": "^3.1.0", - "@sinonjs/text-encoding": "^0.7.1", - "just-extend": "^4.0.2", - "lolex": "^2.3.2", - "path-to-regexp": "^1.7.0" - }, - "dependencies": { - "lolex": { - "version": "2.7.5", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.7.5.tgz", - "integrity": "sha512-l9x0+1offnKKIzYVjyXU2SiwhXDLekRzKyhnbyldPHvC7BvLPVpdNUNR2KeMAiCN2D/kLNttZgQD5WjSxuBx3Q==", - "dev": true - } - } - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "path-to-regexp": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", - "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", - "dev": true, - "requires": { - "isarray": "0.0.1" - } - }, - "pathval": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", - "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", - "dev": true - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" - }, - "psl": { - "version": "1.1.31", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", - "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==" - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" - }, - "raven": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/raven/-/raven-1.1.3.tgz", - "integrity": "sha1-QnPBrm005CMPUbLAEEGjK5Iygio=", - "requires": { - "cookie": "0.3.1", - "json-stringify-safe": "5.0.1", - "lsmod": "1.0.0", - "stack-trace": "0.0.9", - "uuid": "3.0.0" - }, - "dependencies": { - "uuid": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.0.0.tgz", - "integrity": "sha1-Zyj8BFnEUNeWqZwxg3VpvfZy1yg=" - } - } - }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "dependencies": { - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" - } - } - }, - "require-like": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/require-like/-/require-like-0.1.2.tgz", - "integrity": "sha1-rW8wwTvs15cBDEaK+ndcDAprR/o=", - "dev": true - }, - "rimraf": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz", - "integrity": "sha1-7nEM5dk6j9uFb7Xqj/Di11k0sto=", - "optional": true, - "requires": { - "glob": "^6.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safe-json-stringify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz", - "integrity": "sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==", - "optional": true - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "sandboxed-module": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/sandboxed-module/-/sandboxed-module-2.0.3.tgz", - "integrity": "sha1-x+VFkzm7y6KMUwPusz9ug4e/upY=", - "dev": true, - "requires": { - "require-like": "0.1.2", - "stack-trace": "0.0.9" - } - }, - "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" - }, - "shimmer": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz", - "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==" - }, - "sinon": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.2.3.tgz", - "integrity": "sha512-i6j7sqcLEqTYqUcMV327waI745VASvYuSuQMCjbAwlpAeuCgKZ3LtrjDxAbu+GjNQR0FEDpywtwGCIh8GicNyg==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.3.0", - "@sinonjs/formatio": "^3.1.0", - "@sinonjs/samsam": "^3.0.2", - "diff": "^3.5.0", - "lolex": "^3.0.0", - "nise": "^1.4.8", - "supports-color": "^5.5.0" - }, - "dependencies": { - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "sinon-chai": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/sinon-chai/-/sinon-chai-3.3.0.tgz", - "integrity": "sha512-r2JhDY7gbbmh5z3Q62pNbrjxZdOAjpsqW/8yxAZRSqLZqowmfGZPGUZPFf3UX36NLis0cv8VEM5IJh9HgkSOAA==", - "dev": true - }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "stack-chain": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/stack-chain/-/stack-chain-1.3.7.tgz", - "integrity": "sha1-0ZLJ/06moiyUxN1FkXHj8AzqEoU=" - }, - "stack-trace": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.9.tgz", - "integrity": "sha1-qPbq7KkGdMMz58Q5U/J1tFFRBpU=" - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - } - } - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" - }, - "type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "requires": { - "punycode": "^2.1.0" - } - }, - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - } - } -} diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 692ba2b815..92f5a4dd81 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -8,7 +8,9 @@ }, "version": "1.7.0", "scripts": { - "test": "mocha test/**/*.js" + "test": "mocha test/**/*.js", + "format": "prettier-eslint '**/*.js' --list-different", + "format:fix": "prettier-eslint '**/*.js' --write" }, "dependencies": { "bunyan": "1.8.12", diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index a1f505d258..7d1ec558a4 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -1,20 +1,20 @@ -const SandboxedModule = require("sandboxed-module"); -const bunyan = require("bunyan"); -const chai = require("chai"); -const path = require("path"); -const sinon = require("sinon"); -const sinonChai = require("sinon-chai"); +const SandboxedModule = require('sandboxed-module') +const bunyan = require('bunyan') +const chai = require('chai') +const path = require('path') +const sinon = require('sinon') +const sinonChai = require('sinon-chai') -chai.use(sinonChai); -chai.should(); +chai.use(sinonChai) +chai.should() -const modulePath = path.join(__dirname, "../../logging-manager.js"); +const modulePath = path.join(__dirname, '../../logging-manager.js') -describe("LoggingManager", function() { +describe('LoggingManager', function() { beforeEach(function() { - this.start = Date.now(); - this.clock = sinon.useFakeTimers(this.start); - this.captureException = sinon.stub(); + this.start = Date.now() + this.clock = sinon.useFakeTimers(this.start) + this.captureException = sinon.stub() this.mockBunyanLogger = { debug: sinon.stub(), error: sinon.stub(), @@ -22,11 +22,11 @@ describe("LoggingManager", function() { info: sinon.stub(), level: sinon.stub(), warn: sinon.stub() - }; + } this.mockRavenClient = { captureException: this.captureException, once: sinon.stub().yields() - }; + } this.LoggingManager = SandboxedModule.require(modulePath, { globals: { console }, requires: { @@ -39,335 +39,335 @@ describe("LoggingManager", function() { }), request: (this.Request = sinon.stub()) } - }); - this.loggerName = "test"; - this.logger = this.LoggingManager.initialize(this.loggerName); - this.logger.initializeErrorReporting("test_dsn"); - }); + }) + this.loggerName = 'test' + this.logger = this.LoggingManager.initialize(this.loggerName) + this.logger.initializeErrorReporting('test_dsn') + }) afterEach(function() { - this.clock.restore(); - }); + this.clock.restore() + }) - describe("initialize", function() { + describe('initialize', function() { beforeEach(function() { - this.checkLogLevelStub = sinon.stub(this.LoggingManager, "checkLogLevel"); - this.Bunyan.createLogger.reset(); - }); + this.checkLogLevelStub = sinon.stub(this.LoggingManager, 'checkLogLevel') + this.Bunyan.createLogger.reset() + }) afterEach(function() { - this.checkLogLevelStub.restore(); - }); + this.checkLogLevelStub.restore() + }) - describe("not in production", function() { + describe('not in production', function() { beforeEach(function() { - this.logger = this.LoggingManager.initialize(this.loggerName); - }); + this.logger = this.LoggingManager.initialize(this.loggerName) + }) - it("should default to log level debug", function() { + it('should default to log level debug', function() { this.Bunyan.createLogger.firstCall.args[0].streams[0].level.should.equal( - "debug" - ); - }); + 'debug' + ) + }) - it("should not run checkLogLevel", function() { - this.checkLogLevelStub.should.not.have.been.called; - }); - }); + it('should not run checkLogLevel', function() { + this.checkLogLevelStub.should.not.have.been.called + }) + }) - describe("in production", function() { + describe('in production', function() { beforeEach(function() { - process.env.NODE_ENV = "production"; - this.logger = this.LoggingManager.initialize(this.loggerName); - }); + process.env.NODE_ENV = 'production' + this.logger = this.LoggingManager.initialize(this.loggerName) + }) - afterEach(() => delete process.env.NODE_ENV); + afterEach(() => delete process.env.NODE_ENV) - it("should default to log level warn", function() { + it('should default to log level warn', function() { this.Bunyan.createLogger.firstCall.args[0].streams[0].level.should.equal( - "warn" - ); - }); + 'warn' + ) + }) - it("should run checkLogLevel", function() { - this.checkLogLevelStub.should.have.been.calledOnce; - }); + it('should run checkLogLevel', function() { + this.checkLogLevelStub.should.have.been.calledOnce + }) - describe("after 1 minute", () => - it("should run checkLogLevel again", function() { - this.clock.tick(61 * 1000); - this.checkLogLevelStub.should.have.been.calledTwice; - })); + describe('after 1 minute', () => + it('should run checkLogLevel again', function() { + this.clock.tick(61 * 1000) + this.checkLogLevelStub.should.have.been.calledTwice + })) - describe("after 2 minutes", () => - it("should run checkLogLevel again", function() { - this.clock.tick(121 * 1000); - this.checkLogLevelStub.should.have.been.calledThrice; - })); - }); + describe('after 2 minutes', () => + it('should run checkLogLevel again', function() { + this.clock.tick(121 * 1000) + this.checkLogLevelStub.should.have.been.calledThrice + })) + }) - describe("when LOG_LEVEL set in env", function() { + describe('when LOG_LEVEL set in env', function() { beforeEach(function() { - process.env.LOG_LEVEL = "trace"; - this.LoggingManager.initialize(); - }); + process.env.LOG_LEVEL = 'trace' + this.LoggingManager.initialize() + }) - afterEach(() => delete process.env.LOG_LEVEL); + afterEach(() => delete process.env.LOG_LEVEL) - it("should use custom log level", function() { + it('should use custom log level', function() { this.Bunyan.createLogger.firstCall.args[0].streams[0].level.should.equal( - "trace" - ); - }); - }); - }); + 'trace' + ) + }) + }) + }) - describe("bunyan logging", function() { + describe('bunyan logging', function() { beforeEach(function() { - this.logArgs = [{ foo: "bar" }, "foo", "bar"]; - }); + this.logArgs = [{ foo: 'bar' }, 'foo', 'bar'] + }) - it("should log debug", function() { - this.logger.debug(this.logArgs); - this.mockBunyanLogger.debug.should.have.been.calledWith(this.logArgs); - }); + it('should log debug', function() { + this.logger.debug(this.logArgs) + this.mockBunyanLogger.debug.should.have.been.calledWith(this.logArgs) + }) - it("should log error", function() { - this.logger.error(this.logArgs); - this.mockBunyanLogger.error.should.have.been.calledWith(this.logArgs); - }); + it('should log error', function() { + this.logger.error(this.logArgs) + this.mockBunyanLogger.error.should.have.been.calledWith(this.logArgs) + }) - it("should log fatal", function() { - this.logger.fatal(this.logArgs); - this.mockBunyanLogger.fatal.should.have.been.calledWith(this.logArgs); - }); + it('should log fatal', function() { + this.logger.fatal(this.logArgs) + this.mockBunyanLogger.fatal.should.have.been.calledWith(this.logArgs) + }) - it("should log info", function() { - this.logger.info(this.logArgs); - this.mockBunyanLogger.info.should.have.been.calledWith(this.logArgs); - }); + it('should log info', function() { + this.logger.info(this.logArgs) + this.mockBunyanLogger.info.should.have.been.calledWith(this.logArgs) + }) - it("should log warn", function() { - this.logger.warn(this.logArgs); - this.mockBunyanLogger.warn.should.have.been.calledWith(this.logArgs); - }); + it('should log warn', function() { + this.logger.warn(this.logArgs) + this.mockBunyanLogger.warn.should.have.been.calledWith(this.logArgs) + }) - it("should log err", function() { - this.logger.err(this.logArgs); - this.mockBunyanLogger.error.should.have.been.calledWith(this.logArgs); - }); + it('should log err', function() { + this.logger.err(this.logArgs) + this.mockBunyanLogger.error.should.have.been.calledWith(this.logArgs) + }) - it("should log log", function() { - this.logger.log(this.logArgs); - this.mockBunyanLogger.info.should.have.been.calledWith(this.logArgs); - }); - }); + it('should log log', function() { + this.logger.log(this.logArgs) + this.mockBunyanLogger.info.should.have.been.calledWith(this.logArgs) + }) + }) - describe("logger.error", function() { - it("should report a single error to sentry", function() { - this.logger.error({ foo: "bar" }, "message"); - this.captureException.called.should.equal(true); - }); + describe('logger.error', function() { + it('should report a single error to sentry', function() { + this.logger.error({ foo: 'bar' }, 'message') + this.captureException.called.should.equal(true) + }) - it("should report the same error to sentry only once", function() { - const error1 = new Error("this is the error"); - this.logger.error({ foo: error1 }, "first message"); - this.logger.error({ bar: error1 }, "second message"); - this.captureException.callCount.should.equal(1); - }); + it('should report the same error to sentry only once', function() { + const error1 = new Error('this is the error') + this.logger.error({ foo: error1 }, 'first message') + this.logger.error({ bar: error1 }, 'second message') + this.captureException.callCount.should.equal(1) + }) - it("should report two different errors to sentry individually", function() { - const error1 = new Error("this is the error"); - const error2 = new Error("this is the error"); - this.logger.error({ foo: error1 }, "first message"); - this.logger.error({ bar: error2 }, "second message"); - this.captureException.callCount.should.equal(2); - }); + it('should report two different errors to sentry individually', function() { + const error1 = new Error('this is the error') + const error2 = new Error('this is the error') + this.logger.error({ foo: error1 }, 'first message') + this.logger.error({ bar: error2 }, 'second message') + this.captureException.callCount.should.equal(2) + }) - it("should remove the path from fs errors", function() { + it('should remove the path from fs errors', function() { const fsError = new Error( "Error: ENOENT: no such file or directory, stat '/tmp/3279b8d0-da10-11e8-8255-efd98985942b'" - ); - fsError.path = "/tmp/3279b8d0-da10-11e8-8255-efd98985942b"; - this.logger.error({ err: fsError }, "message"); + ) + fsError.path = '/tmp/3279b8d0-da10-11e8-8255-efd98985942b' + this.logger.error({ err: fsError }, 'message') this.captureException .calledWith( sinon.match.has( - "message", - "Error: ENOENT: no such file or directory, stat" + 'message', + 'Error: ENOENT: no such file or directory, stat' ) ) - .should.equal(true); - }); + .should.equal(true) + }) - it("for multiple errors should only report a maximum of 5 errors to sentry", function() { - this.logger.error({ foo: "bar" }, "message"); - this.logger.error({ foo: "bar" }, "message"); - this.logger.error({ foo: "bar" }, "message"); - this.logger.error({ foo: "bar" }, "message"); - this.logger.error({ foo: "bar" }, "message"); - this.logger.error({ foo: "bar" }, "message"); - this.logger.error({ foo: "bar" }, "message"); - this.logger.error({ foo: "bar" }, "message"); - this.logger.error({ foo: "bar" }, "message"); - this.captureException.callCount.should.equal(5); - }); + it('for multiple errors should only report a maximum of 5 errors to sentry', function() { + this.logger.error({ foo: 'bar' }, 'message') + this.logger.error({ foo: 'bar' }, 'message') + this.logger.error({ foo: 'bar' }, 'message') + this.logger.error({ foo: 'bar' }, 'message') + this.logger.error({ foo: 'bar' }, 'message') + this.logger.error({ foo: 'bar' }, 'message') + this.logger.error({ foo: 'bar' }, 'message') + this.logger.error({ foo: 'bar' }, 'message') + this.logger.error({ foo: 'bar' }, 'message') + this.captureException.callCount.should.equal(5) + }) - it("for multiple errors with a minute delay should report 10 errors to sentry", function() { + it('for multiple errors with a minute delay should report 10 errors to sentry', function() { // the first five errors should be reported to sentry - this.logger.error({ foo: "bar" }, "message"); - this.logger.error({ foo: "bar" }, "message"); - this.logger.error({ foo: "bar" }, "message"); - this.logger.error({ foo: "bar" }, "message"); - this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: 'bar' }, 'message') + this.logger.error({ foo: 'bar' }, 'message') + this.logger.error({ foo: 'bar' }, 'message') + this.logger.error({ foo: 'bar' }, 'message') + this.logger.error({ foo: 'bar' }, 'message') // the following errors should not be reported - this.logger.error({ foo: "bar" }, "message"); - this.logger.error({ foo: "bar" }, "message"); - this.logger.error({ foo: "bar" }, "message"); - this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: 'bar' }, 'message') + this.logger.error({ foo: 'bar' }, 'message') + this.logger.error({ foo: 'bar' }, 'message') + this.logger.error({ foo: 'bar' }, 'message') // allow a minute to pass - this.clock.tick(this.start + 61 * 1000); + this.clock.tick(this.start + 61 * 1000) // after a minute the next five errors should be reported to sentry - this.logger.error({ foo: "bar" }, "message"); - this.logger.error({ foo: "bar" }, "message"); - this.logger.error({ foo: "bar" }, "message"); - this.logger.error({ foo: "bar" }, "message"); - this.logger.error({ foo: "bar" }, "message"); + this.logger.error({ foo: 'bar' }, 'message') + this.logger.error({ foo: 'bar' }, 'message') + this.logger.error({ foo: 'bar' }, 'message') + this.logger.error({ foo: 'bar' }, 'message') + this.logger.error({ foo: 'bar' }, 'message') // the following errors should not be reported to sentry - this.logger.error({ foo: "bar" }, "message"); - this.logger.error({ foo: "bar" }, "message"); - this.logger.error({ foo: "bar" }, "message"); - this.logger.error({ foo: "bar" }, "message"); - this.captureException.callCount.should.equal(10); - }); - }); + this.logger.error({ foo: 'bar' }, 'message') + this.logger.error({ foo: 'bar' }, 'message') + this.logger.error({ foo: 'bar' }, 'message') + this.logger.error({ foo: 'bar' }, 'message') + this.captureException.callCount.should.equal(10) + }) + }) - describe("checkLogLevel", function() { - it("should request log level override from google meta data service", function() { - this.logger.checkLogLevel(); + describe('checkLogLevel', function() { + it('should request log level override from google meta data service', function() { + this.logger.checkLogLevel() const options = { headers: { - "Metadata-Flavor": "Google" + 'Metadata-Flavor': 'Google' }, uri: `http://metadata.google.internal/computeMetadata/v1/project/attributes/${ this.loggerName }-setLogLevelEndTime` - }; - this.Request.should.have.been.calledWithMatch(options); - }); + } + this.Request.should.have.been.calledWithMatch(options) + }) - describe("when request has error", function() { + describe('when request has error', function() { beforeEach(function() { - this.Request.yields("error"); - this.logger.checkLogLevel(); - }); + this.Request.yields('error') + this.logger.checkLogLevel() + }) - it("should only set default level", function() { + it('should only set default level', function() { this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith( - "debug" - ); - }); - }); + 'debug' + ) + }) + }) - describe("when statusCode is not 200", function() { + describe('when statusCode is not 200', function() { beforeEach(function() { - this.Request.yields(null, { statusCode: 404 }); - this.logger.checkLogLevel(); - }); + this.Request.yields(null, { statusCode: 404 }) + this.logger.checkLogLevel() + }) - it("should only set default level", function() { + it('should only set default level', function() { this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith( - "debug" - ); - }); - }); + 'debug' + ) + }) + }) - describe("when time value returned that is less than current time", function() { + describe('when time value returned that is less than current time', function() { beforeEach(function() { - this.Request.yields(null, { statusCode: 200 }, "1"); - this.logger.checkLogLevel(); - }); + this.Request.yields(null, { statusCode: 200 }, '1') + this.logger.checkLogLevel() + }) - it("should only set default level", function() { + it('should only set default level', function() { this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith( - "debug" - ); - }); - }); + 'debug' + ) + }) + }) - describe("when time value returned that is less than current time", function() { - describe("when level is already set", function() { + describe('when time value returned that is less than current time', function() { + describe('when level is already set', function() { beforeEach(function() { - this.mockBunyanLogger.level.returns(10); - this.Request.yields(null, { statusCode: 200 }, this.start + 1000); - this.logger.checkLogLevel(); - }); + this.mockBunyanLogger.level.returns(10) + this.Request.yields(null, { statusCode: 200 }, this.start + 1000) + this.logger.checkLogLevel() + }) - it("should set trace level", function() { + it('should set trace level', function() { this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith( - "trace" - ); - }); - }); + 'trace' + ) + }) + }) - describe("when level is not already set", function() { + describe('when level is not already set', function() { beforeEach(function() { - this.mockBunyanLogger.level.returns(20); - this.Request.yields(null, { statusCode: 200 }, this.start + 1000); - this.logger.checkLogLevel(); - }); + this.mockBunyanLogger.level.returns(20) + this.Request.yields(null, { statusCode: 200 }, this.start + 1000) + this.logger.checkLogLevel() + }) - it("should set trace level", function() { + it('should set trace level', function() { this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith( - "trace" - ); - }); - }); - }); - }); + 'trace' + ) + }) + }) + }) + }) - describe("ringbuffer", function() { + describe('ringbuffer', function() { beforeEach(function() { this.logBufferMock = [ { - msg: "log 1" + msg: 'log 1' }, { - msg: "log 2" + msg: 'log 2' } - ]; - }); + ] + }) - describe("in production", function() { + describe('in production', function() { beforeEach(function() { - process.env["NODE_ENV"] = "production"; - this.logger = this.LoggingManager.initialize(this.loggerName); - this.logger.ringBuffer.records = this.logBufferMock; - this.logger.error({}, "error"); - }); + process.env['NODE_ENV'] = 'production' + this.logger = this.LoggingManager.initialize(this.loggerName) + this.logger.ringBuffer.records = this.logBufferMock + this.logger.error({}, 'error') + }) afterEach(function() { - process.env["NODE_ENV"] = undefined; - }); + process.env['NODE_ENV'] = undefined + }) - it("should include buffered logs in error log", function() { + it('should include buffered logs in error log', function() { this.mockBunyanLogger.error.lastCall.args[0].logBuffer.should.equal( this.logBufferMock - ); - }); - }); + ) + }) + }) - describe("not in production", function() { + describe('not in production', function() { beforeEach(function() { - this.logger = this.LoggingManager.initialize(this.loggerName); - this.logger.ringBuffer.records = this.logBufferMock; - this.logger.error({}, "error"); - }); + this.logger = this.LoggingManager.initialize(this.loggerName) + this.logger.ringBuffer.records = this.logBufferMock + this.logger.error({}, 'error') + }) - it("should not include buffered logs in error log", function() { + it('should not include buffered logs in error log', function() { chai.expect(this.mockBunyanLogger.error.lastCall.args[0].logBuffer).be - .undefined; - }); - }); - }); -}); + .undefined + }) + }) + }) +}) From b31022e329655d858694296d491796db83241a4d Mon Sep 17 00:00:00 2001 From: Ersun Warncke Date: Fri, 8 Mar 2019 12:16:21 -0400 Subject: [PATCH 40/93] remove jsx and react from eslint config and add eslint modules --- libraries/logger/.eslintrc | 33 +---------------------------- libraries/logger/logging-manager.js | 5 ++++- libraries/logger/package.json | 13 +++++++++++- 3 files changed, 17 insertions(+), 34 deletions(-) diff --git a/libraries/logger/.eslintrc b/libraries/logger/.eslintrc index 5ca14a0e9f..b0db54a22f 100644 --- a/libraries/logger/.eslintrc +++ b/libraries/logger/.eslintrc @@ -1,14 +1,10 @@ { "extends": [ "standard", - "standard-react", "prettier", - "prettier/react", - "prettier/standard", - "plugin:jsx-a11y/recommended" + "prettier/standard" ], "plugins": [ - "jsx-a11y", "mocha", "chai-expect", "chai-friendly" @@ -19,17 +15,8 @@ "globals": { "expect": true, "define": true, - "$": true, - "angular": true, - // Injected in layout.pug - "user_id": true, - "ace": true }, "settings": { - // Tell eslint-plugin-react to detect which version of React we are using - "react": { - "version": "detect" - } }, "rules": { "max-len": ["error", { @@ -38,24 +25,6 @@ "ignorePattern": "(^\\s*(it|describe)\\s*\\(['\"]|^import\\s*.*\\s*from\\s*['\"]|^.*\\s*=\\s*require\\(['\"])" }], - // Fix conflict between prettier & standard by overriding to prefer - // double quotes - "jsx-quotes": ["error", "prefer-double"], - - // Override weird behaviour of jsx-a11y label-has-for (says labels must be - // nested *and* have for/id attributes) - "jsx-a11y/label-has-for": [ - "error", - { - "required": { - "some": [ - "nesting", - "id" - ] - } - } - ], - // Add some mocha specific rules "mocha/handle-done-callback": "error", "mocha/no-exclusive-tests": "error", diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index 04e3bc18b2..63fb9fa942 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -1,7 +1,7 @@ const bunyan = require('bunyan') const request = require('request') -Logger = module.exports = { +const Logger = module.exports = { initialize(name) { this.isProduction = (process.env['NODE_ENV'] || '').toLowerCase() === 'production' @@ -50,6 +50,9 @@ Logger = module.exports = { }-setLogLevelEndTime` } request(options, (err, response, body) => { + if (err) { + return + } if (parseInt(body) > Date.now()) { this.logger.level('trace') } else { diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 92f5a4dd81..381905ff23 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -10,7 +10,8 @@ "scripts": { "test": "mocha test/**/*.js", "format": "prettier-eslint '**/*.js' --list-different", - "format:fix": "prettier-eslint '**/*.js' --write" + "format:fix": "prettier-eslint '**/*.js' --write", + "lint": "eslint -f unix ." }, "dependencies": { "bunyan": "1.8.12", @@ -19,6 +20,16 @@ }, "devDependencies": { "chai": "4.2.0", + "eslint": "^4.18.1", + "eslint-config-prettier": "^3.1.0", + "eslint-config-standard": "^11.0.0", + "eslint-plugin-chai-expect": "^1.1.1", + "eslint-plugin-chai-friendly": "^0.4.1", + "eslint-plugin-import": "^2.9.0", + "eslint-plugin-mocha": "^5.2.0", + "eslint-plugin-node": "^6.0.0", + "eslint-plugin-promise": "^3.6.0", + "eslint-plugin-standard": "^3.0.1", "mocha": "5.2.0", "sandboxed-module": "2.0.3", "sinon": "7.2.3", From cb22e98766b080ea9640c4380a70b9677afebeb1 Mon Sep 17 00:00:00 2001 From: Ersun Warncke Date: Mon, 11 Mar 2019 10:27:35 -0400 Subject: [PATCH 41/93] default ring buffer size to zero --- libraries/logger/logging-manager.js | 36 +++++++++++-------- .../logger/test/unit/loggingManagerTests.js | 14 +++++--- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index 63fb9fa942..92a8f88171 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -8,23 +8,28 @@ const Logger = module.exports = { this.defaultLevel = process.env['LOG_LEVEL'] || (this.isProduction ? 'warn' : 'debug') this.loggerName = name - this.ringBuffer = new bunyan.RingBuffer({ - limit: process.env['LOG_RING_BUFFER_SIZE'] || 30 - }) + this.ringBufferSize = parseInt(process.env['LOG_RING_BUFFER_SIZE']) || 0 + const loggerStreams = [ + { + level: this.defaultLevel, + stream: process.stdout + } + ] + if (this.ringBufferSize > 0) { + this.ringBuffer = new bunyan.RingBuffer({limit: this.ringBufferSize}) + loggerStreams.push({ + level: 'trace', + type: 'raw', + stream: this.ringBuffer + }) + } + else { + this.ringBuffer = null + } this.logger = bunyan.createLogger({ name, serializers: bunyan.stdSerializers, - streams: [ - { - level: this.defaultLevel, - stream: process.stdout - }, - { - level: 'trace', - type: 'raw', - stream: this.ringBuffer - } - ] + streams: loggerStreams }) if (this.isProduction) { // clear interval if already set @@ -51,6 +56,7 @@ const Logger = module.exports = { } request(options, (err, response, body) => { if (err) { + this.logger.level(this.defaultLevel) return } if (parseInt(body) > Date.now()) { @@ -165,7 +171,7 @@ const Logger = module.exports = { }, error(attributes, message, ...args) { - if (this.isProduction) { + if (this.ringBuffer !== null) { attributes.logBuffer = this.ringBuffer.records } this.logger.error(attributes, message, ...Array.from(args)) diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index 7d1ec558a4..c45ef4e564 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -338,16 +338,16 @@ describe('LoggingManager', function() { ] }) - describe('in production', function() { + describe('when ring buffer size is positive', function() { beforeEach(function() { - process.env['NODE_ENV'] = 'production' + process.env['LOG_RING_BUFFER_SIZE'] = '20' this.logger = this.LoggingManager.initialize(this.loggerName) this.logger.ringBuffer.records = this.logBufferMock this.logger.error({}, 'error') }) afterEach(function() { - process.env['NODE_ENV'] = undefined + process.env['LOG_RING_BUFFER_SIZE'] = undefined }) it('should include buffered logs in error log', function() { @@ -357,13 +357,17 @@ describe('LoggingManager', function() { }) }) - describe('not in production', function() { + describe('when ring buffer size is zero', function() { beforeEach(function() { + process.env['LOG_RING_BUFFER_SIZE'] = '0' this.logger = this.LoggingManager.initialize(this.loggerName) - this.logger.ringBuffer.records = this.logBufferMock this.logger.error({}, 'error') }) + afterEach(function() { + process.env['LOG_RING_BUFFER_SIZE'] = undefined + }) + it('should not include buffered logs in error log', function() { chai.expect(this.mockBunyanLogger.error.lastCall.args[0].logBuffer).be .undefined From 1809d6e403a0b223dd211bc525ff2c7efea3ecc1 Mon Sep 17 00:00:00 2001 From: Ersun Warncke Date: Tue, 12 Mar 2019 08:23:37 -0400 Subject: [PATCH 42/93] filter out error logs in buffer --- libraries/logger/logging-manager.js | 6 ++++-- .../logger/test/unit/loggingManagerTests.js | 17 +++++++++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index 92a8f88171..cf702ac821 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -171,8 +171,10 @@ const Logger = module.exports = { }, error(attributes, message, ...args) { - if (this.ringBuffer !== null) { - attributes.logBuffer = this.ringBuffer.records + if (this.ringBuffer !== null && Array.isArray(this.ringBuffer.records)) { + attributes.logBuffer = this.ringBuffer.records.filter(function (record) { + return record.level !== 50 + }) } this.logger.error(attributes, message, ...Array.from(args)) if (this.raven != null) { diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index c45ef4e564..dc8ac244b2 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -334,6 +334,10 @@ describe('LoggingManager', function() { }, { msg: 'log 2' + }, + { + level: 50, + msg: 'error' } ] }) @@ -350,10 +354,15 @@ describe('LoggingManager', function() { process.env['LOG_RING_BUFFER_SIZE'] = undefined }) - it('should include buffered logs in error log', function() { - this.mockBunyanLogger.error.lastCall.args[0].logBuffer.should.equal( - this.logBufferMock - ) + it('should include buffered logs in error log and filter out error logs in buffer', function() { + this.mockBunyanLogger.error.lastCall.args[0].logBuffer.should.deep.equal([ + { + msg: 'log 1' + }, + { + msg: 'log 2' + }, + ]) }) }) From 6b3e7e4ffc77659354152f466576a7941705e061 Mon Sep 17 00:00:00 2001 From: Miguel Serrano Date: Thu, 11 Jul 2019 12:11:09 +0200 Subject: [PATCH 43/93] replace bunyan error serializer with custom one (#14) --- libraries/logger/logging-manager.js | 21 ++++++++++++++++++- libraries/logger/package.json | 1 + .../logger/test/unit/loggingManagerTests.js | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index cf702ac821..794f23eccb 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -1,5 +1,20 @@ const bunyan = require('bunyan') const request = require('request') +const OError = require('@overleaf/o-error') + +// bunyan error serializer +const errSerializer = function (err) { + if (!err || !err.stack) + return err; + return { + message: err.message, + name: err.name, + stack: OError.getFullStack(err), + info: OError.getFullInfo(err), + code: err.code, + signal: err.signal + }; +}; const Logger = module.exports = { initialize(name) { @@ -28,7 +43,11 @@ const Logger = module.exports = { } this.logger = bunyan.createLogger({ name, - serializers: bunyan.stdSerializers, + serializers: { + err: errSerializer, + req: bunyan.stdSerializers.req, + res: bunyan.stdSerializers.res + }, streams: loggerStreams }) if (this.isProduction) { diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 381905ff23..0e15917c4a 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -14,6 +14,7 @@ "lint": "eslint -f unix ." }, "dependencies": { + "@overleaf/o-error": "^2.0.0", "bunyan": "1.8.12", "raven": "1.1.3", "request": "2.88.0" diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index dc8ac244b2..d3714635df 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -28,7 +28,7 @@ describe('LoggingManager', function() { once: sinon.stub().yields() } this.LoggingManager = SandboxedModule.require(modulePath, { - globals: { console }, + globals: { console, process }, requires: { bunyan: (this.Bunyan = { createLogger: sinon.stub().returns(this.mockBunyanLogger), From 7e6b562981bc70a5bd810f9d6a38cf86e896565f Mon Sep 17 00:00:00 2001 From: Miguel Serrano Date: Thu, 11 Jul 2019 13:25:09 +0200 Subject: [PATCH 44/93] Fix test setup (#15) --- libraries/logger/test/unit/loggingManagerTests.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index d3714635df..cb4d2ca473 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -32,7 +32,11 @@ describe('LoggingManager', function() { requires: { bunyan: (this.Bunyan = { createLogger: sinon.stub().returns(this.mockBunyanLogger), - RingBuffer: bunyan.RingBuffer + RingBuffer: bunyan.RingBuffer, + stdSerializers: { + req: sinon.stub(), + res: sinon.stub() + } }), raven: (this.Raven = { Client: sinon.stub().returns(this.mockRavenClient) From 1482e6841b1ae8f9bac38644c31f761454d9f538 Mon Sep 17 00:00:00 2001 From: John Lees-Miller Date: Thu, 11 Jul 2019 13:07:47 +0100 Subject: [PATCH 45/93] Bump to 1.8.0 and include license --- libraries/logger/LICENSE.txt | 661 ++++++++++++++++++++++++++++++++++ libraries/logger/package.json | 3 +- 2 files changed, 663 insertions(+), 1 deletion(-) create mode 100644 libraries/logger/LICENSE.txt diff --git a/libraries/logger/LICENSE.txt b/libraries/logger/LICENSE.txt new file mode 100644 index 0000000000..dba13ed2dd --- /dev/null +++ b/libraries/logger/LICENSE.txt @@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 0e15917c4a..6c18e516d8 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -6,7 +6,8 @@ "type": "git", "url": "http://github.com/sharelatex/logger-sharelatex.git" }, - "version": "1.7.0", + "license": "AGPL-3.0-only", + "version": "1.8.0", "scripts": { "test": "mocha test/**/*.js", "format": "prettier-eslint '**/*.js' --list-different", From 905d65931ab3b26d51da6bf42e7924e94447cd51 Mon Sep 17 00:00:00 2001 From: Eric Mc Sween Date: Wed, 23 Oct 2019 16:25:48 -0400 Subject: [PATCH 46/93] Small cleanup, satisfy linter, add prettier --- libraries/logger/.eslintrc | 6 -- libraries/logger/logging-manager.js | 56 +++++------ libraries/logger/package.json | 3 +- .../logger/test/unit/loggingManagerTests.js | 92 +++++++++---------- 4 files changed, 68 insertions(+), 89 deletions(-) diff --git a/libraries/logger/.eslintrc b/libraries/logger/.eslintrc index b0db54a22f..3efdae4f58 100644 --- a/libraries/logger/.eslintrc +++ b/libraries/logger/.eslintrc @@ -19,12 +19,6 @@ "settings": { }, "rules": { - "max-len": ["error", { - "ignoreUrls": true, - // Ignore long describe/it test blocks, long import/require statements - "ignorePattern": "(^\\s*(it|describe)\\s*\\(['\"]|^import\\s*.*\\s*from\\s*['\"]|^.*\\s*=\\s*require\\(['\"])" - }], - // Add some mocha specific rules "mocha/handle-done-callback": "error", "mocha/no-exclusive-tests": "error", diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index 794f23eccb..541d612137 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -3,9 +3,10 @@ const request = require('request') const OError = require('@overleaf/o-error') // bunyan error serializer -const errSerializer = function (err) { - if (!err || !err.stack) - return err; +const errSerializer = function(err) { + if (!err || !err.stack) { + return err + } return { message: err.message, name: err.name, @@ -13,10 +14,10 @@ const errSerializer = function (err) { info: OError.getFullInfo(err), code: err.code, signal: err.signal - }; -}; + } +} -const Logger = module.exports = { +const Logger = (module.exports = { initialize(name) { this.isProduction = (process.env['NODE_ENV'] || '').toLowerCase() === 'production' @@ -31,14 +32,13 @@ const Logger = module.exports = { } ] if (this.ringBufferSize > 0) { - this.ringBuffer = new bunyan.RingBuffer({limit: this.ringBufferSize}) + this.ringBuffer = new bunyan.RingBuffer({ limit: this.ringBufferSize }) loggerStreams.push({ level: 'trace', type: 'raw', stream: this.ringBuffer }) - } - else { + } else { this.ringBuffer = null } this.logger = bunyan.createLogger({ @@ -69,9 +69,7 @@ const Logger = module.exports = { headers: { 'Metadata-Flavor': 'Google' }, - uri: `http://metadata.google.internal/computeMetadata/v1/project/attributes/${ - this.loggerName - }-setLogLevelEndTime` + uri: `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` } request(options, (err, response, body) => { if (err) { @@ -86,9 +84,9 @@ const Logger = module.exports = { }) }, - initializeErrorReporting(sentry_dsn, options) { + initializeErrorReporting(sentryDsn, options) { const raven = require('raven') - this.raven = new raven.Client(sentry_dsn, options) + this.raven = new raven.Client(sentryDsn, options) this.lastErrorTimeStamp = 0 // for rate limiting on sentry reporting this.lastErrorCount = 0 }, @@ -154,25 +152,21 @@ const Logger = module.exports = { if (error.path) { error.message = error.message.replace(` '${error.path}'`, '') } - } catch (error1) {} - // send the error to sentry - try { + + // send the error to sentry this.raven.captureException(error, { tags, extra, level }) + // put a flag on the errors to avoid reporting them multiple times - return (() => { - const result = [] - for (key in attributes) { - value = attributes[key] - if (value instanceof Error) { - result.push((value.reportedToSentry = true)) - } else { - result.push(undefined) - } + const result = [] + for (key in attributes) { + value = attributes[key] + if (value instanceof Error) { + value.reportedToSentry = true } return result - })() - } catch (error2) { - return + } + } catch (err) { + // ignore Raven errors } } }, @@ -191,7 +185,7 @@ const Logger = module.exports = { error(attributes, message, ...args) { if (this.ringBuffer !== null && Array.isArray(this.ringBuffer.records)) { - attributes.logBuffer = this.ringBuffer.records.filter(function (record) { + attributes.logBuffer = this.ringBuffer.records.filter(function(record) { return record.level !== 50 }) } @@ -245,6 +239,6 @@ const Logger = module.exports = { return callback() } } -} +}) Logger.initialize('default-sharelatex') diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 6c18e516d8..09515adc53 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -32,7 +32,8 @@ "eslint-plugin-node": "^6.0.0", "eslint-plugin-promise": "^3.6.0", "eslint-plugin-standard": "^3.0.1", - "mocha": "5.2.0", + "mocha": "^5.2.0", + "prettier": "^1.18.2", "sandboxed-module": "2.0.3", "sinon": "7.2.3", "sinon-chai": "3.3.0" diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index cb4d2ca473..4a55717ec6 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -7,6 +7,7 @@ const sinonChai = require('sinon-chai') chai.use(sinonChai) chai.should() +const expect = chai.expect const modulePath = path.join(__dirname, '../../logging-manager.js') @@ -15,7 +16,7 @@ describe('LoggingManager', function() { this.start = Date.now() this.clock = sinon.useFakeTimers(this.start) this.captureException = sinon.stub() - this.mockBunyanLogger = { + this.bunyanLogger = { debug: sinon.stub(), error: sinon.stub(), fatal: sinon.stub(), @@ -23,25 +24,28 @@ describe('LoggingManager', function() { level: sinon.stub(), warn: sinon.stub() } - this.mockRavenClient = { + this.ravenClient = { captureException: this.captureException, once: sinon.stub().yields() } + this.Bunyan = { + createLogger: sinon.stub().returns(this.bunyanLogger), + RingBuffer: bunyan.RingBuffer, + stdSerializers: { + req: sinon.stub(), + res: sinon.stub() + } + } + this.Raven = { + Client: sinon.stub().returns(this.ravenClient) + } + this.Request = sinon.stub() this.LoggingManager = SandboxedModule.require(modulePath, { globals: { console, process }, requires: { - bunyan: (this.Bunyan = { - createLogger: sinon.stub().returns(this.mockBunyanLogger), - RingBuffer: bunyan.RingBuffer, - stdSerializers: { - req: sinon.stub(), - res: sinon.stub() - } - }), - raven: (this.Raven = { - Client: sinon.stub().returns(this.mockRavenClient) - }), - request: (this.Request = sinon.stub()) + bunyan: this.Bunyan, + raven: this.Raven, + request: this.Request } }) this.loggerName = 'test' @@ -133,37 +137,37 @@ describe('LoggingManager', function() { it('should log debug', function() { this.logger.debug(this.logArgs) - this.mockBunyanLogger.debug.should.have.been.calledWith(this.logArgs) + this.bunyanLogger.debug.should.have.been.calledWith(this.logArgs) }) it('should log error', function() { this.logger.error(this.logArgs) - this.mockBunyanLogger.error.should.have.been.calledWith(this.logArgs) + this.bunyanLogger.error.should.have.been.calledWith(this.logArgs) }) it('should log fatal', function() { this.logger.fatal(this.logArgs) - this.mockBunyanLogger.fatal.should.have.been.calledWith(this.logArgs) + this.bunyanLogger.fatal.should.have.been.calledWith(this.logArgs) }) it('should log info', function() { this.logger.info(this.logArgs) - this.mockBunyanLogger.info.should.have.been.calledWith(this.logArgs) + this.bunyanLogger.info.should.have.been.calledWith(this.logArgs) }) it('should log warn', function() { this.logger.warn(this.logArgs) - this.mockBunyanLogger.warn.should.have.been.calledWith(this.logArgs) + this.bunyanLogger.warn.should.have.been.calledWith(this.logArgs) }) it('should log err', function() { this.logger.err(this.logArgs) - this.mockBunyanLogger.error.should.have.been.calledWith(this.logArgs) + this.bunyanLogger.error.should.have.been.calledWith(this.logArgs) }) it('should log log', function() { this.logger.log(this.logArgs) - this.mockBunyanLogger.info.should.have.been.calledWith(this.logArgs) + this.bunyanLogger.info.should.have.been.calledWith(this.logArgs) }) }) @@ -253,9 +257,7 @@ describe('LoggingManager', function() { headers: { 'Metadata-Flavor': 'Google' }, - uri: `http://metadata.google.internal/computeMetadata/v1/project/attributes/${ - this.loggerName - }-setLogLevelEndTime` + uri: `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` } this.Request.should.have.been.calledWithMatch(options) }) @@ -267,7 +269,7 @@ describe('LoggingManager', function() { }) it('should only set default level', function() { - this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith( + this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( 'debug' ) }) @@ -280,7 +282,7 @@ describe('LoggingManager', function() { }) it('should only set default level', function() { - this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith( + this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( 'debug' ) }) @@ -293,22 +295,22 @@ describe('LoggingManager', function() { }) it('should only set default level', function() { - this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith( + this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( 'debug' ) }) }) - describe('when time value returned that is less than current time', function() { + describe('when time value returned that is more than current time', function() { describe('when level is already set', function() { beforeEach(function() { - this.mockBunyanLogger.level.returns(10) + this.bunyanLogger.level.returns(10) this.Request.yields(null, { statusCode: 200 }, this.start + 1000) this.logger.checkLogLevel() }) it('should set trace level', function() { - this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith( + this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( 'trace' ) }) @@ -316,13 +318,13 @@ describe('LoggingManager', function() { describe('when level is not already set', function() { beforeEach(function() { - this.mockBunyanLogger.level.returns(20) + this.bunyanLogger.level.returns(20) this.Request.yields(null, { statusCode: 200 }, this.start + 1000) this.logger.checkLogLevel() }) it('should set trace level', function() { - this.mockBunyanLogger.level.should.have.been.calledOnce.and.calledWith( + this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( 'trace' ) }) @@ -333,16 +335,9 @@ describe('LoggingManager', function() { describe('ringbuffer', function() { beforeEach(function() { this.logBufferMock = [ - { - msg: 'log 1' - }, - { - msg: 'log 2' - }, - { - level: 50, - msg: 'error' - } + { msg: 'log 1' }, + { msg: 'log 2' }, + { level: 50, msg: 'error' } ] }) @@ -359,13 +354,9 @@ describe('LoggingManager', function() { }) it('should include buffered logs in error log and filter out error logs in buffer', function() { - this.mockBunyanLogger.error.lastCall.args[0].logBuffer.should.deep.equal([ - { - msg: 'log 1' - }, - { - msg: 'log 2' - }, + this.bunyanLogger.error.lastCall.args[0].logBuffer.should.deep.equal([ + { msg: 'log 1' }, + { msg: 'log 2' } ]) }) }) @@ -382,8 +373,7 @@ describe('LoggingManager', function() { }) it('should not include buffered logs in error log', function() { - chai.expect(this.mockBunyanLogger.error.lastCall.args[0].logBuffer).be - .undefined + expect(this.bunyanLogger.error.lastCall.args[0].logBuffer).be.undefined }) }) }) From cb300b79eac60ec39f4a942ca91e88828d55d7f7 Mon Sep 17 00:00:00 2001 From: Eric Mc Sween Date: Thu, 24 Oct 2019 16:41:46 -0400 Subject: [PATCH 47/93] Add option to log to Stackdriver When the environment variable STACKDRIVER_LOGGING is set to true, logs are sent to Stackdriver in addition to stdout. --- libraries/logger/logging-manager.js | 74 +++++++++++-------- libraries/logger/package.json | 4 +- .../logger/test/unit/loggingManagerTests.js | 46 +++++++++++- 3 files changed, 93 insertions(+), 31 deletions(-) diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index 541d612137..f840771a8e 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -1,6 +1,8 @@ const bunyan = require('bunyan') const request = require('request') +const yn = require('yn') const OError = require('@overleaf/o-error') +const GCPLogging = require('@google-cloud/logging-bunyan') // bunyan error serializer const errSerializer = function(err) { @@ -24,23 +26,6 @@ const Logger = (module.exports = { this.defaultLevel = process.env['LOG_LEVEL'] || (this.isProduction ? 'warn' : 'debug') this.loggerName = name - this.ringBufferSize = parseInt(process.env['LOG_RING_BUFFER_SIZE']) || 0 - const loggerStreams = [ - { - level: this.defaultLevel, - stream: process.stdout - } - ] - if (this.ringBufferSize > 0) { - this.ringBuffer = new bunyan.RingBuffer({ limit: this.ringBufferSize }) - loggerStreams.push({ - level: 'trace', - type: 'raw', - stream: this.ringBuffer - }) - } else { - this.ringBuffer = null - } this.logger = bunyan.createLogger({ name, serializers: { @@ -48,19 +33,11 @@ const Logger = (module.exports = { req: bunyan.stdSerializers.req, res: bunyan.stdSerializers.res }, - streams: loggerStreams + streams: [{ level: this.defaultLevel, stream: process.stdout }] }) - if (this.isProduction) { - // clear interval if already set - if (this.checkInterval) { - clearInterval(this.checkInterval) - } - // check for log level override on startup - this.checkLogLevel() - // re-check log level every minute - const checkLogLevel = () => this.checkLogLevel() - this.checkInterval = setInterval(checkLogLevel, 1000 * 60) - } + this._setupRingBuffer() + this._setupStackdriver() + this._setupLogLevelChecker() return this }, @@ -238,6 +215,45 @@ const Logger = (module.exports = { } else { return callback() } + }, + + _setupRingBuffer() { + this.ringBufferSize = parseInt(process.env['LOG_RING_BUFFER_SIZE']) || 0 + if (this.ringBufferSize > 0) { + this.ringBuffer = new bunyan.RingBuffer({ limit: this.ringBufferSize }) + this.logger.addStream({ + level: 'trace', + type: 'raw', + stream: this.ringBuffer + }) + } else { + this.ringBuffer = null + } + }, + + _setupStackdriver() { + const stackdriverEnabled = yn(process.env['STACKDRIVER_LOGGING']) + if (!stackdriverEnabled) { + return + } + const stackdriverClient = new GCPLogging.LoggingBunyan({ + logName: this.loggerName, + serviceContext: { service: this.loggerName } + }) + this.logger.addStream(stackdriverClient.stream(this.defaultLevel)) + }, + + _setupLogLevelChecker() { + if (this.isProduction) { + // clear interval if already set + if (this.checkInterval) { + clearInterval(this.checkInterval) + } + // check for log level override on startup + this.checkLogLevel() + // re-check log level every minute + this.checkInterval = setInterval(this.checkLogLevel.bind(this), 1000 * 60) + } } }) diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 09515adc53..ba27b8848f 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -15,10 +15,12 @@ "lint": "eslint -f unix ." }, "dependencies": { + "@google-cloud/logging-bunyan": "^2.0.0", "@overleaf/o-error": "^2.0.0", "bunyan": "1.8.12", "raven": "1.1.3", - "request": "2.88.0" + "request": "2.88.0", + "yn": "^3.1.1" }, "devDependencies": { "chai": "4.2.0", diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index 4a55717ec6..f94d92f9cf 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -17,6 +17,7 @@ describe('LoggingManager', function() { this.clock = sinon.useFakeTimers(this.start) this.captureException = sinon.stub() this.bunyanLogger = { + addStream: sinon.stub(), debug: sinon.stub(), error: sinon.stub(), fatal: sinon.stub(), @@ -40,12 +41,20 @@ describe('LoggingManager', function() { Client: sinon.stub().returns(this.ravenClient) } this.Request = sinon.stub() + this.stackdriverStreamConfig = { stream: 'stackdriver' } + this.stackdriverClient = { + stream: sinon.stub().returns(this.stackdriverStreamConfig) + } + this.GCPLogging = { + LoggingBunyan: sinon.stub().returns(this.stackdriverClient) + } this.LoggingManager = SandboxedModule.require(modulePath, { globals: { console, process }, requires: { bunyan: this.Bunyan, raven: this.Raven, - request: this.Request + request: this.Request, + '@google-cloud/logging-bunyan': this.GCPLogging } }) this.loggerName = 'test' @@ -377,4 +386,39 @@ describe('LoggingManager', function() { }) }) }) + + describe('stackdriver logging', function() { + describe('when STACKDRIVER_LOGGING is unset', function() { + beforeEach(function() { + process.env['STACKDRIVER_LOGGING'] = undefined + this.LoggingManager.initialize(this.loggerName) + }) + + it('is disabled', function() { + expect(this.bunyanLogger.addStream).not.to.have.been.calledWith( + this.stackdriverStreamConfig + ) + }) + }) + + describe('when STACKDRIVER_LOGGING is true', function() { + beforeEach(function() { + process.env['STACKDRIVER_LOGGING'] = 'true' + this.LoggingManager.initialize(this.loggerName) + }) + + it('is enabled', function() { + expect(this.bunyanLogger.addStream).to.have.been.calledWith( + this.stackdriverStreamConfig + ) + }) + + it('is configured properly', function() { + expect(this.GCPLogging.LoggingBunyan).to.have.been.calledWith({ + logName: this.loggerName, + serviceContext: { service: this.loggerName } + }) + }) + }) + }) }) From 364cdf1fdb3066357cc7b94885f7eb84e343aed8 Mon Sep 17 00:00:00 2001 From: Eric Mc Sween Date: Fri, 25 Oct 2019 07:15:35 -0400 Subject: [PATCH 48/93] 1.9.0 --- libraries/logger/package-lock.json | 3114 ++++++++++++++++++++++++++++ libraries/logger/package.json | 2 +- 2 files changed, 3115 insertions(+), 1 deletion(-) create mode 100644 libraries/logger/package-lock.json diff --git a/libraries/logger/package-lock.json b/libraries/logger/package-lock.json new file mode 100644 index 0000000000..6973a88333 --- /dev/null +++ b/libraries/logger/package-lock.json @@ -0,0 +1,3114 @@ +{ + "name": "logger-sharelatex", + "version": "1.9.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@google-cloud/common": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-2.2.3.tgz", + "integrity": "sha512-lvw54mGKn8VqVIy2NzAk0l5fntBFX4UwQhHk6HaqkyCQ7WBl5oz4XhzKMtMilozF/3ObPcDogqwuyEWyZ6rnQQ==", + "requires": { + "@google-cloud/projectify": "^1.0.0", + "@google-cloud/promisify": "^1.0.0", + "arrify": "^2.0.0", + "duplexify": "^3.6.0", + "ent": "^2.2.0", + "extend": "^3.0.2", + "google-auth-library": "^5.5.0", + "retry-request": "^4.0.0", + "teeny-request": "^5.2.1" + } + }, + "@google-cloud/logging": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/@google-cloud/logging/-/logging-5.5.3.tgz", + "integrity": "sha512-TZ/DzHod4icaC7wEEBm0PHYfbhvg0CbCVzKLsdAwj11xSD/egGNOsG5optEQcbAQEPrO1B5xBXfsE0wIBBYjpQ==", + "requires": { + "@google-cloud/common": "^2.2.2", + "@google-cloud/paginator": "^2.0.0", + "@google-cloud/projectify": "^1.0.0", + "@google-cloud/promisify": "^1.0.0", + "@opencensus/propagation-stackdriver": "0.0.18", + "arrify": "^2.0.0", + "dot-prop": "^5.1.0", + "eventid": "^0.1.2", + "extend": "^3.0.2", + "gcp-metadata": "^3.1.0", + "google-gax": "^1.7.5", + "is": "^3.3.0", + "on-finished": "^2.3.0", + "protobufjs": "^6.8.8", + "pumpify": "^2.0.0", + "snakecase-keys": "^3.0.0", + "stream-events": "^1.0.4", + "through2": "^3.0.0", + "type-fest": "^0.8.0" + } + }, + "@google-cloud/logging-bunyan": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/logging-bunyan/-/logging-bunyan-2.0.0.tgz", + "integrity": "sha512-9W9B8GQNMlBdQSV+c0492+sMMknn4/428EdSO1xv5Hn07P32N/e4T25y4Gnl9jlrItuZHIXRwYPVSHqUyGb1Zg==", + "requires": { + "@google-cloud/logging": "^5.5.2", + "google-auth-library": "^5.0.0" + } + }, + "@google-cloud/paginator": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-2.0.1.tgz", + "integrity": "sha512-HZ6UTGY/gHGNriD7OCikYWL/Eu0sTEur2qqse2w6OVsz+57se3nTkqH14JIPxtf0vlEJ8IJN5w3BdZ22pjCB8g==", + "requires": { + "arrify": "^2.0.0", + "extend": "^3.0.2" + } + }, + "@google-cloud/projectify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-1.0.1.tgz", + "integrity": "sha512-xknDOmsMgOYHksKc1GPbwDLsdej8aRNIA17SlSZgQdyrcC0lx0OGo4VZgYfwoEU1YS8oUxF9Y+6EzDOb0eB7Xg==" + }, + "@google-cloud/promisify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-1.0.2.tgz", + "integrity": "sha512-7WfV4R/3YV5T30WRZW0lqmvZy9hE2/p9MvpI34WuKa2Wz62mLu5XplGTFEMK6uTbJCLWUxTcZ4J4IyClKucE5g==" + }, + "@grpc/grpc-js": { + "version": "0.6.9", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-0.6.9.tgz", + "integrity": "sha512-r1nDOEEiYmAsVYBaS4DPPqdwPOXPw7YhVOnnpPdWhlNtKbYzPash6DqWTTza9gBiYMA5d2Wiq6HzrPqsRaP4yA==", + "requires": { + "semver": "^6.2.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + } + } + }, + "@grpc/proto-loader": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.5.2.tgz", + "integrity": "sha512-eBKD/FPxQoY1x6QONW2nBd54QUEyzcFP9FenujmoeDPy1rutVSHki1s/wR68F6O1QfCNDx+ayBH1O2CVNMzyyw==", + "requires": { + "lodash.camelcase": "^4.3.0", + "protobufjs": "^6.8.6" + } + }, + "@opencensus/core": { + "version": "0.0.18", + "resolved": "https://registry.npmjs.org/@opencensus/core/-/core-0.0.18.tgz", + "integrity": "sha512-PgRQXLyb3bLi8Z6pQct9erYFRdnYAZNQXAEVPf6Xq6IMkZaH20wiOTNNPxEckjI31mq5utgstAbwOn4gJiPjBQ==", + "requires": { + "continuation-local-storage": "^3.2.1", + "log-driver": "^1.2.7", + "semver": "^6.0.0", + "shimmer": "^1.2.0", + "uuid": "^3.2.1" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + }, + "uuid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", + "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" + } + } + }, + "@opencensus/propagation-stackdriver": { + "version": "0.0.18", + "resolved": "https://registry.npmjs.org/@opencensus/propagation-stackdriver/-/propagation-stackdriver-0.0.18.tgz", + "integrity": "sha512-BLwfszIGAfqN2mqGf/atfEu84cWeoLM/YuXGfXDO1iDN2k5GXz4QFyhS8sz5l63HtsYuQqFuV+Ze7ZM0NvJp2A==", + "requires": { + "@opencensus/core": "^0.0.18", + "hex2dec": "^1.0.1", + "uuid": "^3.2.1" + }, + "dependencies": { + "uuid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", + "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" + } + } + }, + "@overleaf/o-error": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@overleaf/o-error/-/o-error-2.1.0.tgz", + "integrity": "sha512-Zd9sks9LrLw8ErHt/cXeWIkyxWAqNAvNGn7wIjLQJH6TTEEW835PWOhpch+hQwwWsTxWIx/JDj+IpZ3ouw925g==" + }, + "@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" + }, + "@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" + }, + "@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", + "requires": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" + }, + "@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" + }, + "@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" + }, + "@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" + }, + "@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" + }, + "@sinonjs/commons": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.6.0.tgz", + "integrity": "sha512-w4/WHG7C4WWFyE5geCieFJF6MZkbW4VAriol5KlmQXpAQdxvV0p26sqNZOW6Qyw6Y0l9K4g+cHvvczR2sEEpqg==", + "dev": true, + "requires": { + "type-detect": "4.0.8" + } + }, + "@sinonjs/formatio": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.2.2.tgz", + "integrity": "sha512-B8SEsgd8gArBLMD6zpRw3juQ2FVSsmdd7qlevyDqzS9WTCtvF55/gAL+h6gue8ZvPYcdiPdvueM/qm//9XzyTQ==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1", + "@sinonjs/samsam": "^3.1.0" + } + }, + "@sinonjs/samsam": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.3.3.tgz", + "integrity": "sha512-bKCMKZvWIjYD0BLGnNrxVuw4dkWCYsLqFOUWw8VgKF/+5Y+mE7LfHWPIYoDXowH+3a9LsWDMo0uAP8YDosPvHQ==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.3.0", + "array-from": "^2.1.1", + "lodash": "^4.17.15" + } + }, + "@sinonjs/text-encoding": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", + "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", + "dev": true + }, + "@types/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz", + "integrity": "sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==" + }, + "@types/node": { + "version": "10.14.22", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.22.tgz", + "integrity": "sha512-9taxKC944BqoTVjE+UT3pQH0nHZlTvITwfsOZqyc+R3sfJuxaTtxWjfn1K2UlxyPcKHf0rnaXcVFrS9F9vf0bw==" + }, + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "requires": { + "event-target-shim": "^5.0.0" + } + }, + "acorn": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", + "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "dev": true + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, + "requires": { + "acorn": "^3.0.4" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "agent-base": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", + "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", + "requires": { + "es6-promisify": "^5.0.0" + } + }, + "ajv": { + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", + "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-keywords": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", + "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "dev": true + }, + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array-from": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", + "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", + "dev": true + }, + "array-includes": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", + "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.7.0" + } + }, + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==" + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, + "async-listener": { + "version": "0.6.10", + "resolved": "https://registry.npmjs.org/async-listener/-/async-listener-0.6.10.tgz", + "integrity": "sha512-gpuo6xOyF4D5DE5WvyqZdPA3NGhiT6Qf07l7DCB0wwDEsLvDIbCr6j9S5aj5Ch96dLace5tXVzWBZkxU/c5ohw==", + "requires": { + "semver": "^5.3.0", + "shimmer": "^1.1.0" + } + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + }, + "dependencies": { + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "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.0.0" + } + } + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "base64-js": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "bignumber.js": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-7.2.1.tgz", + "integrity": "sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "bunyan": { + "version": "1.8.12", + "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.12.tgz", + "integrity": "sha1-8VDw9nSKvdcq6uhPBEA74u8RN5c=", + "requires": { + "dtrace-provider": "~0.8", + "moment": "^2.10.6", + "mv": "~2", + "safe-json-stringify": "~1" + } + }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, + "requires": { + "callsites": "^0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "chai": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", + "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.0", + "type-detect": "^4.0.5" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, + "continuation-local-storage": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/continuation-local-storage/-/continuation-local-storage-3.2.1.tgz", + "integrity": "sha512-jx44cconVqkCEEyLSKWwkvUXwO561jXMa3LPjTPsm5QR22PA0/mhe33FT4Xb5y74JDvt/Cq+5lm8S8rskLv9ZA==", + "requires": { + "async-listener": "^0.6.0", + "emitter-listener": "^1.1.1" + } + }, + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" + }, + "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=" + }, + "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.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "d64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/d64/-/d64-1.0.0.tgz", + "integrity": "sha1-QAKofoUMv8n52XBrYPymE6MzbpA=" + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "dot-prop": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.1.1.tgz", + "integrity": "sha512-QCHI6Lkf+9fJMpwfAFsTvbiSh6ujoPmhCLiDvD/n4dGtLvHfhuBwPdN6z2x4YSOwwtTcLoO/LP70xELWGF/JVA==", + "requires": { + "is-obj": "^2.0.0" + } + }, + "dtrace-provider": { + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/dtrace-provider/-/dtrace-provider-0.8.8.tgz", + "integrity": "sha512-b7Z7cNtHPhH9EJhNNbbeqTcXB8LGFFZhq1PGgEvpeHlzd36bhbdTWoE/Ba/YguqpBSlAPKnARWhVlhunCMwfxg==", + "optional": true, + "requires": { + "nan": "^2.14.0" + } + }, + "duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "emitter-listener": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/emitter-listener/-/emitter-listener-1.1.2.tgz", + "integrity": "sha512-Bt1sBAGFHY9DKY+4/2cV6izcKJUf5T7/gkdmkxzX/qv9CcGH8xSwVRW5mtX03SWJtRTWSOpzCuWN9rBFYZepZQ==", + "requires": { + "shimmer": "^1.2.0" + } + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "requires": { + "once": "^1.4.0" + } + }, + "ent": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", + "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=" + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.16.0.tgz", + "integrity": "sha512-xdQnfykZ9JMEiasTAJZJdMWCQ1Vm00NBw79/AWi7ELfZuuPCSOMDZbT9mkOfSctVtfhb+sAAzrm+j//GjjLHLg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.0", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.0", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-inspect": "^1.6.0", + "object-keys": "^1.1.1", + "string.prototype.trimleft": "^2.1.0", + "string.prototype.trimright": "^2.1.0" + } + }, + "es-to-primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" + }, + "es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "requires": { + "es6-promise": "^4.0.3" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", + "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", + "dev": true, + "requires": { + "ajv": "^5.3.0", + "babel-code-frame": "^6.22.0", + "chalk": "^2.1.0", + "concat-stream": "^1.6.0", + "cross-spawn": "^5.1.0", + "debug": "^3.1.0", + "doctrine": "^2.1.0", + "eslint-scope": "^3.7.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^3.5.4", + "esquery": "^1.0.0", + "esutils": "^2.0.2", + "file-entry-cache": "^2.0.0", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.0.1", + "ignore": "^3.3.3", + "imurmurhash": "^0.1.4", + "inquirer": "^3.0.6", + "is-resolvable": "^1.0.0", + "js-yaml": "^3.9.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.4", + "minimatch": "^3.0.2", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "pluralize": "^7.0.0", + "progress": "^2.0.0", + "regexpp": "^1.0.1", + "require-uncached": "^1.0.3", + "semver": "^5.3.0", + "strip-ansi": "^4.0.0", + "strip-json-comments": "~2.0.1", + "table": "4.0.2", + "text-table": "~0.2.0" + }, + "dependencies": { + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, + "glob": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.5.tgz", + "integrity": "sha512-J9dlskqUXK1OeTOYBEn5s8aMukWMwWfs+rPTn/jn50Ux4MNXVhubL1wu/j2t+H4NVI+cXEcCaYellqaPVGXNqQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + } + } + }, + "eslint-config-prettier": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-3.6.0.tgz", + "integrity": "sha512-ixJ4U3uTLXwJts4rmSVW/lMXjlGwCijhBJHk8iVqKKSifeI0qgFEfWl8L63isfc8Od7EiBALF6BX3jKLluf/jQ==", + "dev": true, + "requires": { + "get-stdin": "^6.0.0" + } + }, + "eslint-config-standard": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-11.0.0.tgz", + "integrity": "sha512-oDdENzpViEe5fwuRCWla7AXQd++/oyIp8zP+iP9jiUPG6NBj3SHgdgtl/kTn00AjeN+1HNvavTKmYbMo+xMOlw==", + "dev": true + }, + "eslint-import-resolver-node": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", + "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "resolve": "^1.5.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-module-utils": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.4.1.tgz", + "integrity": "sha512-H6DOj+ejw7Tesdgbfs4jeS4YMFrT8uI8xwd1gtQqXssaR0EQ26L+2O/w6wkYFy2MymON0fTwHmXBvvfLNZVZEw==", + "dev": true, + "requires": { + "debug": "^2.6.8", + "pkg-dir": "^2.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-plugin-chai-expect": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-chai-expect/-/eslint-plugin-chai-expect-1.2.0.tgz", + "integrity": "sha512-UfoqOzGBY3AU0VoNwIzJ0tpJgs5pD6QRFwcrDbqY00fk+JvIHXyZnj42Xgk/gfsWhhx+w0U4my22EegpSn2odQ==", + "dev": true + }, + "eslint-plugin-chai-friendly": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-chai-friendly/-/eslint-plugin-chai-friendly-0.4.1.tgz", + "integrity": "sha512-hkpLN7VVoGGsofZjUhcQ+sufC3FgqMJwD0DvAcRfxY1tVRyQyVsqpaKnToPHJQOrRo0FQ0fSEDwW2gr4rsNdGA==", + "dev": true + }, + "eslint-plugin-import": { + "version": "2.18.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.18.2.tgz", + "integrity": "sha512-5ohpsHAiUBRNaBWAF08izwUGlbrJoJJ+W9/TBwsGoR1MnlgfwMIKrFeSjWbt6moabiXW9xNvtFz+97KHRfI4HQ==", + "dev": true, + "requires": { + "array-includes": "^3.0.3", + "contains-path": "^0.1.0", + "debug": "^2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.2", + "eslint-module-utils": "^2.4.0", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.0", + "read-pkg-up": "^2.0.0", + "resolve": "^1.11.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-plugin-mocha": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-5.3.0.tgz", + "integrity": "sha512-3uwlJVLijjEmBeNyH60nzqgA1gacUWLUmcKV8PIGNvj1kwP/CTgAWQHn2ayyJVwziX+KETkr9opNwT1qD/RZ5A==", + "dev": true, + "requires": { + "ramda": "^0.26.1" + } + }, + "eslint-plugin-node": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-6.0.1.tgz", + "integrity": "sha512-Q/Cc2sW1OAISDS+Ji6lZS2KV4b7ueA/WydVWd1BECTQwVvfQy5JAi3glhINoKzoMnfnuRgNP+ZWKrGAbp3QDxw==", + "dev": true, + "requires": { + "ignore": "^3.3.6", + "minimatch": "^3.0.4", + "resolve": "^1.3.3", + "semver": "^5.4.1" + } + }, + "eslint-plugin-promise": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.8.0.tgz", + "integrity": "sha512-JiFL9UFR15NKpHyGii1ZcvmtIqa3UTwiDAGb8atSffe43qJ3+1czVGN6UtkklpcJ2DVnqvTMzEKRaJdBkAL2aQ==", + "dev": true + }, + "eslint-plugin-standard": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-3.1.0.tgz", + "integrity": "sha512-fVcdyuKRr0EZ4fjWl3c+gp1BANFJD1+RaWa2UPYfMZ6jCtp5RG00kSaXnK/dE5sYzt4kaWJ9qdxqUfc0d9kX0w==", + "dev": true + }, + "eslint-scope": { + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz", + "integrity": "sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-visitor-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "dev": true + }, + "espree": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "dev": true, + "requires": { + "acorn": "^5.5.0", + "acorn-jsx": "^3.0.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "dev": true, + "requires": { + "estraverse": "^4.0.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" + }, + "eventid": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/eventid/-/eventid-0.1.2.tgz", + "integrity": "sha1-CyMtPiROpbHVKJhBQOpprH7IkhU=", + "requires": { + "d64": "^1.0.0", + "uuid": "^3.0.1" + }, + "dependencies": { + "uuid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", + "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "external-editor": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", + "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "dev": true, + "requires": { + "chardet": "^0.4.0", + "iconv-lite": "^0.4.17", + "tmp": "^0.0.33" + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fast-text-encoding": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.0.tgz", + "integrity": "sha512-R9bHCvweUxxwkDwhjav5vxpFvdPGlVngtqmx4pIZfSUhM/Q4NiIUHB456BAf+Q1Nwu3HEZYONtu+Rya+af4jiQ==" + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, + "requires": { + "flat-cache": "^1.2.1", + "object-assign": "^4.0.1" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "flat-cache": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", + "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", + "dev": true, + "requires": { + "circular-json": "^0.3.1", + "graceful-fs": "^4.1.2", + "rimraf": "~2.6.2", + "write": "^0.2.1" + }, + "dependencies": { + "glob": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.5.tgz", + "integrity": "sha512-J9dlskqUXK1OeTOYBEn5s8aMukWMwWfs+rPTn/jn50Ux4MNXVhubL1wu/j2t+H4NVI+cXEcCaYellqaPVGXNqQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "gaxios": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-2.1.0.tgz", + "integrity": "sha512-Gtpb5sdQmb82sgVkT2GnS2n+Kx4dlFwbeMYcDlD395aEvsLCSQXJJcHt7oJ2LrGxDEAeiOkK79Zv2A8Pzt6CFg==", + "requires": { + "abort-controller": "^3.0.0", + "extend": "^3.0.2", + "https-proxy-agent": "^3.0.0", + "is-stream": "^2.0.0", + "node-fetch": "^2.3.0" + } + }, + "gcp-metadata": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-3.2.0.tgz", + "integrity": "sha512-ympv+yQ6k5QuWCuwQqnGEvFGS7MBKdcQdj1i188v3bW9QLFIchTGaBCEZxSQapT0jffdn1vdt8oJhB5VBWQO1Q==", + "requires": { + "gaxios": "^2.0.1", + "json-bigint": "^0.3.0" + } + }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", + "optional": true, + "requires": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "google-auth-library": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.5.1.tgz", + "integrity": "sha512-zCtjQccWS/EHYyFdXRbfeSGM/gW+d7uMAcVnvXRnjBXON5ijo6s0nsObP0ifqileIDSbZjTlLtgo+UoN8IFJcg==", + "requires": { + "arrify": "^2.0.0", + "base64-js": "^1.3.0", + "fast-text-encoding": "^1.0.0", + "gaxios": "^2.1.0", + "gcp-metadata": "^3.2.0", + "gtoken": "^4.1.0", + "jws": "^3.1.5", + "lru-cache": "^5.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "requires": { + "yallist": "^3.0.2" + } + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + } + } + }, + "google-gax": { + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-1.7.5.tgz", + "integrity": "sha512-Tz2DFs8umzDcCBTi2W1cY4vEgAKaYRj70g6Hh/MiiZaJizrly7PgyxsIYUGi7sOpEuAbARQymYKvy5mNi8hEbg==", + "requires": { + "@grpc/grpc-js": "0.6.9", + "@grpc/proto-loader": "^0.5.1", + "abort-controller": "^3.0.0", + "duplexify": "^3.6.0", + "google-auth-library": "^5.0.0", + "is-stream-ended": "^0.1.4", + "lodash.at": "^4.6.0", + "lodash.has": "^4.5.2", + "node-fetch": "^2.6.0", + "protobufjs": "^6.8.8", + "retry-request": "^4.0.0", + "semver": "^6.0.0", + "walkdir": "^0.4.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + } + } + }, + "google-p12-pem": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-2.0.2.tgz", + "integrity": "sha512-UfnEARfJKI6pbmC1hfFFm+UAcZxeIwTiEcHfqKe/drMsXD/ilnVjF7zgOGpHXyhuvX6jNJK3S8A0hOQjwtFxEw==", + "requires": { + "node-forge": "^0.9.0" + } + }, + "graceful-fs": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz", + "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==", + "dev": true + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "gtoken": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-4.1.0.tgz", + "integrity": "sha512-wqyn2gf5buzEZN4QNmmiiW2i2JkEdZnL7Z/9p44RtZqgt4077m4khRgAYNuu8cBwHWCc6MsP6eDUn/KkF6jFIw==", + "requires": { + "gaxios": "^2.0.0", + "google-p12-pem": "^2.0.0", + "jws": "^3.1.5", + "mime": "^2.2.0" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "hex2dec": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/hex2dec/-/hex2dec-1.1.2.tgz", + "integrity": "sha512-Yu+q/XWr2fFQ11tHxPq4p4EiNkb2y+lAacJNhAdRXVfRIcDH6gi7htWFnnlIzvqHMHoWeIsfXlNAjZInpAOJDA==" + }, + "hosted-git-info": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", + "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==", + "dev": true + }, + "http-proxy-agent": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", + "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", + "requires": { + "agent-base": "4", + "debug": "3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "https-proxy-agent": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-3.0.1.tgz", + "integrity": "sha512-+ML2Rbh6DAuee7d07tYGEKOEi2voWPUGan+ExdPbPW6Z3svq+JCqr0v8WmKPOkz1vOVykPCBSuobe7G8GJUtVg==", + "requires": { + "agent-base": "^4.3.0", + "debug": "^3.1.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore": { + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", + "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "inquirer": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^2.0.4", + "figures": "^2.0.0", + "lodash": "^4.3.0", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rx-lite": "^4.0.8", + "rx-lite-aggregates": "^4.0.8", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" + } + }, + "is": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/is/-/is-3.3.0.tgz", + "integrity": "sha512-nW24QBoPcFGGHJGUwnfpI7Yc5CdqWNdsyHQszVE/z2pKHXzh7FZ5GWhJqSyaQ9wMkQnsTx+kAI8bHlCX4tKdbg==" + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "dev": true + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-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 + }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==" + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "^1.0.1" + } + }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==" + }, + "is-stream-ended": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz", + "integrity": "sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw==" + }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.0" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + }, + "json-bigint": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-0.3.0.tgz", + "integrity": "sha1-DM2RLEuCcNBfBW+9E4FLU9OCWx4=", + "requires": { + "bignumber.js": "^7.0.0" + } + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "just-extend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.0.2.tgz", + "integrity": "sha512-FrLwOgm+iXrPV+5zDU6Jqu4gCRXbWEQg2O3SKONsWE4w7AXFRkryS53bpWdaL9cNol+AmR3AEYz6kn+o0fCPnw==", + "dev": true + }, + "jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "requires": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "lodash.at": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.at/-/lodash.at-4.6.0.tgz", + "integrity": "sha1-k83OZk8KGZTqM9181A4jr9EbD/g=" + }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=" + }, + "lodash.has": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/lodash.has/-/lodash.has-4.5.2.tgz", + "integrity": "sha1-0Z9NwQlQWMzL4rDN9O4P5Ko3yGI=" + }, + "log-driver": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", + "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==" + }, + "lolex": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-3.1.0.tgz", + "integrity": "sha512-zFo5MgCJ0rZ7gQg69S4pqBsLURbFw11X68C18OcJjJQbqaXm2NoTrGl1IMM3TIz0/BnN1tIs2tzmmqvCsOMMjw==", + "dev": true + }, + "long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, + "lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "lsmod": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lsmod/-/lsmod-1.0.0.tgz", + "integrity": "sha1-mgD3bco26yP6BTUK/htYXUKZ5ks=" + }, + "map-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", + "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==" + }, + "mime": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", + "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==" + }, + "mime-db": { + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" + }, + "mime-types": { + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "requires": { + "mime-db": "1.40.0" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + } + }, + "mocha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", + "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "dev": true, + "requires": { + "browser-stdout": "1.3.1", + "commander": "2.15.1", + "debug": "3.1.0", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.5", + "he": "1.1.1", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "supports-color": "5.4.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "moment": { + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", + "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==", + "optional": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "mv": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/mv/-/mv-2.1.1.tgz", + "integrity": "sha1-rmzg1vbV4KT32JN5jQPB6pVZtqI=", + "optional": true, + "requires": { + "mkdirp": "~0.5.1", + "ncp": "~2.0.0", + "rimraf": "~2.4.0" + } + }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "optional": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "ncp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", + "integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=", + "optional": true + }, + "nise": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.2.tgz", + "integrity": "sha512-/6RhOUlicRCbE9s+94qCUsyE+pKlVJ5AhIv+jEE7ESKwnbXqulKZ1FYU+XAtHHWE9TinYvAxDUJAb912PwPoWA==", + "dev": true, + "requires": { + "@sinonjs/formatio": "^3.2.1", + "@sinonjs/text-encoding": "^0.7.1", + "just-extend": "^4.0.2", + "lolex": "^4.1.0", + "path-to-regexp": "^1.7.0" + }, + "dependencies": { + "lolex": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.2.0.tgz", + "integrity": "sha512-gKO5uExCXvSm6zbF562EvM+rd1kQDnB9AZBbiQVzf1ZmdDpxUSvpnAaVOP83N/31mRK8Ml8/VE8DMvsAZQ+7wg==", + "dev": true + } + } + }, + "node-fetch": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", + "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" + }, + "node-forge": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.1.tgz", + "integrity": "sha512-G6RlQt5Sb4GMBzXvhfkeFmbqR6MzhtnT7VTHuLadjkii3rdYHNdw0m8zA4BTxVIh68FicCQ2NSUANpsqkr9jvQ==" + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-inspect": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", + "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.values": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.0.tgz", + "integrity": "sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.12.0", + "function-bind": "^1.1.1", + "has": "^1.0.3" + } + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-to-regexp": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", + "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", + "dev": true, + "requires": { + "isarray": "0.0.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "^2.0.0" + } + }, + "pathval": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", + "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", + "dev": true + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "prettier": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz", + "integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "protobufjs": { + "version": "6.8.8", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.8.tgz", + "integrity": "sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.0", + "@types/node": "^10.1.0", + "long": "^4.0.0" + } + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "psl": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", + "integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==" + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pumpify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-2.0.1.tgz", + "integrity": "sha512-m7KOje7jZxrmutanlkS1daj1dS6z6BgslzOXmcSEpIlCxM3VJH7lG5QLeck/6hgF6F4crFf01UtQmNsJfweTAw==", + "requires": { + "duplexify": "^4.1.1", + "inherits": "^2.0.3", + "pump": "^3.0.0" + }, + "dependencies": { + "duplexify": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.1.tgz", + "integrity": "sha512-DY3xVEmVHTv1wSzKNbwoU6nVjzI369Y6sPoqfYr0/xlx3IdX2n94xIszTcjPO8W8ZIv0Wb0PXNcjuZyT4wiICA==", + "requires": { + "end-of-stream": "^1.4.1", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1", + "stream-shift": "^1.0.0" + } + }, + "readable-stream": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", + "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "ramda": { + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.26.1.tgz", + "integrity": "sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ==", + "dev": true + }, + "raven": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/raven/-/raven-1.1.3.tgz", + "integrity": "sha1-QnPBrm005CMPUbLAEEGjK5Iygio=", + "requires": { + "cookie": "0.3.1", + "json-stringify-safe": "5.0.1", + "lsmod": "1.0.0", + "stack-trace": "0.0.9", + "uuid": "3.0.0" + } + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "regexpp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", + "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", + "dev": true + }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "uuid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", + "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" + } + } + }, + "require-like": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/require-like/-/require-like-0.1.2.tgz", + "integrity": "sha1-rW8wwTvs15cBDEaK+ndcDAprR/o=", + "dev": true + }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "^0.1.0", + "resolve-from": "^1.0.0" + } + }, + "resolve": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", + "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "retry-request": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-4.1.1.tgz", + "integrity": "sha512-BINDzVtLI2BDukjWmjAIRZ0oglnCAkpP2vQjM3jdLhmT62h0xnQgciPwBRDAvHqpkPT2Wo1XuUyLyn6nbGrZQQ==", + "requires": { + "debug": "^4.1.1", + "through2": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "rimraf": { + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz", + "integrity": "sha1-7nEM5dk6j9uFb7Xqj/Di11k0sto=", + "optional": true, + "requires": { + "glob": "^6.0.1" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "rx-lite": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", + "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", + "dev": true + }, + "rx-lite-aggregates": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", + "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "dev": true, + "requires": { + "rx-lite": "*" + } + }, + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" + }, + "safe-json-stringify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz", + "integrity": "sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==", + "optional": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "sandboxed-module": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/sandboxed-module/-/sandboxed-module-2.0.3.tgz", + "integrity": "sha1-x+VFkzm7y6KMUwPusz9ug4e/upY=", + "dev": true, + "requires": { + "require-like": "0.1.2", + "stack-trace": "0.0.9" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "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 + }, + "shimmer": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.1.tgz", + "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==" + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "sinon": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.2.3.tgz", + "integrity": "sha512-i6j7sqcLEqTYqUcMV327waI745VASvYuSuQMCjbAwlpAeuCgKZ3LtrjDxAbu+GjNQR0FEDpywtwGCIh8GicNyg==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.3.0", + "@sinonjs/formatio": "^3.1.0", + "@sinonjs/samsam": "^3.0.2", + "diff": "^3.5.0", + "lolex": "^3.0.0", + "nise": "^1.4.8", + "supports-color": "^5.5.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "sinon-chai": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/sinon-chai/-/sinon-chai-3.3.0.tgz", + "integrity": "sha512-r2JhDY7gbbmh5z3Q62pNbrjxZdOAjpsqW/8yxAZRSqLZqowmfGZPGUZPFf3UX36NLis0cv8VEM5IJh9HgkSOAA==", + "dev": true + }, + "slice-ansi": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0" + } + }, + "snakecase-keys": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/snakecase-keys/-/snakecase-keys-3.1.0.tgz", + "integrity": "sha512-QM038drLbhdOY5HcRQVjO1ZJ1WR7yV5D5TIBzcOB/g3f5HURHhfpYEnvOyzXet8K+MQsgeIUA7O7vn90nAX6EA==", + "requires": { + "map-obj": "^4.0.0", + "to-snake-case": "^1.0.0" + } + }, + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "stack-trace": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.9.tgz", + "integrity": "sha1-qPbq7KkGdMMz58Q5U/J1tFFRBpU=" + }, + "stream-events": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.5.tgz", + "integrity": "sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg==", + "requires": { + "stubs": "^3.0.0" + } + }, + "stream-shift": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" + }, + "string-width": { + "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", + "strip-ansi": "^4.0.0" + } + }, + "string.prototype.trimleft": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz", + "integrity": "sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, + "string.prototype.trimright": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz", + "integrity": "sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "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" + }, + "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-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "stubs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stubs/-/stubs-3.0.0.tgz", + "integrity": "sha1-6NK6H6nJBXAwPAMLaQD31fiavls=" + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "table": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", + "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "dev": true, + "requires": { + "ajv": "^5.2.3", + "ajv-keywords": "^2.1.0", + "chalk": "^2.1.0", + "lodash": "^4.17.4", + "slice-ansi": "1.0.0", + "string-width": "^2.1.1" + }, + "dependencies": { + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + } + } + }, + "teeny-request": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-5.3.0.tgz", + "integrity": "sha512-sN9E3JvEBe2CFqB/jpJpw1erWD1C7MxyYCxogHFCQSyZfkHYcdf4wzVQSw7FZxbwcfnS+FP0W9BS0mp6SEOKjg==", + "requires": { + "http-proxy-agent": "^2.1.0", + "https-proxy-agent": "^3.0.0", + "node-fetch": "^2.2.0", + "stream-events": "^1.0.5", + "uuid": "^3.3.2" + }, + "dependencies": { + "uuid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", + "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", + "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", + "requires": { + "readable-stream": "2 || 3" + } + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "to-no-case": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/to-no-case/-/to-no-case-1.0.2.tgz", + "integrity": "sha1-xyKQcWTvaxeBMsjmmTAhLRtKoWo=" + }, + "to-snake-case": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-snake-case/-/to-snake-case-1.0.0.tgz", + "integrity": "sha1-znRpE4l5RgGah+Yu366upMYIq4w=", + "requires": { + "to-space-case": "^1.0.0" + } + }, + "to-space-case": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-space-case/-/to-space-case-1.0.0.tgz", + "integrity": "sha1-sFLar7Gysp3HcM6gFj5ewOvJ/Bc=", + "requires": { + "to-no-case": "^1.0.0" + } + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + } + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "requires": { + "punycode": "^2.1.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "uuid": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.0.0.tgz", + "integrity": "sha1-Zyj8BFnEUNeWqZwxg3VpvfZy1yg=" + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "walkdir": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.4.1.tgz", + "integrity": "sha512-3eBwRyEln6E1MSzcxcVpQIhRG8Q1jLvEqRmCZqS3dsfXEDR/AhOF4d+jHg1qvDCpYaVRZjENPQyrVxAkQqxPgQ==" + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==" + } + } +} diff --git a/libraries/logger/package.json b/libraries/logger/package.json index ba27b8848f..c1214c5d1a 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -7,7 +7,7 @@ "url": "http://github.com/sharelatex/logger-sharelatex.git" }, "license": "AGPL-3.0-only", - "version": "1.8.0", + "version": "1.9.0", "scripts": { "test": "mocha test/**/*.js", "format": "prettier-eslint '**/*.js' --list-different", From b04933177785a011176e6712fd61fcbbdf849e34 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Mon, 23 Mar 2020 10:48:55 +0100 Subject: [PATCH 49/93] [misc] fix decaff cleanup for reportedToSentry Previously it would bailout of the loop after processing ANY attribute. REF: 6fe4dcbf32720282821d42140ab92593866e0772 --- libraries/logger/logging-manager.js | 2 -- .../logger/test/unit/loggingManagerTests.js | 26 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index f840771a8e..af67ae0ad3 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -134,13 +134,11 @@ const Logger = (module.exports = { this.raven.captureException(error, { tags, extra, level }) // put a flag on the errors to avoid reporting them multiple times - const result = [] for (key in attributes) { value = attributes[key] if (value instanceof Error) { value.reportedToSentry = true } - return result } } catch (err) { // ignore Raven errors diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index f94d92f9cf..f5cd9e4827 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -257,6 +257,32 @@ describe('LoggingManager', function() { this.logger.error({ foo: 'bar' }, 'message') this.captureException.callCount.should.equal(10) }) + + describe('reportedToSentry', function() { + it('should mark the error as reported to sentry', function() { + const err = new Error() + this.logger.error({ err }, 'message') + expect(this.captureException.called).to.equal(true) + expect(err.reportedToSentry).to.equal(true) + }) + + it('should mark two errors as reported to sentry', function() { + const err1 = new Error() + const err2 = new Error() + this.logger.error({ err: err1, err2 }, 'message') + expect(this.captureException.called).to.equal(true) + expect(err1.reportedToSentry).to.equal(true) + expect(err2.reportedToSentry).to.equal(true) + }) + + it('should not mark arbitrary objects as reported to sentry', function() { + const err = new Error() + const ctx = { foo: 'bar' } + this.logger.error({ err, ctx }, 'message') + expect(this.captureException.called).to.equal(true) + expect(ctx.reportedToSentry).to.equal(undefined) + }) + }) }) describe('checkLogLevel', function() { From 2137c7a42ca267eb092cb16f2fe775989f1744f8 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Mon, 23 Mar 2020 13:06:32 +0100 Subject: [PATCH 50/93] [misc] version bump to 1.9.1 --- libraries/logger/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/logger/package.json b/libraries/logger/package.json index c1214c5d1a..8742b8c840 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -7,7 +7,7 @@ "url": "http://github.com/sharelatex/logger-sharelatex.git" }, "license": "AGPL-3.0-only", - "version": "1.9.0", + "version": "1.9.1", "scripts": { "test": "mocha test/**/*.js", "format": "prettier-eslint '**/*.js' --list-different", From 5aad5db40fedc7a20c9838c00fbbee11e1ff2ae6 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Fri, 15 May 2020 13:31:28 +0200 Subject: [PATCH 51/93] [checkLogLevel] read the updated tracing end time from disk --- libraries/logger/.nvmrc | 2 +- libraries/logger/logging-manager.js | 14 +- libraries/logger/package-lock.json | 316 +----------------- libraries/logger/package.json | 1 - .../logger/test/unit/loggingManagerTests.js | 30 +- 5 files changed, 22 insertions(+), 341 deletions(-) diff --git a/libraries/logger/.nvmrc b/libraries/logger/.nvmrc index d87edbfc10..ed5ddf35fc 100644 --- a/libraries/logger/.nvmrc +++ b/libraries/logger/.nvmrc @@ -1 +1 @@ -4.2.1 \ No newline at end of file +10.19.0 \ No newline at end of file diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index f840771a8e..79d1be9108 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -1,5 +1,5 @@ const bunyan = require('bunyan') -const request = require('request') +const fs = require('fs') const yn = require('yn') const OError = require('@overleaf/o-error') const GCPLogging = require('@google-cloud/logging-bunyan') @@ -42,18 +42,12 @@ const Logger = (module.exports = { }, checkLogLevel() { - const options = { - headers: { - 'Metadata-Flavor': 'Google' - }, - uri: `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` - } - request(options, (err, response, body) => { - if (err) { + fs.readFile('/logging/tracingEndTime', (error, end) => { + if (error || !end) { this.logger.level(this.defaultLevel) return } - if (parseInt(body) > Date.now()) { + if (parseInt(end) > Date.now()) { this.logger.level('trace') } else { this.logger.level(this.defaultLevel) diff --git a/libraries/logger/package-lock.json b/libraries/logger/package-lock.json index 6973a88333..8a6d285d9c 100644 --- a/libraries/logger/package-lock.json +++ b/libraries/logger/package-lock.json @@ -283,17 +283,6 @@ "es6-promisify": "^5.0.0" } }, - "ajv": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", - "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, "ajv-keywords": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", @@ -348,19 +337,6 @@ "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==" }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - }, "assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -376,21 +352,6 @@ "shimmer": "^1.1.0" } }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" - }, "babel-code-frame": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", @@ -436,14 +397,6 @@ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "requires": { - "tweetnacl": "^0.14.3" - } - }, "bignumber.js": { "version": "7.2.1", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-7.2.1.tgz", @@ -501,11 +454,6 @@ "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", "dev": true }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" - }, "chai": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", @@ -605,14 +553,6 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "requires": { - "delayed-stream": "~1.0.0" - } - }, "commander": { "version": "2.15.1", "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", @@ -677,14 +617,6 @@ "resolved": "https://registry.npmjs.org/d64/-/d64-1.0.0.tgz", "integrity": "sha1-QAKofoUMv8n52XBrYPymE6MzbpA=" }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "requires": { - "assert-plus": "^1.0.0" - } - }, "debug": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", @@ -717,11 +649,6 @@ "object-keys": "^1.0.12" } }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", @@ -765,15 +692,6 @@ "stream-shift": "^1.0.0" } }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, "ecdsa-sig-formatter": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", @@ -1210,20 +1128,11 @@ "tmp": "^0.0.33" } }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" - }, "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true }, "fast-levenshtein": { "version": "2.0.6", @@ -1301,21 +1210,6 @@ } } }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -1367,14 +1261,6 @@ "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", "dev": true }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "requires": { - "assert-plus": "^1.0.0" - } - }, "glob": { "version": "6.0.4", "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", @@ -1482,20 +1368,6 @@ "mime": "^2.2.0" } }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - } - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -1567,16 +1439,6 @@ } } }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, "https-proxy-agent": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-3.0.1.tgz", @@ -1717,11 +1579,6 @@ "has-symbols": "^1.0.0" } }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -1733,11 +1590,6 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, "js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", @@ -1754,11 +1606,6 @@ "esprima": "^4.0.0" } }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" - }, "json-bigint": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-0.3.0.tgz", @@ -1767,16 +1614,6 @@ "bignumber.js": "^7.0.0" } }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", @@ -1788,17 +1625,6 @@ "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, "just-extend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.0.2.tgz", @@ -1918,19 +1744,6 @@ "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==" }, - "mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" - }, - "mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", - "requires": { - "mime-db": "1.40.0" - } - }, "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", @@ -2106,11 +1919,6 @@ "validate-npm-package-license": "^3.0.1" } }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" - }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -2274,11 +2082,6 @@ "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", "dev": true }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" - }, "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", @@ -2349,11 +2152,6 @@ "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", "dev": true }, - "psl": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", - "integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==" - }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -2396,16 +2194,6 @@ } } }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" - }, "ramda": { "version": "0.26.1", "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.26.1.tgz", @@ -2472,40 +2260,6 @@ "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", "dev": true }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "dependencies": { - "uuid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", - "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" - } - } - }, "require-like": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/require-like/-/require-like-0.1.2.tgz", @@ -2613,7 +2367,8 @@ "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true }, "sandboxed-module": { "version": "2.0.3", @@ -2744,22 +2499,6 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, "stack-trace": { "version": "0.0.9", "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.9.tgz", @@ -2972,35 +2711,6 @@ "to-no-case": "^1.0.0" } }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - } - } - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" - }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -3027,14 +2737,6 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "requires": { - "punycode": "^2.1.0" - } - }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -3055,16 +2757,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, "walkdir": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.4.1.tgz", diff --git a/libraries/logger/package.json b/libraries/logger/package.json index c1214c5d1a..9eae161913 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -19,7 +19,6 @@ "@overleaf/o-error": "^2.0.0", "bunyan": "1.8.12", "raven": "1.1.3", - "request": "2.88.0", "yn": "^3.1.1" }, "devDependencies": { diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index f94d92f9cf..dc77b31f7c 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -40,7 +40,9 @@ describe('LoggingManager', function() { this.Raven = { Client: sinon.stub().returns(this.ravenClient) } - this.Request = sinon.stub() + this.Fs = { + readFile: sinon.stub() + } this.stackdriverStreamConfig = { stream: 'stackdriver' } this.stackdriverClient = { stream: sinon.stub().returns(this.stackdriverStreamConfig) @@ -53,7 +55,7 @@ describe('LoggingManager', function() { requires: { bunyan: this.Bunyan, raven: this.Raven, - request: this.Request, + fs: this.Fs, '@google-cloud/logging-bunyan': this.GCPLogging } }) @@ -260,20 +262,14 @@ describe('LoggingManager', function() { }) describe('checkLogLevel', function() { - it('should request log level override from google meta data service', function() { + it('should request log level override from the config map', function() { this.logger.checkLogLevel() - const options = { - headers: { - 'Metadata-Flavor': 'Google' - }, - uri: `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` - } - this.Request.should.have.been.calledWithMatch(options) + this.Fs.readFile.should.have.been.calledWithMatch('/logging/tracingEndTime') }) - describe('when request has error', function() { + describe('when read errors', function() { beforeEach(function() { - this.Request.yields('error') + this.Fs.readFile.yields(new Error('error')) this.logger.checkLogLevel() }) @@ -284,9 +280,9 @@ describe('LoggingManager', function() { }) }) - describe('when statusCode is not 200', function() { + describe('when the file is empty', function() { beforeEach(function() { - this.Request.yields(null, { statusCode: 404 }) + this.Fs.readFile.yields(null, '') this.logger.checkLogLevel() }) @@ -299,7 +295,7 @@ describe('LoggingManager', function() { describe('when time value returned that is less than current time', function() { beforeEach(function() { - this.Request.yields(null, { statusCode: 200 }, '1') + this.Fs.readFile.yields(null, '1') this.logger.checkLogLevel() }) @@ -314,7 +310,7 @@ describe('LoggingManager', function() { describe('when level is already set', function() { beforeEach(function() { this.bunyanLogger.level.returns(10) - this.Request.yields(null, { statusCode: 200 }, this.start + 1000) + this.Fs.readFile.yields(null, (this.start + 1000).toString()) this.logger.checkLogLevel() }) @@ -328,7 +324,7 @@ describe('LoggingManager', function() { describe('when level is not already set', function() { beforeEach(function() { this.bunyanLogger.level.returns(20) - this.Request.yields(null, { statusCode: 200 }, this.start + 1000) + this.Fs.readFile.yields(null, (this.start + 1000).toString()) this.logger.checkLogLevel() }) From c602d536d2a25beac327dace4a0464f6ac0b52cb Mon Sep 17 00:00:00 2001 From: Miguel Serrano Date: Wed, 3 Jun 2020 10:19:45 +0200 Subject: [PATCH 52/93] updated OError to v3 --- libraries/logger/package-lock.json | 8 ++++---- libraries/logger/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/logger/package-lock.json b/libraries/logger/package-lock.json index 6973a88333..57cf4ea0d1 100644 --- a/libraries/logger/package-lock.json +++ b/libraries/logger/package-lock.json @@ -1,6 +1,6 @@ { "name": "logger-sharelatex", - "version": "1.9.0", + "version": "1.9.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -140,9 +140,9 @@ } }, "@overleaf/o-error": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@overleaf/o-error/-/o-error-2.1.0.tgz", - "integrity": "sha512-Zd9sks9LrLw8ErHt/cXeWIkyxWAqNAvNGn7wIjLQJH6TTEEW835PWOhpch+hQwwWsTxWIx/JDj+IpZ3ouw925g==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@overleaf/o-error/-/o-error-3.0.0.tgz", + "integrity": "sha512-LsM2s6Iy9G97ktPo0ys4VxtI/m3ahc1ZHwjo5XnhXtjeIkkkVAehsrcRRoV/yWepPjymB0oZonhcfojpjYR/tg==" }, "@protobufjs/aspromise": { "version": "1.1.2", diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 8742b8c840..804703b650 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -16,7 +16,7 @@ }, "dependencies": { "@google-cloud/logging-bunyan": "^2.0.0", - "@overleaf/o-error": "^2.0.0", + "@overleaf/o-error": "^3.0.0", "bunyan": "1.8.12", "raven": "1.1.3", "request": "2.88.0", From da0f2d5e752f0d43bc13725ed12a4978cf378440 Mon Sep 17 00:00:00 2001 From: Miguel Serrano Date: Wed, 3 Jun 2020 10:19:58 +0200 Subject: [PATCH 53/93] Updated .nvmrc to latest LTS --- libraries/logger/.nvmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/logger/.nvmrc b/libraries/logger/.nvmrc index d87edbfc10..49c17b70d2 100644 --- a/libraries/logger/.nvmrc +++ b/libraries/logger/.nvmrc @@ -1 +1 @@ -4.2.1 \ No newline at end of file +10.21.0 \ No newline at end of file From 12e3afb174931ce302f1df087bc4aa301154f0ac Mon Sep 17 00:00:00 2001 From: Miguel Serrano Date: Wed, 3 Jun 2020 10:20:43 +0200 Subject: [PATCH 54/93] Bumped major version --- libraries/logger/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 804703b650..d68e01e486 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -7,7 +7,7 @@ "url": "http://github.com/sharelatex/logger-sharelatex.git" }, "license": "AGPL-3.0-only", - "version": "1.9.1", + "version": "2.0.0", "scripts": { "test": "mocha test/**/*.js", "format": "prettier-eslint '**/*.js' --list-different", From c93ee448792deae0b500e5d7901f8dce7905350c Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Tue, 30 Jun 2020 12:33:55 +0100 Subject: [PATCH 55/93] Update acorn dependency (via eslint) https://github.com/advisories/GHSA-6chw-6frg-f759 --- libraries/logger/package-lock.json | 965 +++++++++++++++-------------- libraries/logger/package.json | 2 +- 2 files changed, 511 insertions(+), 456 deletions(-) diff --git a/libraries/logger/package-lock.json b/libraries/logger/package-lock.json index 2359ebcbd7..055cd2f768 100644 --- a/libraries/logger/package-lock.json +++ b/libraries/logger/package-lock.json @@ -1,9 +1,35 @@ { "name": "logger-sharelatex", - "version": "1.9.1", + "version": "2.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.10.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.3.tgz", + "integrity": "sha512-fDx9eNW0qz0WkUeqL6tXEXzVlPh6Y5aCDEZesl0xBGA8ndRukX91Uk44ZqnkECp01NAZUdCAl+aiQNGi0k88Eg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.3" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.3", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.3.tgz", + "integrity": "sha512-bU8JvtlYpJSBPuj1VUmKpFGaDZuLxASky3LhaKj3bmpSTY6VWooSM8msk+Z0CZoErFye2tlABF6yDkT3FOPAXw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.10.3", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.3.tgz", + "integrity": "sha512-Ih9B/u7AtgEnySE2L2F0Xm0GaM729XqqLfHkalTsbjXGyqmf/6M0Cu0WpvqueUlW+xk88BHw9Nkpj49naU+vWw==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.3", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, "@google-cloud/common": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-2.2.3.tgz", @@ -234,6 +260,12 @@ "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", "dev": true }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, "@types/long": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz", @@ -253,27 +285,16 @@ } }, "acorn": { - "version": "5.7.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", - "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.3.1.tgz", + "integrity": "sha512-tLc0wSnatxAQHVHUapaHdz72pi9KUyHjq5KyHjGg9Y8Ifdc79pTh2XvI6I1/chZbnM7QtNKzh66ooDogPZSleA==", "dev": true }, "acorn-jsx": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", - "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", - "dev": true, - "requires": { - "acorn": "^3.0.4" - }, - "dependencies": { - "acorn": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", - "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", - "dev": true - } - } + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", + "dev": true }, "agent-base": { "version": "4.3.0", @@ -283,29 +304,49 @@ "es6-promisify": "^5.0.0" } }, - "ajv-keywords": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", - "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", - "dev": true + "ajv": { + "version": "6.12.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", + "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } }, "ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dev": true, + "requires": { + "type-fest": "^0.11.0" + }, + "dependencies": { + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "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": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", "dev": true }, "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } }, "argparse": { "version": "1.0.10", @@ -343,6 +384,12 @@ "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, "async-listener": { "version": "0.6.10", "resolved": "https://registry.npmjs.org/async-listener/-/async-listener-0.6.10.tgz", @@ -352,41 +399,6 @@ "shimmer": "^1.1.0" } }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - }, - "dependencies": { - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "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.0.0" - } - } - } - }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -422,12 +434,6 @@ "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, "bunyan": { "version": "1.8.12", "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.12.tgz", @@ -439,19 +445,10 @@ "safe-json-stringify": "~1" } }, - "caller-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", - "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", - "dev": true, - "requires": { - "callsites": "^0.2.0" - } - }, "callsites": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", - "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, "chai": { @@ -477,32 +474,12 @@ "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } } }, "chardet": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", - "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, "check-error": { @@ -511,31 +488,19 @@ "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", "dev": true }, - "circular-json": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", - "dev": true - }, "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, "requires": { - "restore-cursor": "^2.0.0" + "restore-cursor": "^3.1.0" } }, "cli-width": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", - "dev": true - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", "dev": true }, "color-convert": { @@ -564,18 +529,6 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, "contains-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", @@ -602,12 +555,14 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, "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=", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "requires": { - "lru-cache": "^4.0.1", + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", "shebang-command": "^1.2.0", "which": "^1.2.9" } @@ -656,9 +611,9 @@ "dev": true }, "doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "requires": { "esutils": "^2.0.2" @@ -713,6 +668,12 @@ "shimmer": "^1.2.0" } }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, "end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -784,87 +745,69 @@ "dev": true }, "eslint": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", - "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.6.0.tgz", + "integrity": "sha512-PpEBq7b6qY/qrOmpYQ/jTMDYfuQMELR4g4WI1M/NaSDDD/bdcMb+dj4Hgks7p41kW2caXsPsEZAEAyAgjVVC0g==", "dev": true, "requires": { - "ajv": "^5.3.0", - "babel-code-frame": "^6.22.0", + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", "chalk": "^2.1.0", - "concat-stream": "^1.6.0", - "cross-spawn": "^5.1.0", - "debug": "^3.1.0", - "doctrine": "^2.1.0", - "eslint-scope": "^3.7.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^3.5.4", - "esquery": "^1.0.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^1.4.3", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.1.2", + "esquery": "^1.0.1", "esutils": "^2.0.2", - "file-entry-cache": "^2.0.0", + "file-entry-cache": "^5.0.1", "functional-red-black-tree": "^1.0.1", - "glob": "^7.1.2", - "globals": "^11.0.1", - "ignore": "^3.3.3", + "glob-parent": "^5.0.0", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^3.0.6", - "is-resolvable": "^1.0.0", - "js-yaml": "^3.9.1", + "inquirer": "^7.0.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.3.0", - "lodash": "^4.17.4", - "minimatch": "^3.0.2", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", "optionator": "^0.8.2", - "path-is-inside": "^1.0.2", - "pluralize": "^7.0.0", "progress": "^2.0.0", - "regexpp": "^1.0.1", - "require-uncached": "^1.0.3", - "semver": "^5.3.0", - "strip-ansi": "^4.0.0", - "strip-json-comments": "~2.0.1", - "table": "4.0.2", - "text-table": "~0.2.0" + "regexpp": "^2.0.1", + "semver": "^6.1.2", + "strip-ansi": "^5.2.0", + "strip-json-comments": "^3.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" }, "dependencies": { - "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" + "ms": "^2.1.1" } }, - "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, - "glob": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.5.tgz", - "integrity": "sha512-J9dlskqUXK1OeTOYBEn5s8aMukWMwWfs+rPTn/jn50Ux4MNXVhubL1wu/j2t+H4NVI+cXEcCaYellqaPVGXNqQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } @@ -1030,29 +973,39 @@ "dev": true }, "eslint-scope": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz", - "integrity": "sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz", + "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==", "dev": true, "requires": { "esrecurse": "^4.1.0", "estraverse": "^4.1.1" } }, + "eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, "eslint-visitor-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", - "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true }, "espree": { - "version": "3.5.4", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", - "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", + "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", "dev": true, "requires": { - "acorn": "^5.5.0", - "acorn-jsx": "^3.0.0" + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.1.0" } }, "esprima": { @@ -1062,12 +1015,20 @@ "dev": true }, "esquery": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", - "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", "dev": true, "requires": { - "estraverse": "^4.0.0" + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", + "integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==", + "dev": true + } } }, "esrecurse": { @@ -1118,20 +1079,26 @@ "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, "external-editor": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", - "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", "dev": true, "requires": { - "chardet": "^0.4.0", - "iconv-lite": "^0.4.17", + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", "tmp": "^0.0.33" } }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, "fast-levenshtein": { @@ -1146,22 +1113,21 @@ "integrity": "sha512-R9bHCvweUxxwkDwhjav5vxpFvdPGlVngtqmx4pIZfSUhM/Q4NiIUHB456BAf+Q1Nwu3HEZYONtu+Rya+af4jiQ==" }, "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, "requires": { "escape-string-regexp": "^1.0.5" } }, "file-entry-cache": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", - "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", "dev": true, "requires": { - "flat-cache": "^1.2.1", - "object-assign": "^4.0.1" + "flat-cache": "^2.0.1" } }, "find-up": { @@ -1174,21 +1140,20 @@ } }, "flat-cache": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", - "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", "dev": true, "requires": { - "circular-json": "^0.3.1", - "graceful-fs": "^4.1.2", - "rimraf": "~2.6.2", - "write": "^0.2.1" + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" }, "dependencies": { "glob": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.5.tgz", - "integrity": "sha512-J9dlskqUXK1OeTOYBEn5s8aMukWMwWfs+rPTn/jn50Ux4MNXVhubL1wu/j2t+H4NVI+cXEcCaYellqaPVGXNqQ==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -1210,6 +1175,12 @@ } } }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -1274,6 +1245,15 @@ "path-is-absolute": "^1.0.0" } }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, "globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -1377,15 +1357,6 @@ "function-bind": "^1.1.1" } }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -1463,6 +1434,16 @@ "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", "dev": true }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -1484,25 +1465,85 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "inquirer": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", - "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.2.0.tgz", + "integrity": "sha512-E0c4rPwr9ByePfNlTIB8z51kK1s2n6jrHuJeEHENl/sbq2G/S1auvibgEwNR4uSyiU+PiYHqSwsgGiXjG8p5ZQ==", "dev": true, "requires": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.0", - "cli-cursor": "^2.1.0", + "ansi-escapes": "^4.2.1", + "chalk": "^3.0.0", + "cli-cursor": "^3.1.0", "cli-width": "^2.0.0", - "external-editor": "^2.0.4", - "figures": "^2.0.0", - "lodash": "^4.3.0", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rx-lite": "^4.0.8", - "rx-lite-aggregates": "^4.0.8", - "string-width": "^2.1.0", - "strip-ansi": "^4.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.15", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.5.3", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", "through": "^2.3.6" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "is": { @@ -1528,23 +1569,32 @@ "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", "dev": true }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, "is-obj": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==" }, - "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", - "dev": true - }, "is-regex": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", @@ -1554,12 +1604,6 @@ "has": "^1.0.1" } }, - "is-resolvable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", - "dev": true - }, "is-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", @@ -1591,15 +1635,15 @@ "dev": true }, "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -1614,6 +1658,12 @@ "bignumber.js": "^7.0.0" } }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", @@ -1719,16 +1769,6 @@ "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, "lsmod": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lsmod/-/lsmod-1.0.0.tgz", @@ -1745,9 +1785,9 @@ "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==" }, "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, "minimatch": { @@ -1842,9 +1882,9 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "dev": true }, "mv": { @@ -1876,6 +1916,12 @@ "integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=", "optional": true }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, "nise": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.2.tgz", @@ -1919,12 +1965,6 @@ "validate-npm-package-license": "^3.0.1" } }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, "object-inspect": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", @@ -1966,26 +2006,26 @@ } }, "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", + "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", "dev": true, "requires": { - "mimic-fn": "^1.0.0" + "mimic-fn": "^2.1.0" } }, "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", "dev": true, "requires": { "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", + "fast-levenshtein": "~2.0.6", "levn": "~0.3.0", "prelude-ls": "~1.1.2", "type-check": "~0.3.2", - "wordwrap": "~1.0.0" + "word-wrap": "~1.2.3" } }, "os-tmpdir": { @@ -2018,6 +2058,15 @@ "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", "dev": true }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", @@ -2038,10 +2087,10 @@ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true }, "path-parse": { @@ -2097,12 +2146,6 @@ "find-up": "^2.1.0" } }, - "pluralize": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", - "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", - "dev": true - }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -2146,12 +2189,6 @@ "long": "^4.0.0" } }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true - }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -2194,6 +2231,12 @@ } } }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, "ramda": { "version": "0.26.1", "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.26.1.tgz", @@ -2255,9 +2298,9 @@ } }, "regexpp": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", - "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, "require-like": { @@ -2266,16 +2309,6 @@ "integrity": "sha1-rW8wwTvs15cBDEaK+ndcDAprR/o=", "dev": true }, - "require-uncached": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", - "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", - "dev": true, - "requires": { - "caller-path": "^0.1.0", - "resolve-from": "^1.0.0" - } - }, "resolve": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", @@ -2286,18 +2319,18 @@ } }, "resolve-from": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", - "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", "dev": true, "requires": { - "onetime": "^2.0.0", + "onetime": "^5.1.0", "signal-exit": "^3.0.2" } }, @@ -2330,27 +2363,18 @@ } }, "run-async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", - "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", - "dev": true, - "requires": { - "is-promise": "^2.1.0" - } - }, - "rx-lite": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", - "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", "dev": true }, - "rx-lite-aggregates": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", - "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "rxjs": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz", + "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==", "dev": true, "requires": { - "rx-lite": "*" + "tslib": "^1.9.0" } }, "safe-buffer": { @@ -2406,9 +2430,9 @@ "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==" }, "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true }, "sinon": { @@ -2444,12 +2468,22 @@ "dev": true }, "slice-ansi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", "dev": true, "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", "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 + } } }, "snakecase-keys": { @@ -2518,13 +2552,25 @@ "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "dev": true, "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } } }, "string.prototype.trimleft": { @@ -2563,18 +2609,18 @@ } }, "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^4.1.0" }, "dependencies": { "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true } } @@ -2586,9 +2632,9 @@ "dev": true }, "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", + "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==", "dev": true }, "stubs": { @@ -2597,48 +2643,48 @@ "integrity": "sha1-6NK6H6nJBXAwPAMLaQD31fiavls=" }, "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - }, - "table": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", - "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { - "ajv": "^5.2.3", - "ajv-keywords": "^2.1.0", - "chalk": "^2.1.0", - "lodash": "^4.17.4", - "slice-ansi": "1.0.0", - "string-width": "^2.1.1" + "has-flag": "^3.0.0" + } + }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" }, "dependencies": { - "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "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 + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" } - }, - "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", - "dev": true } } }, @@ -2711,6 +2757,12 @@ "to-no-case": "^1.0.0" } }, + "tslib": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", + "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", + "dev": true + }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -2731,11 +2783,14 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } }, "util-deprecate": { "version": "1.0.2", @@ -2747,6 +2802,12 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.0.0.tgz", "integrity": "sha1-Zyj8BFnEUNeWqZwxg3VpvfZy1yg=" }, + "v8-compile-cache": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", + "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", + "dev": true + }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -2771,10 +2832,10 @@ "isexe": "^2.0.0" } }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, "wrappy": { @@ -2783,20 +2844,14 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", - "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", "dev": true, "requires": { "mkdirp": "^0.5.1" } }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true - }, "yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 25ff5f5df9..99b0e7d60e 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -23,7 +23,7 @@ }, "devDependencies": { "chai": "4.2.0", - "eslint": "^4.18.1", + "eslint": "^6.6.0", "eslint-config-prettier": "^3.1.0", "eslint-config-standard": "^11.0.0", "eslint-plugin-chai-expect": "^1.1.1", From 9e54503d1b55f40ba6e549e353c8a78c2a3fce82 Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Tue, 30 Jun 2020 13:55:24 +0100 Subject: [PATCH 56/93] Add prettier-eslint-cli to dev-dependencies --- libraries/logger/package-lock.json | 1130 ++++++++++++++++++++++++++++ libraries/logger/package.json | 1 + 2 files changed, 1131 insertions(+) diff --git a/libraries/logger/package-lock.json b/libraries/logger/package-lock.json index 055cd2f768..5b3793cb5a 100644 --- a/libraries/logger/package-lock.json +++ b/libraries/logger/package-lock.json @@ -266,6 +266,18 @@ "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", "dev": true }, + "@types/eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", + "dev": true + }, + "@types/json-schema": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.5.tgz", + "integrity": "sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ==", + "dev": true + }, "@types/long": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz", @@ -276,6 +288,59 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.22.tgz", "integrity": "sha512-9taxKC944BqoTVjE+UT3pQH0nHZlTvITwfsOZqyc+R3sfJuxaTtxWjfn1K2UlxyPcKHf0rnaXcVFrS9F9vf0bw==" }, + "@typescript-eslint/experimental-utils": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-1.13.0.tgz", + "integrity": "sha512-zmpS6SyqG4ZF64ffaJ6uah6tWWWgZ8m+c54XXgwFtUv0jNz8aJAVx8chMCvnk7yl6xwn8d+d96+tWp7fXzTuDg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/typescript-estree": "1.13.0", + "eslint-scope": "^4.0.0" + }, + "dependencies": { + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + } + } + }, + "@typescript-eslint/parser": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-1.13.0.tgz", + "integrity": "sha512-ITMBs52PCPgLb2nGPoeT4iU3HdQZHcPaZVw+7CsFagRJHUhyeTgorEwHXhFf3e7Evzi8oujKNpHc8TONth8AdQ==", + "dev": true, + "requires": { + "@types/eslint-visitor-keys": "^1.0.0", + "@typescript-eslint/experimental-utils": "1.13.0", + "@typescript-eslint/typescript-estree": "1.13.0", + "eslint-visitor-keys": "^1.0.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-1.13.0.tgz", + "integrity": "sha512-b5rCmd2e6DCC6tCTN9GSUAuxdYwCM/k/2wdjHGrIRGPSJotWMCe/dGpi66u42bhuh8q3QBzqM4TMA1GUUCJvdw==", + "dev": true, + "requires": { + "lodash.unescape": "4.0.1", + "semver": "5.5.0" + }, + "dependencies": { + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + } + } + }, "abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", @@ -414,6 +479,12 @@ "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-7.2.1.tgz", "integrity": "sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==" }, + "boolify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/boolify/-/boolify-1.0.1.tgz", + "integrity": "sha1-tcCeF8rNET0Rt7s+04TMASmU2Gs=", + "dev": true + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -451,6 +522,23 @@ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + } + }, "chai": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", @@ -503,6 +591,42 @@ "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", "dev": true }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + }, + "dependencies": { + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "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 + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + } + } + }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -524,6 +648,12 @@ "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", "dev": true }, + "common-tags": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.0.tgz", + "integrity": "sha512-6P6g0uetGpW/sdyUy/iQQCbFF0kWVMSIVSyYz7Zgjcgh8mgw8PQzDNZeyZ5DQ2gM7LBoZPHmnjz8rUthkBG5tw==", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -549,6 +679,12 @@ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" }, + "core-js": { + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.5.tgz", + "integrity": "sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA==", + "dev": true + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -580,6 +716,12 @@ "ms": "^2.1.1" } }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, "deep-eql": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", @@ -610,6 +752,12 @@ "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, + "dlv": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", + "dev": true + }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -1220,6 +1368,12 @@ "json-bigint": "^0.3.0" } }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, "get-func-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", @@ -1357,6 +1511,23 @@ "function-bind": "^1.1.1" } }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + } + } + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -1450,6 +1621,12 @@ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -1753,11 +1930,87 @@ "resolved": "https://registry.npmjs.org/lodash.has/-/lodash.has-4.5.2.tgz", "integrity": "sha1-0Z9NwQlQWMzL4rDN9O4P5Ko3yGI=" }, + "lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", + "dev": true + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "lodash.unescape": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz", + "integrity": "sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw=", + "dev": true + }, "log-driver": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==" }, + "loglevel": { + "version": "1.6.8", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.6.8.tgz", + "integrity": "sha512-bsU7+gc9AJ2SqpzxwU3+1fedl8zAntbtC5XYlt3s2j1hJcn2PsXSmgN8TaLG/J1/2mod4+cE/3vNL70/c1RNCA==", + "dev": true + }, + "loglevel-colored-level-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/loglevel-colored-level-prefix/-/loglevel-colored-level-prefix-1.0.0.tgz", + "integrity": "sha1-akAhj9x64V/HbD0PPmdsRlOIYD4=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "loglevel": "^1.4.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 + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "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.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, "lolex": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/lolex/-/lolex-3.1.0.tgz", @@ -1774,11 +2027,52 @@ "resolved": "https://registry.npmjs.org/lsmod/-/lsmod-1.0.0.tgz", "integrity": "sha1-mgD3bco26yP6BTUK/htYXUKZ5ks=" }, + "make-plural": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/make-plural/-/make-plural-4.3.0.tgz", + "integrity": "sha512-xTYd4JVHpSCW+aqDof6w/MebaMVNTVYBZhbB/vi513xXdiPT92JMVCo0Jq8W2UZnzYRFeVbQiQ+I25l13JuKvA==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true, + "optional": true + } + } + }, "map-obj": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==" }, + "messageformat": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/messageformat/-/messageformat-2.3.0.tgz", + "integrity": "sha512-uTzvsv0lTeQxYI2y1NPa1lItL5VRI8Gb93Y2K2ue5gBPyrbJxfDi/EYWxh2PKv5yO42AJeeqblS9MJSh/IEk4w==", + "dev": true, + "requires": { + "make-plural": "^4.3.0", + "messageformat-formatters": "^2.0.1", + "messageformat-parser": "^4.1.2" + } + }, + "messageformat-formatters": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/messageformat-formatters/-/messageformat-formatters-2.0.1.tgz", + "integrity": "sha512-E/lQRXhtHwGuiQjI7qxkLp8AHbMD5r2217XNe/SREbBlSawe0lOqsFb7rflZJmlQFSULNLIqlcjjsCPlB3m3Mg==", + "dev": true + }, + "messageformat-parser": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/messageformat-parser/-/messageformat-parser-4.1.3.tgz", + "integrity": "sha512-2fU3XDCanRqeOCkn7R5zW5VQHWf+T3hH65SzuqRvjatBK7r4uyFa5mEX+k6F9Bd04LVM5G4/BHBTUJsOdW7uyg==", + "dev": true + }, "mime": { "version": "2.4.4", "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", @@ -2087,6 +2381,12 @@ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", @@ -2158,6 +2458,597 @@ "integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==", "dev": true }, + "prettier-eslint": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/prettier-eslint/-/prettier-eslint-9.0.2.tgz", + "integrity": "sha512-u6EQqxUhaGfra9gy9shcR7MT7r/2twwEfRGy1tfzyaJvLQwSg34M9IU5HuF7FsLW2QUgr5VIUc56EPWibw1pdw==", + "dev": true, + "requires": { + "@typescript-eslint/parser": "^1.10.2", + "common-tags": "^1.4.0", + "core-js": "^3.1.4", + "dlv": "^1.1.0", + "eslint": "^5.0.0", + "indent-string": "^4.0.0", + "lodash.merge": "^4.6.0", + "loglevel-colored-level-prefix": "^1.0.0", + "prettier": "^1.7.0", + "pretty-format": "^23.0.1", + "require-relative": "^0.8.7", + "typescript": "^3.2.1", + "vue-eslint-parser": "^2.0.2" + }, + "dependencies": { + "acorn": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", + "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", + "dev": true + }, + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "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 + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "eslint": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", + "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.9.1", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^4.0.3", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^5.0.1", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^6.2.2", + "js-yaml": "^3.13.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.11", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0" + } + }, + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "espree": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", + "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", + "dev": true, + "requires": { + "acorn": "^6.0.7", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" + } + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "inquirer": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", + "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "dev": true, + "requires": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.12", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "string-width": { + "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", + "strip-ansi": "^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" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + } + } + }, + "prettier-eslint-cli": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/prettier-eslint-cli/-/prettier-eslint-cli-5.0.0.tgz", + "integrity": "sha512-cei9UbN1aTrz3sQs88CWpvY/10PYTevzd76zoG1tdJ164OhmNTFRKPTOZrutVvscoQWzbnLKkviS3gu5JXwvZg==", + "dev": true, + "requires": { + "arrify": "^2.0.1", + "boolify": "^1.0.0", + "camelcase-keys": "^6.0.0", + "chalk": "^2.4.2", + "common-tags": "^1.8.0", + "core-js": "^3.1.4", + "eslint": "^5.0.0", + "find-up": "^4.1.0", + "get-stdin": "^7.0.0", + "glob": "^7.1.4", + "ignore": "^5.1.2", + "lodash.memoize": "^4.1.2", + "loglevel-colored-level-prefix": "^1.0.0", + "messageformat": "^2.2.1", + "prettier-eslint": "^9.0.0", + "rxjs": "^6.5.2", + "yargs": "^13.2.4" + }, + "dependencies": { + "acorn": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", + "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", + "dev": true + }, + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "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 + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "eslint": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", + "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.9.1", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^4.0.3", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^5.0.1", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^6.2.2", + "js-yaml": "^3.13.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.11", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0" + }, + "dependencies": { + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + } + } + }, + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "espree": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", + "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", + "dev": true, + "requires": { + "acorn": "^6.0.7", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" + } + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "get-stdin": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", + "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==", + "dev": true + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true + }, + "inquirer": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", + "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "dev": true, + "requires": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.12", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "string-width": { + "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", + "strip-ansi": "^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" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + } + } + }, + "pretty-format": { + "version": "23.6.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-23.6.0.tgz", + "integrity": "sha512-zf9NV1NSlDLDjycnwm6hpFATCGl/K1lt0R/GdkAK2O5LN/rwJoB+Mh93gGJjut4YbmecbfgLWVGSTCr0Ewvvbw==", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0", + "ansi-styles": "^3.2.0" + }, + "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 + } + } + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -2237,6 +3128,12 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, + "quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "dev": true + }, "ramda": { "version": "0.26.1", "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.26.1.tgz", @@ -2303,12 +3200,30 @@ "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, "require-like": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/require-like/-/require-like-0.1.2.tgz", "integrity": "sha1-rW8wwTvs15cBDEaK+ndcDAprR/o=", "dev": true }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "require-relative": { + "version": "0.8.7", + "resolved": "https://registry.npmjs.org/require-relative/-/require-relative-0.8.7.tgz", + "integrity": "sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=", + "dev": true + }, "resolve": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", @@ -2409,6 +3324,12 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -2783,6 +3704,12 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" }, + "typescript": { + "version": "3.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.5.tgz", + "integrity": "sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ==", + "dev": true + }, "uri-js": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", @@ -2818,6 +3745,65 @@ "spdx-expression-parse": "^3.0.0" } }, + "vue-eslint-parser": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-2.0.3.tgz", + "integrity": "sha512-ZezcU71Owm84xVF6gfurBQUGg8WQ+WZGxgDEQu1IHFBZNx7BFZg3L1yHxrCBNNwbwFtE1GuvfJKMtb6Xuwc/Bw==", + "dev": true, + "requires": { + "debug": "^3.1.0", + "eslint-scope": "^3.7.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^3.5.2", + "esquery": "^1.0.0", + "lodash": "^4.17.4" + }, + "dependencies": { + "acorn": { + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", + "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", + "dev": true + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, + "requires": { + "acorn": "^3.0.4" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "eslint-scope": { + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz", + "integrity": "sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "espree": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "dev": true, + "requires": { + "acorn": "^5.5.0", + "acorn-jsx": "^3.0.0" + } + } + } + }, "walkdir": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.4.1.tgz", @@ -2832,12 +3818,54 @@ "isexe": "^2.0.0" } }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "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 + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + } + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -2852,6 +3880,108 @@ "mkdirp": "^0.5.1" } }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + }, + "dependencies": { + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + } + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, "yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 99b0e7d60e..4d965dbdab 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -35,6 +35,7 @@ "eslint-plugin-standard": "^3.0.1", "mocha": "^5.2.0", "prettier": "^1.18.2", + "prettier-eslint-cli": "^5.0.0", "sandboxed-module": "2.0.3", "sinon": "7.2.3", "sinon-chai": "3.3.0" From fa8df5cc0b7fd91a06481369486f659535fa734d Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Tue, 30 Jun 2020 13:56:13 +0100 Subject: [PATCH 57/93] Format:fix --- libraries/logger/test/unit/loggingManagerTests.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index d236776a81..f40163e5af 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -290,7 +290,9 @@ describe('LoggingManager', function() { describe('checkLogLevel', function() { it('should request log level override from the config map', function() { this.logger.checkLogLevel() - this.Fs.readFile.should.have.been.calledWithMatch('/logging/tracingEndTime') + this.Fs.readFile.should.have.been.calledWithMatch( + '/logging/tracingEndTime' + ) }) describe('when read errors', function() { From 52649c9d0b1f065dd85aab967e33667551c760f7 Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Tue, 30 Jun 2020 14:00:15 +0100 Subject: [PATCH 58/93] 2.1.0 --- libraries/logger/package-lock.json | 2 +- libraries/logger/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/logger/package-lock.json b/libraries/logger/package-lock.json index 5b3793cb5a..e77cc658d2 100644 --- a/libraries/logger/package-lock.json +++ b/libraries/logger/package-lock.json @@ -1,6 +1,6 @@ { "name": "logger-sharelatex", - "version": "2.0.0", + "version": "2.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 4d965dbdab..a6f233b781 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -7,7 +7,7 @@ "url": "http://github.com/sharelatex/logger-sharelatex.git" }, "license": "AGPL-3.0-only", - "version": "2.0.0", + "version": "2.1.0", "scripts": { "test": "mocha test/**/*.js", "format": "prettier-eslint '**/*.js' --list-different", From b932a8127b65425ec656f4672fb1cfc59b058e4b Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Thu, 2 Jul 2020 10:46:37 +0100 Subject: [PATCH 59/93] Bump eslint plugins --- libraries/logger/package-lock.json | 387 ++++++++++++++++++++--------- libraries/logger/package.json | 20 +- 2 files changed, 279 insertions(+), 128 deletions(-) diff --git a/libraries/logger/package-lock.json b/libraries/logger/package-lock.json index e77cc658d2..1415c45165 100644 --- a/libraries/logger/package-lock.json +++ b/libraries/logger/package-lock.json @@ -278,6 +278,12 @@ "integrity": "sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ==", "dev": true }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, "@types/long": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz", @@ -429,13 +435,24 @@ "dev": true }, "array-includes": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", - "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", + "integrity": "sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ==", "dev": true, "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.7.0" + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0", + "is-string": "^1.0.5" + } + }, + "array.prototype.flat": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz", + "integrity": "sha512-gBlRZV0VSmfPIeWfuuy56XZMvbVfbEUnOXUvt3F/eUUUSyzlgLxhEX4YAEpxNAogRGehPSnfXyPtYyKAhkzQhQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" } }, "arrify": { @@ -845,27 +862,28 @@ } }, "es-abstract": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.16.0.tgz", - "integrity": "sha512-xdQnfykZ9JMEiasTAJZJdMWCQ1Vm00NBw79/AWi7ELfZuuPCSOMDZbT9mkOfSctVtfhb+sAAzrm+j//GjjLHLg==", + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", "dev": true, "requires": { - "es-to-primitive": "^1.2.0", + "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", - "has-symbols": "^1.0.0", - "is-callable": "^1.1.4", - "is-regex": "^1.0.4", - "object-inspect": "^1.6.0", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", "object-keys": "^1.1.1", - "string.prototype.trimleft": "^2.1.0", - "string.prototype.trimright": "^2.1.0" + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" } }, "es-to-primitive": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", - "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", "dev": true, "requires": { "is-callable": "^1.1.4", @@ -961,28 +979,28 @@ } }, "eslint-config-prettier": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-3.6.0.tgz", - "integrity": "sha512-ixJ4U3uTLXwJts4rmSVW/lMXjlGwCijhBJHk8iVqKKSifeI0qgFEfWl8L63isfc8Od7EiBALF6BX3jKLluf/jQ==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz", + "integrity": "sha512-oB8cpLWSAjOVFEJhhyMZh6NOEOtBVziaqdDQ86+qhDHFbZXoRTM7pNSvFRfW/W/L/LrQ38C99J5CGuRBBzBsdA==", "dev": true, "requires": { "get-stdin": "^6.0.0" } }, "eslint-config-standard": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-11.0.0.tgz", - "integrity": "sha512-oDdENzpViEe5fwuRCWla7AXQd++/oyIp8zP+iP9jiUPG6NBj3SHgdgtl/kTn00AjeN+1HNvavTKmYbMo+xMOlw==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-14.1.1.tgz", + "integrity": "sha512-Z9B+VR+JIXRxz21udPTL9HpFMyoMUEeX1G251EQ6e05WD9aPVtVBn09XUmZ259wCMlCDmYDSZG62Hhm+ZTJcUg==", "dev": true }, "eslint-import-resolver-node": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", - "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", + "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", "dev": true, "requires": { "debug": "^2.6.9", - "resolve": "^1.5.0" + "resolve": "^1.13.1" }, "dependencies": { "debug": { @@ -999,16 +1017,25 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } } } }, "eslint-module-utils": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.4.1.tgz", - "integrity": "sha512-H6DOj+ejw7Tesdgbfs4jeS4YMFrT8uI8xwd1gtQqXssaR0EQ26L+2O/w6wkYFy2MymON0fTwHmXBvvfLNZVZEw==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", + "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", "dev": true, "requires": { - "debug": "^2.6.8", + "debug": "^2.6.9", "pkg-dir": "^2.0.0" }, "dependencies": { @@ -1030,34 +1057,63 @@ } }, "eslint-plugin-chai-expect": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-chai-expect/-/eslint-plugin-chai-expect-1.2.0.tgz", - "integrity": "sha512-UfoqOzGBY3AU0VoNwIzJ0tpJgs5pD6QRFwcrDbqY00fk+JvIHXyZnj42Xgk/gfsWhhx+w0U4my22EegpSn2odQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-chai-expect/-/eslint-plugin-chai-expect-2.1.0.tgz", + "integrity": "sha512-rd0/4mjMV6c3i0o4DKkWI4uaFN9DK707kW+/fDphaDI6HVgxXnhML9Xgt5vHnTXmSSnDhupuCFBgsEAEpchXmQ==", "dev": true }, "eslint-plugin-chai-friendly": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-chai-friendly/-/eslint-plugin-chai-friendly-0.4.1.tgz", - "integrity": "sha512-hkpLN7VVoGGsofZjUhcQ+sufC3FgqMJwD0DvAcRfxY1tVRyQyVsqpaKnToPHJQOrRo0FQ0fSEDwW2gr4rsNdGA==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-chai-friendly/-/eslint-plugin-chai-friendly-0.6.0.tgz", + "integrity": "sha512-Uvvv1gkbRGp/qfN15B0kQyQWg+oFA8buDSqrwmW3egNSk/FpqH2MjQqKOuKwmEL6w4QIQrIjDp+gg6kGGmD3oQ==", "dev": true }, - "eslint-plugin-import": { - "version": "2.18.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.18.2.tgz", - "integrity": "sha512-5ohpsHAiUBRNaBWAF08izwUGlbrJoJJ+W9/TBwsGoR1MnlgfwMIKrFeSjWbt6moabiXW9xNvtFz+97KHRfI4HQ==", + "eslint-plugin-es": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz", + "integrity": "sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==", "dev": true, "requires": { - "array-includes": "^3.0.3", + "eslint-utils": "^2.0.0", + "regexpp": "^3.0.0" + }, + "dependencies": { + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + } + } + }, + "eslint-plugin-import": { + "version": "2.22.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.0.tgz", + "integrity": "sha512-66Fpf1Ln6aIS5Gr/55ts19eUuoDhAbZgnr6UxK5hbDx6l/QgQgx61AePq+BV4PP2uXQFClgMVzep5zZ94qqsxg==", + "dev": true, + "requires": { + "array-includes": "^3.1.1", + "array.prototype.flat": "^1.2.3", "contains-path": "^0.1.0", "debug": "^2.6.9", "doctrine": "1.5.0", - "eslint-import-resolver-node": "^0.3.2", - "eslint-module-utils": "^2.4.0", + "eslint-import-resolver-node": "^0.3.3", + "eslint-module-utils": "^2.6.0", "has": "^1.0.3", "minimatch": "^3.0.4", - "object.values": "^1.1.0", + "object.values": "^1.1.1", "read-pkg-up": "^2.0.0", - "resolve": "^1.11.0" + "resolve": "^1.17.0", + "tsconfig-paths": "^3.9.0" }, "dependencies": { "debug": { @@ -1084,40 +1140,80 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } } } }, "eslint-plugin-mocha": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-5.3.0.tgz", - "integrity": "sha512-3uwlJVLijjEmBeNyH60nzqgA1gacUWLUmcKV8PIGNvj1kwP/CTgAWQHn2ayyJVwziX+KETkr9opNwT1qD/RZ5A==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-7.0.1.tgz", + "integrity": "sha512-zkQRW9UigRaayGm/pK9TD5RjccKXSgQksNtpsXbG9b6L5I+jNx7m98VUbZ4w1H1ArlNA+K7IOH+z8TscN6sOYg==", "dev": true, "requires": { - "ramda": "^0.26.1" + "eslint-utils": "^2.0.0", + "ramda": "^0.27.0" + }, + "dependencies": { + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + } } }, "eslint-plugin-node": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-6.0.1.tgz", - "integrity": "sha512-Q/Cc2sW1OAISDS+Ji6lZS2KV4b7ueA/WydVWd1BECTQwVvfQy5JAi3glhINoKzoMnfnuRgNP+ZWKrGAbp3QDxw==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", + "integrity": "sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==", "dev": true, "requires": { - "ignore": "^3.3.6", + "eslint-plugin-es": "^3.0.0", + "eslint-utils": "^2.0.0", + "ignore": "^5.1.1", "minimatch": "^3.0.4", - "resolve": "^1.3.3", - "semver": "^5.4.1" + "resolve": "^1.10.1", + "semver": "^6.1.0" + }, + "dependencies": { + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, "eslint-plugin-promise": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.8.0.tgz", - "integrity": "sha512-JiFL9UFR15NKpHyGii1ZcvmtIqa3UTwiDAGb8atSffe43qJ3+1czVGN6UtkklpcJ2DVnqvTMzEKRaJdBkAL2aQ==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.2.1.tgz", + "integrity": "sha512-VoM09vT7bfA7D+upt+FjeBO5eHIJQBUWki1aPvB+vbNiHS3+oGIJGIeyBtKQTME6UPXXy3vV07OL1tHd3ANuDw==", "dev": true }, "eslint-plugin-standard": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-3.1.0.tgz", - "integrity": "sha512-fVcdyuKRr0EZ4fjWl3c+gp1BANFJD1+RaWa2UPYfMZ6jCtp5RG00kSaXnK/dE5sYzt4kaWJ9qdxqUfc0d9kX0w==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-4.0.1.tgz", + "integrity": "sha512-v/KBnfyaOMPmZc/dmc6ozOdWqekGp7bBGq4jLAecEfPGmfKiWS4sA8sC0LqiV9w5qmXAtXVn4M3p1jSyhY85SQ==", "dev": true }, "eslint-scope": { @@ -1480,9 +1576,9 @@ } }, "graceful-fs": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz", - "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", "dev": true }, "growl": { @@ -1535,9 +1631,9 @@ "dev": true }, "has-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", "dev": true }, "he": { @@ -1552,9 +1648,9 @@ "integrity": "sha512-Yu+q/XWr2fFQ11tHxPq4p4EiNkb2y+lAacJNhAdRXVfRIcDH6gi7htWFnnlIzvqHMHoWeIsfXlNAjZInpAOJDA==" }, "hosted-git-info": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz", - "integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==", + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", "dev": true }, "http-proxy-agent": { @@ -1600,9 +1696,9 @@ } }, "ignore": { - "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", "dev": true }, "import-fresh": { @@ -1735,15 +1831,15 @@ "dev": true }, "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", + "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==", "dev": true }, "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", "dev": true }, "is-extglob": { @@ -1773,12 +1869,12 @@ "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==" }, "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", + "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", "dev": true, "requires": { - "has": "^1.0.1" + "has-symbols": "^1.0.1" } }, "is-stream": { @@ -1791,13 +1887,19 @@ "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz", "integrity": "sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw==" }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, "is-symbol": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", - "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", "dev": true, "requires": { - "has-symbols": "^1.0.0" + "has-symbols": "^1.0.1" } }, "isarray": { @@ -1852,6 +1954,23 @@ "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + } + } + }, "just-extend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.0.2.tgz", @@ -2260,9 +2379,9 @@ } }, "object-inspect": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", - "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", + "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", "dev": true }, "object-keys": { @@ -2271,14 +2390,26 @@ "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, "object.values": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.0.tgz", - "integrity": "sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", + "integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==", "dev": true, "requires": { "define-properties": "^1.1.3", - "es-abstract": "^1.12.0", + "es-abstract": "^1.17.0-next.1", "function-bind": "^1.1.1", "has": "^1.0.3" } @@ -3135,9 +3266,9 @@ "dev": true }, "ramda": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.26.1.tgz", - "integrity": "sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ==", + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.27.0.tgz", + "integrity": "sha512-pVzZdDpWwWqEVVLshWUHjNwuVP7SfcmPraYuqocJp1yo2U1R7P+5QAfDhdItkuoGqIBnBYrtPp7rEPqDn9HlZA==", "dev": true }, "raven": { @@ -3417,9 +3548,9 @@ } }, "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", @@ -3427,15 +3558,15 @@ } }, "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", "dev": true }, "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "dev": true, "requires": { "spdx-exceptions": "^2.1.0", @@ -3494,24 +3625,24 @@ } } }, - "string.prototype.trimleft": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz", - "integrity": "sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw==", + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", "dev": true, "requires": { "define-properties": "^1.1.3", - "function-bind": "^1.1.1" + "es-abstract": "^1.17.5" } }, - "string.prototype.trimright": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz", - "integrity": "sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg==", + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", "dev": true, "requires": { "define-properties": "^1.1.3", - "function-bind": "^1.1.1" + "es-abstract": "^1.17.5" } }, "string_decoder": { @@ -3678,6 +3809,26 @@ "to-no-case": "^1.0.0" } }, + "tsconfig-paths": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", + "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + } + } + }, "tslib": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", diff --git a/libraries/logger/package.json b/libraries/logger/package.json index a6f233b781..ba55418dd1 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -22,17 +22,17 @@ "yn": "^3.1.1" }, "devDependencies": { - "chai": "4.2.0", + "chai": "^4.2.0", "eslint": "^6.6.0", - "eslint-config-prettier": "^3.1.0", - "eslint-config-standard": "^11.0.0", - "eslint-plugin-chai-expect": "^1.1.1", - "eslint-plugin-chai-friendly": "^0.4.1", - "eslint-plugin-import": "^2.9.0", - "eslint-plugin-mocha": "^5.2.0", - "eslint-plugin-node": "^6.0.0", - "eslint-plugin-promise": "^3.6.0", - "eslint-plugin-standard": "^3.0.1", + "eslint-config-prettier": "^6.11.0", + "eslint-config-standard": "^14.1.1", + "eslint-plugin-chai-expect": "^2.1.0", + "eslint-plugin-chai-friendly": "^0.6.0", + "eslint-plugin-import": "^2.22.0", + "eslint-plugin-mocha": "^7.0.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1", "mocha": "^5.2.0", "prettier": "^1.18.2", "prettier-eslint-cli": "^5.0.0", From d695a40a6166975a2e8ea0b127c5bd79a5df024c Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Thu, 2 Jul 2020 10:51:37 +0100 Subject: [PATCH 60/93] Lint --- libraries/logger/logging-manager.js | 8 ++++---- libraries/logger/test/unit/loggingManagerTests.js | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index e809e0e580..e722990128 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -22,9 +22,9 @@ const errSerializer = function(err) { const Logger = (module.exports = { initialize(name) { this.isProduction = - (process.env['NODE_ENV'] || '').toLowerCase() === 'production' + (process.env.NODE_ENV || '').toLowerCase() === 'production' this.defaultLevel = - process.env['LOG_LEVEL'] || (this.isProduction ? 'warn' : 'debug') + process.env.LOG_LEVEL || (this.isProduction ? 'warn' : 'debug') this.loggerName = name this.logger = bunyan.createLogger({ name, @@ -210,7 +210,7 @@ const Logger = (module.exports = { }, _setupRingBuffer() { - this.ringBufferSize = parseInt(process.env['LOG_RING_BUFFER_SIZE']) || 0 + this.ringBufferSize = parseInt(process.env.LOG_RING_BUFFER_SIZE) || 0 if (this.ringBufferSize > 0) { this.ringBuffer = new bunyan.RingBuffer({ limit: this.ringBufferSize }) this.logger.addStream({ @@ -224,7 +224,7 @@ const Logger = (module.exports = { }, _setupStackdriver() { - const stackdriverEnabled = yn(process.env['STACKDRIVER_LOGGING']) + const stackdriverEnabled = yn(process.env.STACKDRIVER_LOGGING) if (!stackdriverEnabled) { return } diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index f40163e5af..fccd1b53a0 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -376,14 +376,14 @@ describe('LoggingManager', function() { describe('when ring buffer size is positive', function() { beforeEach(function() { - process.env['LOG_RING_BUFFER_SIZE'] = '20' + process.env.LOG_RING_BUFFER_SIZE = '20' this.logger = this.LoggingManager.initialize(this.loggerName) this.logger.ringBuffer.records = this.logBufferMock this.logger.error({}, 'error') }) afterEach(function() { - process.env['LOG_RING_BUFFER_SIZE'] = undefined + process.env.LOG_RING_BUFFER_SIZE = undefined }) it('should include buffered logs in error log and filter out error logs in buffer', function() { @@ -396,13 +396,13 @@ describe('LoggingManager', function() { describe('when ring buffer size is zero', function() { beforeEach(function() { - process.env['LOG_RING_BUFFER_SIZE'] = '0' + process.env.LOG_RING_BUFFER_SIZE = '0' this.logger = this.LoggingManager.initialize(this.loggerName) this.logger.error({}, 'error') }) afterEach(function() { - process.env['LOG_RING_BUFFER_SIZE'] = undefined + process.env.LOG_RING_BUFFER_SIZE = undefined }) it('should not include buffered logs in error log', function() { @@ -414,7 +414,7 @@ describe('LoggingManager', function() { describe('stackdriver logging', function() { describe('when STACKDRIVER_LOGGING is unset', function() { beforeEach(function() { - process.env['STACKDRIVER_LOGGING'] = undefined + process.env.STACKDRIVER_LOGGING = undefined this.LoggingManager.initialize(this.loggerName) }) @@ -427,7 +427,7 @@ describe('LoggingManager', function() { describe('when STACKDRIVER_LOGGING is true', function() { beforeEach(function() { - process.env['STACKDRIVER_LOGGING'] = 'true' + process.env.STACKDRIVER_LOGGING = 'true' this.LoggingManager.initialize(this.loggerName) }) From edbf7220dfbfe5d37a680b84d7807ecd2ebe37b3 Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Thu, 2 Jul 2020 10:53:42 +0100 Subject: [PATCH 61/93] 2.1.1 --- libraries/logger/package-lock.json | 2 +- libraries/logger/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/logger/package-lock.json b/libraries/logger/package-lock.json index 1415c45165..24a3ca8374 100644 --- a/libraries/logger/package-lock.json +++ b/libraries/logger/package-lock.json @@ -1,6 +1,6 @@ { "name": "logger-sharelatex", - "version": "2.1.0", + "version": "2.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/libraries/logger/package.json b/libraries/logger/package.json index ba55418dd1..a9e7aeeb66 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -7,7 +7,7 @@ "url": "http://github.com/sharelatex/logger-sharelatex.git" }, "license": "AGPL-3.0-only", - "version": "2.1.0", + "version": "2.1.1", "scripts": { "test": "mocha test/**/*.js", "format": "prettier-eslint '**/*.js' --list-different", From 4c8d29af5940fb9cfa61c9d14f519cbbf32ed1dd Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Thu, 2 Jul 2020 11:00:28 +0100 Subject: [PATCH 62/93] Update mocha and prettier --- libraries/logger/package-lock.json | 458 ++++++++++++++++++++++++++--- libraries/logger/package.json | 4 +- 2 files changed, 413 insertions(+), 49 deletions(-) diff --git a/libraries/logger/package-lock.json b/libraries/logger/package-lock.json index 24a3ca8374..3890cf8c95 100644 --- a/libraries/logger/package-lock.json +++ b/libraries/logger/package-lock.json @@ -387,6 +387,12 @@ "uri-js": "^4.2.2" } }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, "ansi-escapes": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", @@ -419,6 +425,16 @@ "color-convert": "^1.9.0" } }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -455,6 +471,18 @@ "es-abstract": "^1.17.0-next.1" } }, + "array.prototype.map": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array.prototype.map/-/array.prototype.map-1.0.2.tgz", + "integrity": "sha512-Az3OYxgsa1g7xDYp86l0nnN4bcmuEITGe1rbdEBVkrqkzMgDcbdQ2R7r41pNzti+4NMces3H8gMmuioZUilLgw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "es-array-method-boxes-properly": "^1.0.0", + "is-string": "^1.0.4" + } + }, "arrify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", @@ -496,6 +524,12 @@ "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-7.2.1.tgz", "integrity": "sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==" }, + "binary-extensions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", + "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", + "dev": true + }, "boolify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/boolify/-/boolify-1.0.1.tgz", @@ -511,6 +545,15 @@ "concat-map": "0.0.1" } }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", @@ -593,6 +636,22 @@ "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", "dev": true }, + "chokidar": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.1.tgz", + "integrity": "sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg==", + "dev": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.3.0" + } + }, "cli-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", @@ -659,12 +718,6 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", - "dev": true - }, "common-tags": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.0.tgz", @@ -880,6 +933,35 @@ "string.prototype.trimstart": "^1.0.1" } }, + "es-array-method-boxes-properly": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", + "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", + "dev": true + }, + "es-get-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.0.tgz", + "integrity": "sha512-UfrmHuWQlNMTs35e1ypnvikg6jCz3SK8v8ImvmDsh36fCVUR1MqoFDiyn0/k52C8NqO3YsO8Oe0azeesNuqSsQ==", + "dev": true, + "requires": { + "es-abstract": "^1.17.4", + "has-symbols": "^1.0.1", + "is-arguments": "^1.0.4", + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-string": "^1.0.5", + "isarray": "^2.0.5" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } + } + }, "es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -1374,6 +1456,15 @@ "flat-cache": "^2.0.1" } }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, "find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", @@ -1383,6 +1474,15 @@ "locate-path": "^2.0.0" } }, + "flat": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", + "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", + "dev": true, + "requires": { + "is-buffer": "~2.0.3" + } + }, "flat-cache": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", @@ -1431,6 +1531,13 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, + "optional": true + }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -1637,9 +1744,9 @@ "dev": true }, "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, "hex2dec": { @@ -1824,12 +1931,33 @@ "resolved": "https://registry.npmjs.org/is/-/is-3.3.0.tgz", "integrity": "sha512-nW24QBoPcFGGHJGUwnfpI7Yc5CdqWNdsyHQszVE/z2pKHXzh7FZ5GWhJqSyaQ9wMkQnsTx+kAI8bHlCX4tKdbg==" }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", + "dev": true + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-buffer": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", + "dev": true + }, "is-callable": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", @@ -1863,6 +1991,18 @@ "is-extglob": "^2.1.1" } }, + "is-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.1.tgz", + "integrity": "sha512-T/S49scO8plUiAOA2DBTBG3JHpn1yiw0kRp6dgiZ0v2/6twi5eiB0rHtHFH9ZIrvlWc6+4O+m4zg5+Z833aXgw==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, "is-obj": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", @@ -1877,6 +2017,12 @@ "has-symbols": "^1.0.1" } }, + "is-set": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.1.tgz", + "integrity": "sha512-eJEzOtVyenDs1TMzSQ3kU3K+E0GUS9sno+F0OBT97xsgcJsF9nXMBtkT9/kut5JEpM7oL7X/0qxR17K3mcwIAA==", + "dev": true + }, "is-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", @@ -1913,6 +2059,22 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, + "iterate-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/iterate-iterator/-/iterate-iterator-1.0.1.tgz", + "integrity": "sha512-3Q6tudGN05kbkDQDI4CqjaBf4qf85w6W6GnuZDtUVYwKgtC1q8yxYX7CZed7N+tLzQqS6roujWvszf13T+n9aw==", + "dev": true + }, + "iterate-value": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/iterate-value/-/iterate-value-1.0.2.tgz", + "integrity": "sha512-A6fMAio4D2ot2r/TYzr4yUWrmwNdsN5xL7+HUiyACE4DXm+q8HtPcnFTp+NnW3k4N05tZ7FVYFFb2CR13NxyHQ==", + "dev": true, + "requires": { + "es-get-iterator": "^1.0.2", + "iterate-iterator": "^1.0.1" + } + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -2072,6 +2234,15 @@ "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==" }, + "log-symbols": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "dev": true, + "requires": { + "chalk": "^2.4.2" + } + }, "loglevel": { "version": "1.6.8", "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.6.8.tgz", @@ -2225,37 +2396,58 @@ } }, "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.0.1.tgz", + "integrity": "sha512-vefaXfdYI8+Yo8nPZQQi0QO2o+5q9UIMX1jZ1XMmK3+4+CQjc7+B0hPdUeglXiTlr8IHMVRo63IhO9Mzt6fxOg==", "dev": true, "requires": { + "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", - "diff": "3.5.0", + "chokidar": "3.3.1", + "debug": "3.2.6", + "diff": "4.0.2", "escape-string-regexp": "1.0.5", - "glob": "7.1.2", + "find-up": "4.1.0", + "glob": "7.1.6", "growl": "1.10.5", - "he": "1.1.1", + "he": "1.2.0", + "js-yaml": "3.13.1", + "log-symbols": "3.0.0", "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" + "ms": "2.1.2", + "object.assign": "4.1.0", + "promise.allsettled": "1.0.2", + "serialize-javascript": "3.0.0", + "strip-json-comments": "3.0.1", + "supports-color": "7.1.0", + "which": "2.0.2", + "wide-align": "1.1.3", + "workerpool": "6.0.0", + "yargs": "13.3.2", + "yargs-parser": "13.1.2", + "yargs-unparser": "1.6.0" }, "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "requires": { - "ms": "2.0.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" } }, "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -2266,19 +2458,83 @@ "path-is-absolute": "^1.0.0" } }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "strip-json-comments": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", + "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", "dev": true }, "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" } } } @@ -2378,6 +2634,12 @@ "validate-npm-package-license": "^3.0.1" } }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, "object-inspect": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", @@ -2562,6 +2824,12 @@ "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", "dev": true }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", @@ -2584,9 +2852,9 @@ "dev": true }, "prettier": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz", - "integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz", + "integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==", "dev": true }, "prettier-eslint": { @@ -2805,6 +3073,12 @@ "mimic-fn": "^1.0.0" } }, + "prettier": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", + "dev": true + }, "restore-cursor": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", @@ -3015,12 +3289,6 @@ "path-is-absolute": "^1.0.0" } }, - "ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", - "dev": true - }, "inquirer": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", @@ -3191,6 +3459,19 @@ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, + "promise.allsettled": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.2.tgz", + "integrity": "sha512-UpcYW5S1RaNKT6pd+s9jp9K9rlQge1UXKskec0j6Mmuq7UJCvlS2J2/s/yuPN8ehftf9HXMxWlKiPbGGUzpoRg==", + "dev": true, + "requires": { + "array.prototype.map": "^1.0.1", + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "iterate-value": "^1.0.0" + } + }, "protobufjs": { "version": "6.8.8", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.8.tgz", @@ -3325,6 +3606,15 @@ } } }, + "readdirp": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.3.0.tgz", + "integrity": "sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ==", + "dev": true, + "requires": { + "picomatch": "^2.0.7" + } + }, "regexpp": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", @@ -3455,6 +3745,12 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" }, + "serialize-javascript": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.0.0.tgz", + "integrity": "sha512-skZcHYw2vEX4bw90nAr2iTTsz6x2SrHEnfxgKYmZlvJYBEZrvbKtobJWlQ20zczKb3bsHHXXTYt48zBA7ni9cw==", + "dev": true + }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -3793,6 +4089,15 @@ "resolved": "https://registry.npmjs.org/to-no-case/-/to-no-case-1.0.2.tgz", "integrity": "sha1-xyKQcWTvaxeBMsjmmTAhLRtKoWo=" }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, "to-snake-case": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/to-snake-case/-/to-snake-case-1.0.0.tgz", @@ -3856,9 +4161,9 @@ "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" }, "typescript": { - "version": "3.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.5.tgz", - "integrity": "sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ==", + "version": "3.9.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.6.tgz", + "integrity": "sha512-Pspx3oKAPJtjNwE92YS05HQoY7z2SFyOpHo9MqJor3BXAGNaPUs83CuVp9VISFkSjyRfiTpmKuAYGJB7S7hOxw==", "dev": true }, "uri-js": { @@ -3975,12 +4280,60 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "requires": { + "string-width": "^1.0.2 || 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 + }, + "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 + }, + "string-width": { + "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", + "strip-ansi": "^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" + } + } + } + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, + "workerpool": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.0.tgz", + "integrity": "sha512-fU2OcNA/GVAJLLyKUoHkAgIhKb0JoCpSjLC/G2vYKxUjVmQwGbRVeoPJ1a8U4pnVofz4AQV5Y/NEw8oKqxEBtA==", + "dev": true + }, "wrap-ansi": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", @@ -4133,6 +4486,17 @@ "decamelize": "^1.2.0" } }, + "yargs-unparser": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", + "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", + "dev": true, + "requires": { + "flat": "^4.1.0", + "lodash": "^4.17.15", + "yargs": "^13.3.0" + } + }, "yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", diff --git a/libraries/logger/package.json b/libraries/logger/package.json index a9e7aeeb66..d6e92b9d56 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -33,8 +33,8 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", - "mocha": "^5.2.0", - "prettier": "^1.18.2", + "mocha": "^8.0.1", + "prettier": "^2.0.5", "prettier-eslint-cli": "^5.0.0", "sandboxed-module": "2.0.3", "sinon": "7.2.3", From fcd4a606576dad31188de8dd791b0803f0d357fe Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Thu, 2 Jul 2020 11:01:23 +0100 Subject: [PATCH 63/93] Make prettier --- libraries/logger/logging-manager.js | 10 +- .../logger/test/unit/loggingManagerTests.js | 150 +++++++++--------- 2 files changed, 80 insertions(+), 80 deletions(-) diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index e722990128..a54cf4f139 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -5,7 +5,7 @@ const OError = require('@overleaf/o-error') const GCPLogging = require('@google-cloud/logging-bunyan') // bunyan error serializer -const errSerializer = function(err) { +const errSerializer = function (err) { if (!err || !err.stack) { return err } @@ -154,7 +154,7 @@ const Logger = (module.exports = { error(attributes, message, ...args) { if (this.ringBuffer !== null && Array.isArray(this.ringBuffer.records)) { - attributes.logBuffer = this.ringBuffer.records.filter(function(record) { + attributes.logBuffer = this.ringBuffer.records.filter(function (record) { return record.level !== 50 }) } @@ -192,14 +192,14 @@ const Logger = (module.exports = { fatal(attributes, message, callback) { if (callback == null) { - callback = function() {} + callback = function () {} } this.logger.fatal(attributes, message) if (this.raven != null) { - var cb = function(e) { + var cb = function (e) { // call the callback once after 'logged' or 'error' event callback() - return (cb = function() {}) + return (cb = function () {}) } this.captureException(attributes, message, 'fatal') this.raven.once('logged', cb) diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index fccd1b53a0..ba2e89ca49 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -11,8 +11,8 @@ const expect = chai.expect const modulePath = path.join(__dirname, '../../logging-manager.js') -describe('LoggingManager', function() { - beforeEach(function() { +describe('LoggingManager', function () { + beforeEach(function () { this.start = Date.now() this.clock = sinon.useFakeTimers(this.start) this.captureException = sinon.stub() @@ -64,76 +64,76 @@ describe('LoggingManager', function() { this.logger.initializeErrorReporting('test_dsn') }) - afterEach(function() { + afterEach(function () { this.clock.restore() }) - describe('initialize', function() { - beforeEach(function() { + describe('initialize', function () { + beforeEach(function () { this.checkLogLevelStub = sinon.stub(this.LoggingManager, 'checkLogLevel') this.Bunyan.createLogger.reset() }) - afterEach(function() { + afterEach(function () { this.checkLogLevelStub.restore() }) - describe('not in production', function() { - beforeEach(function() { + describe('not in production', function () { + beforeEach(function () { this.logger = this.LoggingManager.initialize(this.loggerName) }) - it('should default to log level debug', function() { + it('should default to log level debug', function () { this.Bunyan.createLogger.firstCall.args[0].streams[0].level.should.equal( 'debug' ) }) - it('should not run checkLogLevel', function() { + it('should not run checkLogLevel', function () { this.checkLogLevelStub.should.not.have.been.called }) }) - describe('in production', function() { - beforeEach(function() { + describe('in production', function () { + beforeEach(function () { process.env.NODE_ENV = 'production' this.logger = this.LoggingManager.initialize(this.loggerName) }) afterEach(() => delete process.env.NODE_ENV) - it('should default to log level warn', function() { + it('should default to log level warn', function () { this.Bunyan.createLogger.firstCall.args[0].streams[0].level.should.equal( 'warn' ) }) - it('should run checkLogLevel', function() { + it('should run checkLogLevel', function () { this.checkLogLevelStub.should.have.been.calledOnce }) describe('after 1 minute', () => - it('should run checkLogLevel again', function() { + it('should run checkLogLevel again', function () { this.clock.tick(61 * 1000) this.checkLogLevelStub.should.have.been.calledTwice })) describe('after 2 minutes', () => - it('should run checkLogLevel again', function() { + it('should run checkLogLevel again', function () { this.clock.tick(121 * 1000) this.checkLogLevelStub.should.have.been.calledThrice })) }) - describe('when LOG_LEVEL set in env', function() { - beforeEach(function() { + describe('when LOG_LEVEL set in env', function () { + beforeEach(function () { process.env.LOG_LEVEL = 'trace' this.LoggingManager.initialize() }) afterEach(() => delete process.env.LOG_LEVEL) - it('should use custom log level', function() { + it('should use custom log level', function () { this.Bunyan.createLogger.firstCall.args[0].streams[0].level.should.equal( 'trace' ) @@ -141,61 +141,61 @@ describe('LoggingManager', function() { }) }) - describe('bunyan logging', function() { - beforeEach(function() { + describe('bunyan logging', function () { + beforeEach(function () { this.logArgs = [{ foo: 'bar' }, 'foo', 'bar'] }) - it('should log debug', function() { + it('should log debug', function () { this.logger.debug(this.logArgs) this.bunyanLogger.debug.should.have.been.calledWith(this.logArgs) }) - it('should log error', function() { + it('should log error', function () { this.logger.error(this.logArgs) this.bunyanLogger.error.should.have.been.calledWith(this.logArgs) }) - it('should log fatal', function() { + it('should log fatal', function () { this.logger.fatal(this.logArgs) this.bunyanLogger.fatal.should.have.been.calledWith(this.logArgs) }) - it('should log info', function() { + it('should log info', function () { this.logger.info(this.logArgs) this.bunyanLogger.info.should.have.been.calledWith(this.logArgs) }) - it('should log warn', function() { + it('should log warn', function () { this.logger.warn(this.logArgs) this.bunyanLogger.warn.should.have.been.calledWith(this.logArgs) }) - it('should log err', function() { + it('should log err', function () { this.logger.err(this.logArgs) this.bunyanLogger.error.should.have.been.calledWith(this.logArgs) }) - it('should log log', function() { + it('should log log', function () { this.logger.log(this.logArgs) this.bunyanLogger.info.should.have.been.calledWith(this.logArgs) }) }) - describe('logger.error', function() { - it('should report a single error to sentry', function() { + describe('logger.error', function () { + it('should report a single error to sentry', function () { this.logger.error({ foo: 'bar' }, 'message') this.captureException.called.should.equal(true) }) - it('should report the same error to sentry only once', function() { + it('should report the same error to sentry only once', function () { const error1 = new Error('this is the error') this.logger.error({ foo: error1 }, 'first message') this.logger.error({ bar: error1 }, 'second message') this.captureException.callCount.should.equal(1) }) - it('should report two different errors to sentry individually', function() { + it('should report two different errors to sentry individually', function () { const error1 = new Error('this is the error') const error2 = new Error('this is the error') this.logger.error({ foo: error1 }, 'first message') @@ -203,7 +203,7 @@ describe('LoggingManager', function() { this.captureException.callCount.should.equal(2) }) - it('should remove the path from fs errors', function() { + it('should remove the path from fs errors', function () { const fsError = new Error( "Error: ENOENT: no such file or directory, stat '/tmp/3279b8d0-da10-11e8-8255-efd98985942b'" ) @@ -219,7 +219,7 @@ describe('LoggingManager', function() { .should.equal(true) }) - it('for multiple errors should only report a maximum of 5 errors to sentry', function() { + it('for multiple errors should only report a maximum of 5 errors to sentry', function () { this.logger.error({ foo: 'bar' }, 'message') this.logger.error({ foo: 'bar' }, 'message') this.logger.error({ foo: 'bar' }, 'message') @@ -232,7 +232,7 @@ describe('LoggingManager', function() { this.captureException.callCount.should.equal(5) }) - it('for multiple errors with a minute delay should report 10 errors to sentry', function() { + it('for multiple errors with a minute delay should report 10 errors to sentry', function () { // the first five errors should be reported to sentry this.logger.error({ foo: 'bar' }, 'message') this.logger.error({ foo: 'bar' }, 'message') @@ -260,15 +260,15 @@ describe('LoggingManager', function() { this.captureException.callCount.should.equal(10) }) - describe('reportedToSentry', function() { - it('should mark the error as reported to sentry', function() { + describe('reportedToSentry', function () { + it('should mark the error as reported to sentry', function () { const err = new Error() this.logger.error({ err }, 'message') expect(this.captureException.called).to.equal(true) expect(err.reportedToSentry).to.equal(true) }) - it('should mark two errors as reported to sentry', function() { + it('should mark two errors as reported to sentry', function () { const err1 = new Error() const err2 = new Error() this.logger.error({ err: err1, err2 }, 'message') @@ -277,7 +277,7 @@ describe('LoggingManager', function() { expect(err2.reportedToSentry).to.equal(true) }) - it('should not mark arbitrary objects as reported to sentry', function() { + it('should not mark arbitrary objects as reported to sentry', function () { const err = new Error() const ctx = { foo: 'bar' } this.logger.error({ err, ctx }, 'message') @@ -287,76 +287,76 @@ describe('LoggingManager', function() { }) }) - describe('checkLogLevel', function() { - it('should request log level override from the config map', function() { + describe('checkLogLevel', function () { + it('should request log level override from the config map', function () { this.logger.checkLogLevel() this.Fs.readFile.should.have.been.calledWithMatch( '/logging/tracingEndTime' ) }) - describe('when read errors', function() { - beforeEach(function() { + describe('when read errors', function () { + beforeEach(function () { this.Fs.readFile.yields(new Error('error')) this.logger.checkLogLevel() }) - it('should only set default level', function() { + it('should only set default level', function () { this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( 'debug' ) }) }) - describe('when the file is empty', function() { - beforeEach(function() { + describe('when the file is empty', function () { + beforeEach(function () { this.Fs.readFile.yields(null, '') this.logger.checkLogLevel() }) - it('should only set default level', function() { + it('should only set default level', function () { this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( 'debug' ) }) }) - describe('when time value returned that is less than current time', function() { - beforeEach(function() { + describe('when time value returned that is less than current time', function () { + beforeEach(function () { this.Fs.readFile.yields(null, '1') this.logger.checkLogLevel() }) - it('should only set default level', function() { + it('should only set default level', function () { this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( 'debug' ) }) }) - describe('when time value returned that is more than current time', function() { - describe('when level is already set', function() { - beforeEach(function() { + describe('when time value returned that is more than current time', function () { + describe('when level is already set', function () { + beforeEach(function () { this.bunyanLogger.level.returns(10) this.Fs.readFile.yields(null, (this.start + 1000).toString()) this.logger.checkLogLevel() }) - it('should set trace level', function() { + it('should set trace level', function () { this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( 'trace' ) }) }) - describe('when level is not already set', function() { - beforeEach(function() { + describe('when level is not already set', function () { + beforeEach(function () { this.bunyanLogger.level.returns(20) this.Fs.readFile.yields(null, (this.start + 1000).toString()) this.logger.checkLogLevel() }) - it('should set trace level', function() { + it('should set trace level', function () { this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( 'trace' ) @@ -365,8 +365,8 @@ describe('LoggingManager', function() { }) }) - describe('ringbuffer', function() { - beforeEach(function() { + describe('ringbuffer', function () { + beforeEach(function () { this.logBufferMock = [ { msg: 'log 1' }, { msg: 'log 2' }, @@ -374,19 +374,19 @@ describe('LoggingManager', function() { ] }) - describe('when ring buffer size is positive', function() { - beforeEach(function() { + describe('when ring buffer size is positive', function () { + beforeEach(function () { process.env.LOG_RING_BUFFER_SIZE = '20' this.logger = this.LoggingManager.initialize(this.loggerName) this.logger.ringBuffer.records = this.logBufferMock this.logger.error({}, 'error') }) - afterEach(function() { + afterEach(function () { process.env.LOG_RING_BUFFER_SIZE = undefined }) - it('should include buffered logs in error log and filter out error logs in buffer', function() { + it('should include buffered logs in error log and filter out error logs in buffer', function () { this.bunyanLogger.error.lastCall.args[0].logBuffer.should.deep.equal([ { msg: 'log 1' }, { msg: 'log 2' } @@ -394,50 +394,50 @@ describe('LoggingManager', function() { }) }) - describe('when ring buffer size is zero', function() { - beforeEach(function() { + describe('when ring buffer size is zero', function () { + beforeEach(function () { process.env.LOG_RING_BUFFER_SIZE = '0' this.logger = this.LoggingManager.initialize(this.loggerName) this.logger.error({}, 'error') }) - afterEach(function() { + afterEach(function () { process.env.LOG_RING_BUFFER_SIZE = undefined }) - it('should not include buffered logs in error log', function() { + it('should not include buffered logs in error log', function () { expect(this.bunyanLogger.error.lastCall.args[0].logBuffer).be.undefined }) }) }) - describe('stackdriver logging', function() { - describe('when STACKDRIVER_LOGGING is unset', function() { - beforeEach(function() { + describe('stackdriver logging', function () { + describe('when STACKDRIVER_LOGGING is unset', function () { + beforeEach(function () { process.env.STACKDRIVER_LOGGING = undefined this.LoggingManager.initialize(this.loggerName) }) - it('is disabled', function() { + it('is disabled', function () { expect(this.bunyanLogger.addStream).not.to.have.been.calledWith( this.stackdriverStreamConfig ) }) }) - describe('when STACKDRIVER_LOGGING is true', function() { - beforeEach(function() { + describe('when STACKDRIVER_LOGGING is true', function () { + beforeEach(function () { process.env.STACKDRIVER_LOGGING = 'true' this.LoggingManager.initialize(this.loggerName) }) - it('is enabled', function() { + it('is enabled', function () { expect(this.bunyanLogger.addStream).to.have.been.calledWith( this.stackdriverStreamConfig ) }) - it('is configured properly', function() { + it('is configured properly', function () { expect(this.GCPLogging.LoggingBunyan).to.have.been.calledWith({ logName: this.loggerName, serviceContext: { service: this.loggerName } From bcaee67a5cbbfe64896417aa6b4173d3c50a0875 Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Thu, 2 Jul 2020 11:04:21 +0100 Subject: [PATCH 64/93] Bump sinon and sandboxed-module --- libraries/logger/package-lock.json | 135 +++++++++++++++-------------- libraries/logger/package.json | 6 +- 2 files changed, 71 insertions(+), 70 deletions(-) diff --git a/libraries/logger/package-lock.json b/libraries/logger/package-lock.json index 3890cf8c95..3ce5377d15 100644 --- a/libraries/logger/package-lock.json +++ b/libraries/logger/package-lock.json @@ -225,33 +225,42 @@ "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" }, "@sinonjs/commons": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.6.0.tgz", - "integrity": "sha512-w4/WHG7C4WWFyE5geCieFJF6MZkbW4VAriol5KlmQXpAQdxvV0p26sqNZOW6Qyw6Y0l9K4g+cHvvczR2sEEpqg==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.0.tgz", + "integrity": "sha512-wEj54PfsZ5jGSwMX68G8ZXFawcSglQSXqCftWX3ec8MDUzQdHgcKvw97awHbY0efQEL5iKUOAmmVtoYgmrSG4Q==", "dev": true, "requires": { "type-detect": "4.0.8" } }, + "@sinonjs/fake-timers": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", + "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.7.0" + } + }, "@sinonjs/formatio": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.2.2.tgz", - "integrity": "sha512-B8SEsgd8gArBLMD6zpRw3juQ2FVSsmdd7qlevyDqzS9WTCtvF55/gAL+h6gue8ZvPYcdiPdvueM/qm//9XzyTQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-5.0.1.tgz", + "integrity": "sha512-KaiQ5pBf1MpS09MuA0kp6KBQt2JUOQycqVG1NZXvzeaXe5LGFqAKueIS0bw4w0P9r7KuBSVdUk5QjXsUdu2CxQ==", "dev": true, "requires": { "@sinonjs/commons": "^1", - "@sinonjs/samsam": "^3.1.0" + "@sinonjs/samsam": "^5.0.2" } }, "@sinonjs/samsam": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.3.3.tgz", - "integrity": "sha512-bKCMKZvWIjYD0BLGnNrxVuw4dkWCYsLqFOUWw8VgKF/+5Y+mE7LfHWPIYoDXowH+3a9LsWDMo0uAP8YDosPvHQ==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-5.0.3.tgz", + "integrity": "sha512-QucHkc2uMJ0pFGjJUDP3F9dq5dx8QIaqISl9QgwLOh6P9yv877uONPGXh/OH/0zmM3tW1JjuJltAZV2l7zU+uQ==", "dev": true, "requires": { - "@sinonjs/commons": "^1.3.0", - "array-from": "^2.1.1", - "lodash": "^4.17.15" + "@sinonjs/commons": "^1.6.0", + "lodash.get": "^4.4.2", + "type-detect": "^4.0.8" } }, "@sinonjs/text-encoding": { @@ -444,12 +453,6 @@ "sprintf-js": "~1.0.2" } }, - "array-from": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", - "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", - "dev": true - }, "array-includes": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", @@ -817,9 +820,9 @@ } }, "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true }, "dlv": { @@ -2134,9 +2137,9 @@ } }, "just-extend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.0.2.tgz", - "integrity": "sha512-FrLwOgm+iXrPV+5zDU6Jqu4gCRXbWEQg2O3SKONsWE4w7AXFRkryS53bpWdaL9cNol+AmR3AEYz6kn+o0fCPnw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.1.0.tgz", + "integrity": "sha512-ApcjaOdVTJ7y4r08xI5wIqpvwS48Q0PBG4DJROcEkH1f8MdAiNFyFxz3xoL0LWAVwjrwPYZdVHHxhRHcx/uGLA==", "dev": true }, "jwa": { @@ -2206,6 +2209,12 @@ "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=" }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true + }, "lodash.has": { "version": "4.5.2", "resolved": "https://registry.npmjs.org/lodash.has/-/lodash.has-4.5.2.tgz", @@ -2301,12 +2310,6 @@ } } }, - "lolex": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-3.1.0.tgz", - "integrity": "sha512-zFo5MgCJ0rZ7gQg69S4pqBsLURbFw11X68C18OcJjJQbqaXm2NoTrGl1IMM3TIz0/BnN1tIs2tzmmqvCsOMMjw==", - "dev": true - }, "long": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", @@ -2592,24 +2595,16 @@ "dev": true }, "nise": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.2.tgz", - "integrity": "sha512-/6RhOUlicRCbE9s+94qCUsyE+pKlVJ5AhIv+jEE7ESKwnbXqulKZ1FYU+XAtHHWE9TinYvAxDUJAb912PwPoWA==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/nise/-/nise-4.0.4.tgz", + "integrity": "sha512-bTTRUNlemx6deJa+ZyoCUTRvH3liK5+N6VQZ4NIw90AgDXY6iPnsqplNFf6STcj+ePk0H/xqxnP75Lr0J0Fq3A==", "dev": true, "requires": { - "@sinonjs/formatio": "^3.2.1", + "@sinonjs/commons": "^1.7.0", + "@sinonjs/fake-timers": "^6.0.0", "@sinonjs/text-encoding": "^0.7.1", "just-extend": "^4.0.2", - "lolex": "^4.1.0", "path-to-regexp": "^1.7.0" - }, - "dependencies": { - "lolex": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.2.0.tgz", - "integrity": "sha512-gKO5uExCXvSm6zbF562EvM+rd1kQDnB9AZBbiQVzf1ZmdDpxUSvpnAaVOP83N/31mRK8Ml8/VE8DMvsAZQ+7wg==", - "dev": true - } } }, "node-fetch": { @@ -2793,9 +2788,9 @@ "dev": true }, "path-to-regexp": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", - "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", "dev": true, "requires": { "isarray": "0.0.1" @@ -3731,9 +3726,9 @@ "dev": true }, "sandboxed-module": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/sandboxed-module/-/sandboxed-module-2.0.3.tgz", - "integrity": "sha1-x+VFkzm7y6KMUwPusz9ug4e/upY=", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/sandboxed-module/-/sandboxed-module-2.0.4.tgz", + "integrity": "sha512-AwEPOdO8mg/wJjr876yCHP2DHqVN0MaggEXhp6IIf3bcI5cYoQl9QrrCHSrvToHjvdEiS5x4TVZRgjD2bEmNTA==", "dev": true, "requires": { "require-like": "0.1.2", @@ -3784,35 +3779,41 @@ "dev": true }, "sinon": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.2.3.tgz", - "integrity": "sha512-i6j7sqcLEqTYqUcMV327waI745VASvYuSuQMCjbAwlpAeuCgKZ3LtrjDxAbu+GjNQR0FEDpywtwGCIh8GicNyg==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.0.2.tgz", + "integrity": "sha512-0uF8Q/QHkizNUmbK3LRFqx5cpTttEVXudywY9Uwzy8bTfZUhljZ7ARzSxnRHWYWtVTeh4Cw+tTb3iU21FQVO9A==", "dev": true, "requires": { - "@sinonjs/commons": "^1.3.0", - "@sinonjs/formatio": "^3.1.0", - "@sinonjs/samsam": "^3.0.2", - "diff": "^3.5.0", - "lolex": "^3.0.0", - "nise": "^1.4.8", - "supports-color": "^5.5.0" + "@sinonjs/commons": "^1.7.2", + "@sinonjs/fake-timers": "^6.0.1", + "@sinonjs/formatio": "^5.0.1", + "@sinonjs/samsam": "^5.0.3", + "diff": "^4.0.2", + "nise": "^4.0.1", + "supports-color": "^7.1.0" }, "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" } } } }, "sinon-chai": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/sinon-chai/-/sinon-chai-3.3.0.tgz", - "integrity": "sha512-r2JhDY7gbbmh5z3Q62pNbrjxZdOAjpsqW/8yxAZRSqLZqowmfGZPGUZPFf3UX36NLis0cv8VEM5IJh9HgkSOAA==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/sinon-chai/-/sinon-chai-3.5.0.tgz", + "integrity": "sha512-IifbusYiQBpUxxFJkR3wTU68xzBN0+bxCScEaKMjBvAQERg6FnTTc1F17rseLb1tjmkJ23730AXpFI0c47FgAg==", "dev": true }, "slice-ansi": { diff --git a/libraries/logger/package.json b/libraries/logger/package.json index d6e92b9d56..bb60c0c387 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -36,8 +36,8 @@ "mocha": "^8.0.1", "prettier": "^2.0.5", "prettier-eslint-cli": "^5.0.0", - "sandboxed-module": "2.0.3", - "sinon": "7.2.3", - "sinon-chai": "3.3.0" + "sandboxed-module": "^2.0.4", + "sinon": "^9.0.2", + "sinon-chai": "^3.5.0" } } From db5084d30f50166d9a6f7a593f717ffc22f994eb Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Thu, 2 Jul 2020 11:08:10 +0100 Subject: [PATCH 65/93] Updrade runtime dependencies --- libraries/logger/package-lock.json | 599 ++++++++++++++++++----------- libraries/logger/package.json | 8 +- 2 files changed, 368 insertions(+), 239 deletions(-) diff --git a/libraries/logger/package-lock.json b/libraries/logger/package-lock.json index 3ce5377d15..a94909bac2 100644 --- a/libraries/logger/package-lock.json +++ b/libraries/logger/package-lock.json @@ -31,9 +31,9 @@ } }, "@google-cloud/common": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-2.2.3.tgz", - "integrity": "sha512-lvw54mGKn8VqVIy2NzAk0l5fntBFX4UwQhHk6HaqkyCQ7WBl5oz4XhzKMtMilozF/3ObPcDogqwuyEWyZ6rnQQ==", + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@google-cloud/common/-/common-2.4.0.tgz", + "integrity": "sha512-zWFjBS35eI9leAHhjfeOYlK5Plcuj/77EzstnrJIZbKgF/nkqjcQuGiMCpzCwOfPyUbz8ZaEOYgbHa759AKbjg==", "requires": { "@google-cloud/projectify": "^1.0.0", "@google-cloud/promisify": "^1.0.0", @@ -43,67 +43,103 @@ "extend": "^3.0.2", "google-auth-library": "^5.5.0", "retry-request": "^4.0.0", - "teeny-request": "^5.2.1" + "teeny-request": "^6.0.0" + }, + "dependencies": { + "google-auth-library": { + "version": "5.10.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.10.1.tgz", + "integrity": "sha512-rOlaok5vlpV9rSiUu5EpR0vVpc+PhN62oF4RyX/6++DG1VsaulAFEMlDYBLjJDDPI6OcNOCGAKy9UVB/3NIDXg==", + "requires": { + "arrify": "^2.0.0", + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "fast-text-encoding": "^1.0.0", + "gaxios": "^2.1.0", + "gcp-metadata": "^3.4.0", + "gtoken": "^4.1.0", + "jws": "^4.0.0", + "lru-cache": "^5.0.0" + } + } } }, "@google-cloud/logging": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/@google-cloud/logging/-/logging-5.5.3.tgz", - "integrity": "sha512-TZ/DzHod4icaC7wEEBm0PHYfbhvg0CbCVzKLsdAwj11xSD/egGNOsG5optEQcbAQEPrO1B5xBXfsE0wIBBYjpQ==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/@google-cloud/logging/-/logging-7.3.0.tgz", + "integrity": "sha512-xTW1V4MKpYC0mjSugyuiyUoZ9g6A42IhrrO3z7Tt3SmAb2IRj2Gf4RLoguKKncs340ooZFXrrVN/++t2Aj5zgg==", "requires": { "@google-cloud/common": "^2.2.2", "@google-cloud/paginator": "^2.0.0", "@google-cloud/projectify": "^1.0.0", "@google-cloud/promisify": "^1.0.0", - "@opencensus/propagation-stackdriver": "0.0.18", + "@opencensus/propagation-stackdriver": "0.0.20", "arrify": "^2.0.0", "dot-prop": "^5.1.0", - "eventid": "^0.1.2", + "eventid": "^1.0.0", "extend": "^3.0.2", "gcp-metadata": "^3.1.0", - "google-gax": "^1.7.5", + "google-auth-library": "^5.2.2", + "google-gax": "^1.11.0", "is": "^3.3.0", "on-finished": "^2.3.0", - "protobufjs": "^6.8.8", "pumpify": "^2.0.0", "snakecase-keys": "^3.0.0", "stream-events": "^1.0.4", "through2": "^3.0.0", - "type-fest": "^0.8.0" + "type-fest": "^0.12.0" + }, + "dependencies": { + "google-auth-library": { + "version": "5.10.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.10.1.tgz", + "integrity": "sha512-rOlaok5vlpV9rSiUu5EpR0vVpc+PhN62oF4RyX/6++DG1VsaulAFEMlDYBLjJDDPI6OcNOCGAKy9UVB/3NIDXg==", + "requires": { + "arrify": "^2.0.0", + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "fast-text-encoding": "^1.0.0", + "gaxios": "^2.1.0", + "gcp-metadata": "^3.4.0", + "gtoken": "^4.1.0", + "jws": "^4.0.0", + "lru-cache": "^5.0.0" + } + } } }, "@google-cloud/logging-bunyan": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@google-cloud/logging-bunyan/-/logging-bunyan-2.0.0.tgz", - "integrity": "sha512-9W9B8GQNMlBdQSV+c0492+sMMknn4/428EdSO1xv5Hn07P32N/e4T25y4Gnl9jlrItuZHIXRwYPVSHqUyGb1Zg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/logging-bunyan/-/logging-bunyan-3.0.0.tgz", + "integrity": "sha512-ZLVXEejNQ27ktGcA3S/sd7GPefp7kywbn+/KoBajdb1Syqcmtc98jhXpYQBXVtNP2065iyu77s4SBaiYFbTC5A==", "requires": { - "@google-cloud/logging": "^5.5.2", - "google-auth-library": "^5.0.0" + "@google-cloud/logging": "^7.0.0", + "google-auth-library": "^6.0.0" } }, "@google-cloud/paginator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-2.0.1.tgz", - "integrity": "sha512-HZ6UTGY/gHGNriD7OCikYWL/Eu0sTEur2qqse2w6OVsz+57se3nTkqH14JIPxtf0vlEJ8IJN5w3BdZ22pjCB8g==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@google-cloud/paginator/-/paginator-2.0.3.tgz", + "integrity": "sha512-kp/pkb2p/p0d8/SKUu4mOq8+HGwF8NPzHWkj+VKrIPQPyMRw8deZtrO/OcSiy9C/7bpfU5Txah5ltUNfPkgEXg==", "requires": { "arrify": "^2.0.0", "extend": "^3.0.2" } }, "@google-cloud/projectify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-1.0.1.tgz", - "integrity": "sha512-xknDOmsMgOYHksKc1GPbwDLsdej8aRNIA17SlSZgQdyrcC0lx0OGo4VZgYfwoEU1YS8oUxF9Y+6EzDOb0eB7Xg==" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@google-cloud/projectify/-/projectify-1.0.4.tgz", + "integrity": "sha512-ZdzQUN02eRsmTKfBj9FDL0KNDIFNjBn/d6tHQmA/+FImH5DO6ZV8E7FzxMgAUiVAUq41RFAkb25p1oHOZ8psfg==" }, "@google-cloud/promisify": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-1.0.2.tgz", - "integrity": "sha512-7WfV4R/3YV5T30WRZW0lqmvZy9hE2/p9MvpI34WuKa2Wz62mLu5XplGTFEMK6uTbJCLWUxTcZ4J4IyClKucE5g==" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-1.0.4.tgz", + "integrity": "sha512-VccZDcOql77obTnFh0TbNED/6ZbbmHDf8UMNnzO1d5g9V0Htfm4k5cllY8P1tJsRKC3zWYGRLaViiupcgVjBoQ==" }, "@grpc/grpc-js": { - "version": "0.6.9", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-0.6.9.tgz", - "integrity": "sha512-r1nDOEEiYmAsVYBaS4DPPqdwPOXPw7YhVOnnpPdWhlNtKbYzPash6DqWTTza9gBiYMA5d2Wiq6HzrPqsRaP4yA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.0.5.tgz", + "integrity": "sha512-Hm+xOiqAhcpT9RYM8lc15dbQD7aQurM7ZU8ulmulepiPlN7iwBXXwP3vSBUimoFoApRqz7pSIisXU8pZaCB4og==", "requires": { "semver": "^6.2.0" }, @@ -116,18 +152,18 @@ } }, "@grpc/proto-loader": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.5.2.tgz", - "integrity": "sha512-eBKD/FPxQoY1x6QONW2nBd54QUEyzcFP9FenujmoeDPy1rutVSHki1s/wR68F6O1QfCNDx+ayBH1O2CVNMzyyw==", + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.5.4.tgz", + "integrity": "sha512-HTM4QpI9B2XFkPz7pjwMyMgZchJ93TVkL3kWPW8GDMDKYxsMnmf4w2TNMJK7+KNiYHS5cJrCEAFlF+AwtXWVPA==", "requires": { "lodash.camelcase": "^4.3.0", "protobufjs": "^6.8.6" } }, "@opencensus/core": { - "version": "0.0.18", - "resolved": "https://registry.npmjs.org/@opencensus/core/-/core-0.0.18.tgz", - "integrity": "sha512-PgRQXLyb3bLi8Z6pQct9erYFRdnYAZNQXAEVPf6Xq6IMkZaH20wiOTNNPxEckjI31mq5utgstAbwOn4gJiPjBQ==", + "version": "0.0.20", + "resolved": "https://registry.npmjs.org/@opencensus/core/-/core-0.0.20.tgz", + "integrity": "sha512-vqOuTd2yuMpKohp8TNNGUAPjWEGjlnGfB9Rh5e3DKqeyR94YgierNs4LbMqxKtsnwB8Dm2yoEtRuUgoe5vD9DA==", "requires": { "continuation-local-storage": "^3.2.1", "log-driver": "^1.2.7", @@ -142,26 +178,26 @@ "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" }, "uuid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", - "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" } } }, "@opencensus/propagation-stackdriver": { - "version": "0.0.18", - "resolved": "https://registry.npmjs.org/@opencensus/propagation-stackdriver/-/propagation-stackdriver-0.0.18.tgz", - "integrity": "sha512-BLwfszIGAfqN2mqGf/atfEu84cWeoLM/YuXGfXDO1iDN2k5GXz4QFyhS8sz5l63HtsYuQqFuV+Ze7ZM0NvJp2A==", + "version": "0.0.20", + "resolved": "https://registry.npmjs.org/@opencensus/propagation-stackdriver/-/propagation-stackdriver-0.0.20.tgz", + "integrity": "sha512-P8yuHSLtce+yb+2EZjtTVqG7DQ48laC+IuOWi3X9q78s1Gni5F9+hmbmyP6Nb61jb5BEvXQX1s2rtRI6bayUWA==", "requires": { - "@opencensus/core": "^0.0.18", + "@opencensus/core": "^0.0.20", "hex2dec": "^1.0.1", "uuid": "^3.2.1" }, "dependencies": { "uuid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", - "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" } } }, @@ -269,6 +305,11 @@ "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", "dev": true }, + "@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==" + }, "@types/color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", @@ -281,6 +322,14 @@ "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", "dev": true }, + "@types/fs-extra": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.1.1.tgz", + "integrity": "sha512-TcUlBem321DFQzBNuz8p0CLLKp0VvF/XH9E4KHNmgwyp4E3AfgI5cjiIVZWlbfThBop2qxFIh4+LeY6hVWWZ2w==", + "requires": { + "@types/node": "*" + } + }, "@types/json-schema": { "version": "7.0.5", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.5.tgz", @@ -294,14 +343,14 @@ "dev": true }, "@types/long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz", - "integrity": "sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==" + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", + "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==" }, "@types/node": { - "version": "10.14.22", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.22.tgz", - "integrity": "sha512-9taxKC944BqoTVjE+UT3pQH0nHZlTvITwfsOZqyc+R3sfJuxaTtxWjfn1K2UlxyPcKHf0rnaXcVFrS9F9vf0bw==" + "version": "13.13.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.12.tgz", + "integrity": "sha512-zWz/8NEPxoXNT9YyF2osqyA9WjssZukYpgI4UYZpOjcyqwIUqWGkcCionaEb9Ki+FULyPyvNFpg/329Kd2/pbw==" }, "@typescript-eslint/experimental-utils": { "version": "1.13.0", @@ -377,11 +426,21 @@ "dev": true }, "agent-base": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", - "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.0.tgz", + "integrity": "sha512-j1Q7cSCqN+AwrmDd+pzgqc0/NpC655x2bUf5ZjRIO77DcNBFmh+OgRNzF6OKdCC9RSCb19fGd99+bhXFdkRNqw==", "requires": { - "es6-promisify": "^5.0.0" + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + } } }, "ajv": { @@ -523,9 +582,9 @@ "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" }, "bignumber.js": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-7.2.1.tgz", - "integrity": "sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==" + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz", + "integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A==" }, "binary-extensions": { "version": "2.1.0", @@ -569,12 +628,12 @@ "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" }, "bunyan": { - "version": "1.8.12", - "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.12.tgz", - "integrity": "sha1-8VDw9nSKvdcq6uhPBEA74u8RN5c=", + "version": "1.8.14", + "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.14.tgz", + "integrity": "sha512-LlahJUxXzZLuw/hetUQJmRgZ1LF6+cr5TPpRj6jf327AsiIq2jhYEH4oqUUkVKTor+9w2BT3oxVwhzE5lw9tcg==", "requires": { "dtrace-provider": "~0.8", - "moment": "^2.10.6", + "moment": "^2.19.3", "mv": "~2", "safe-json-stringify": "~1" } @@ -633,6 +692,11 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, + "charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=" + }, "check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", @@ -776,6 +840,11 @@ "which": "^1.2.9" } }, + "crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=" + }, "d64": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/d64/-/d64-1.0.0.tgz", @@ -785,6 +854,7 @@ "version": "3.2.6", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, "requires": { "ms": "^2.1.1" } @@ -841,9 +911,9 @@ } }, "dot-prop": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.1.1.tgz", - "integrity": "sha512-QCHI6Lkf+9fJMpwfAFsTvbiSh6ujoPmhCLiDvD/n4dGtLvHfhuBwPdN6z2x4YSOwwtTcLoO/LP70xELWGF/JVA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.2.0.tgz", + "integrity": "sha512-uEUyaDKoSQ1M4Oq8l45hSE26SnTxL6snNnqvK/VWx5wJhmff5z0FUVJDKDanor/6w3kzE3i7XZOk+7wC0EXr1A==", "requires": { "is-obj": "^2.0.0" } @@ -976,19 +1046,6 @@ "is-symbol": "^1.0.2" } }, - "es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" - }, - "es6-promisify": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", - "requires": { - "es6-promise": "^4.0.3" - } - }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -1387,18 +1444,18 @@ "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" }, "eventid": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/eventid/-/eventid-0.1.2.tgz", - "integrity": "sha1-CyMtPiROpbHVKJhBQOpprH7IkhU=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eventid/-/eventid-1.0.0.tgz", + "integrity": "sha512-4upSDsvpxhWPsmw4fsJCp0zj8S7I0qh1lCDTmZXP8V3TtryQKDI8CgQPN+e5JakbWwzaAX3lrdp2b3KSoMSUpw==", "requires": { "d64": "^1.0.0", "uuid": "^3.0.1" }, "dependencies": { "uuid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", - "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" } } }, @@ -1437,9 +1494,9 @@ "dev": true }, "fast-text-encoding": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.0.tgz", - "integrity": "sha512-R9bHCvweUxxwkDwhjav5vxpFvdPGlVngtqmx4pIZfSUhM/Q4NiIUHB456BAf+Q1Nwu3HEZYONtu+Rya+af4jiQ==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz", + "integrity": "sha512-dtm4QZH9nZtcDt8qJiOH9fcQd1NAgi+K1O2DbE6GG1PPCK/BWfOH3idCTRQ4ImXRUOyopDEgDEnVEE7Y/2Wrig==" }, "figures": { "version": "3.2.0", @@ -1554,23 +1611,23 @@ "dev": true }, "gaxios": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-2.1.0.tgz", - "integrity": "sha512-Gtpb5sdQmb82sgVkT2GnS2n+Kx4dlFwbeMYcDlD395aEvsLCSQXJJcHt7oJ2LrGxDEAeiOkK79Zv2A8Pzt6CFg==", + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-2.3.4.tgz", + "integrity": "sha512-US8UMj8C5pRnao3Zykc4AAVr+cffoNKRTg9Rsf2GiuZCW69vgJj38VK2PzlPuQU73FZ/nTk9/Av6/JGcE1N9vA==", "requires": { "abort-controller": "^3.0.0", "extend": "^3.0.2", - "https-proxy-agent": "^3.0.0", + "https-proxy-agent": "^5.0.0", "is-stream": "^2.0.0", "node-fetch": "^2.3.0" } }, "gcp-metadata": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-3.2.0.tgz", - "integrity": "sha512-ympv+yQ6k5QuWCuwQqnGEvFGS7MBKdcQdj1i188v3bW9QLFIchTGaBCEZxSQapT0jffdn1vdt8oJhB5VBWQO1Q==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-3.5.0.tgz", + "integrity": "sha512-ZQf+DLZ5aKcRpLzYUyBS3yo3N0JSa82lNDO8rj3nMSlovLcz2riKFBsYgDzeXcv75oo5eqB2lx+B14UvPoCRnA==", "requires": { - "gaxios": "^2.0.1", + "gaxios": "^2.1.0", "json-bigint": "^0.3.0" } }, @@ -1621,42 +1678,72 @@ "dev": true }, "google-auth-library": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.5.1.tgz", - "integrity": "sha512-zCtjQccWS/EHYyFdXRbfeSGM/gW+d7uMAcVnvXRnjBXON5ijo6s0nsObP0ifqileIDSbZjTlLtgo+UoN8IFJcg==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-6.0.2.tgz", + "integrity": "sha512-o/F/GiOPzDc49v5/6vfrEz3gRXvES49qGP84rrl3SO0efJA/M52hFwv2ozd1EC1TPrLj75Moj3iPgKGuGs6smA==", "requires": { "arrify": "^2.0.0", "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", "fast-text-encoding": "^1.0.0", - "gaxios": "^2.1.0", - "gcp-metadata": "^3.2.0", - "gtoken": "^4.1.0", - "jws": "^3.1.5", + "gaxios": "^3.0.0", + "gcp-metadata": "^4.1.0", + "gtoken": "^5.0.0", + "jws": "^4.0.0", "lru-cache": "^5.0.0" }, "dependencies": { - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "gaxios": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-3.0.3.tgz", + "integrity": "sha512-PkzQludeIFhd535/yucALT/Wxyj/y2zLyrMwPcJmnLHDugmV49NvAi/vb+VUq/eWztATZCNcb8ue+ywPG+oLuw==", "requires": { - "yallist": "^3.0.2" + "abort-controller": "^3.0.0", + "extend": "^3.0.2", + "https-proxy-agent": "^5.0.0", + "is-stream": "^2.0.0", + "node-fetch": "^2.3.0" } }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + "gcp-metadata": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-4.1.0.tgz", + "integrity": "sha512-r57SV28+olVsflPlKyVig3Muo/VDlcsObMtvDGOEtEJXj+DDE8bEl0coIkXh//hbkSDTvo+f5lbihZOndYXQQQ==", + "requires": { + "gaxios": "^3.0.0", + "json-bigint": "^0.3.0" + } + }, + "google-p12-pem": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-3.0.1.tgz", + "integrity": "sha512-VlQgtozgNVVVcYTXS36eQz4PXPt9gIPqLOhHN0QiV6W6h4qSCNVKPtKC5INtJsaHHF2r7+nOIa26MJeJMTaZEQ==", + "requires": { + "node-forge": "^0.9.0" + } + }, + "gtoken": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-5.0.1.tgz", + "integrity": "sha512-33w4FNDkUcyIOq/TqyC+drnKdI4PdXmWp9lZzssyEQKuvu9ZFN3KttaSnDKo52U3E51oujVGop93mKxmqO8HHg==", + "requires": { + "gaxios": "^3.0.0", + "google-p12-pem": "^3.0.0", + "jws": "^4.0.0", + "mime": "^2.2.0" + } } } }, "google-gax": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-1.7.5.tgz", - "integrity": "sha512-Tz2DFs8umzDcCBTi2W1cY4vEgAKaYRj70g6Hh/MiiZaJizrly7PgyxsIYUGi7sOpEuAbARQymYKvy5mNi8hEbg==", + "version": "1.15.3", + "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-1.15.3.tgz", + "integrity": "sha512-3JKJCRumNm3x2EksUTw4P1Rad43FTpqrtW9jzpf3xSMYXx+ogaqTM1vGo7VixHB4xkAyATXVIa3OcNSh8H9zsQ==", "requires": { - "@grpc/grpc-js": "0.6.9", + "@grpc/grpc-js": "~1.0.3", "@grpc/proto-loader": "^0.5.1", + "@types/fs-extra": "^8.0.1", + "@types/long": "^4.0.0", "abort-controller": "^3.0.0", "duplexify": "^3.6.0", "google-auth-library": "^5.0.0", @@ -1664,12 +1751,28 @@ "lodash.at": "^4.6.0", "lodash.has": "^4.5.2", "node-fetch": "^2.6.0", - "protobufjs": "^6.8.8", + "protobufjs": "^6.8.9", "retry-request": "^4.0.0", "semver": "^6.0.0", "walkdir": "^0.4.0" }, "dependencies": { + "google-auth-library": { + "version": "5.10.1", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-5.10.1.tgz", + "integrity": "sha512-rOlaok5vlpV9rSiUu5EpR0vVpc+PhN62oF4RyX/6++DG1VsaulAFEMlDYBLjJDDPI6OcNOCGAKy9UVB/3NIDXg==", + "requires": { + "arrify": "^2.0.0", + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "fast-text-encoding": "^1.0.0", + "gaxios": "^2.1.0", + "gcp-metadata": "^3.4.0", + "gtoken": "^4.1.0", + "jws": "^4.0.0", + "lru-cache": "^5.0.0" + } + }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -1678,9 +1781,9 @@ } }, "google-p12-pem": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-2.0.2.tgz", - "integrity": "sha512-UfnEARfJKI6pbmC1hfFFm+UAcZxeIwTiEcHfqKe/drMsXD/ilnVjF7zgOGpHXyhuvX6jNJK3S8A0hOQjwtFxEw==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-2.0.4.tgz", + "integrity": "sha512-S4blHBQWZRnEW44OcR7TL9WR+QCqByRvhNDZ/uuQfpxywfupikf/miba8js1jZi6ZOGv5slgSuoshCWh6EMDzg==", "requires": { "node-forge": "^0.9.0" } @@ -1698,13 +1801,13 @@ "dev": true }, "gtoken": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-4.1.0.tgz", - "integrity": "sha512-wqyn2gf5buzEZN4QNmmiiW2i2JkEdZnL7Z/9p44RtZqgt4077m4khRgAYNuu8cBwHWCc6MsP6eDUn/KkF6jFIw==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-4.1.4.tgz", + "integrity": "sha512-VxirzD0SWoFUo5p8RDP8Jt2AGyOmyYcT/pOUgDKJCK+iSw0TMqwrVfY37RXTNmoKwrzmDHSk0GMT9FsgVmnVSA==", "requires": { - "gaxios": "^2.0.0", + "gaxios": "^2.1.0", "google-p12-pem": "^2.0.0", - "jws": "^3.1.5", + "jws": "^4.0.0", "mime": "^2.2.0" } }, @@ -1764,36 +1867,42 @@ "dev": true }, "http-proxy-agent": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", - "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", "requires": { - "agent-base": "4", - "debug": "3.1.0" + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" }, "dependencies": { "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" } } }, "https-proxy-agent": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-3.0.1.tgz", - "integrity": "sha512-+ML2Rbh6DAuee7d07tYGEKOEi2voWPUGan+ExdPbPW6Z3svq+JCqr0v8WmKPOkz1vOVykPCBSuobe7G8GJUtVg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", "requires": { - "agent-base": "^4.3.0", - "debug": "^3.1.0" + "agent-base": "6", + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + } } }, "iconv-lite": { @@ -2095,11 +2204,11 @@ } }, "json-bigint": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-0.3.0.tgz", - "integrity": "sha1-DM2RLEuCcNBfBW+9E4FLU9OCWx4=", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-0.3.1.tgz", + "integrity": "sha512-DGWnSzmusIreWlEupsUelHrhwmPPE+FiQvg+drKfk2p+bdEYa5mp4PJ8JsCWqae0M2jQNb0HPvnwvf1qOTThzQ==", "requires": { - "bignumber.js": "^7.0.0" + "bignumber.js": "^9.0.0" } }, "json-schema-traverse": { @@ -2114,11 +2223,6 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" - }, "json5": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", @@ -2143,9 +2247,9 @@ "dev": true }, "jwa": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", - "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", "requires": { "buffer-equal-constant-time": "1.0.1", "ecdsa-sig-formatter": "1.0.11", @@ -2153,11 +2257,11 @@ } }, "jws": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", - "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", + "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", "requires": { - "jwa": "^1.4.1", + "jwa": "^2.0.0", "safe-buffer": "^5.0.1" } }, @@ -2315,10 +2419,13 @@ "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" }, - "lsmod": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lsmod/-/lsmod-1.0.0.tgz", - "integrity": "sha1-mgD3bco26yP6BTUK/htYXUKZ5ks=" + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "requires": { + "yallist": "^3.0.2" + } }, "make-plural": { "version": "4.3.0", @@ -2343,6 +2450,23 @@ "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==" }, + "md5": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/md5/-/md5-2.2.1.tgz", + "integrity": "sha1-U6s41f48iJG6RlMp6iP6wFQBJvk=", + "requires": { + "charenc": "~0.0.1", + "crypt": "~0.0.1", + "is-buffer": "~1.1.1" + }, + "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + } + } + }, "messageformat": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/messageformat/-/messageformat-2.3.0.tgz", @@ -2367,9 +2491,9 @@ "dev": true }, "mime": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", - "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==" + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz", + "integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA==" }, "mimic-fn": { "version": "2.1.0", @@ -2543,9 +2667,9 @@ } }, "moment": { - "version": "2.24.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", - "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==", + "version": "2.27.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.27.0.tgz", + "integrity": "sha512-al0MUK7cpIcglMv3YF13qSgdAIqxHTO7brRtaz3DlSULbqfazqkc5kEjNrLDOM7fsjshoFIihnU8snrP7zUvhQ==", "optional": true }, "ms": { @@ -2571,9 +2695,9 @@ } }, "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", + "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", "optional": true }, "natural-compare": { @@ -3468,9 +3592,9 @@ } }, "protobufjs": { - "version": "6.8.8", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.8.tgz", - "integrity": "sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.9.0.tgz", + "integrity": "sha512-LlGVfEWDXoI/STstRDdZZKb/qusoAWUnmLg9R8OLSO473mBLWHowx8clbX5/+mKDEI+v7GzjoK9tRPZMMcoTrg==", "requires": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -3482,8 +3606,8 @@ "@protobufjs/path": "^1.1.2", "@protobufjs/pool": "^1.1.0", "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.0", - "@types/node": "^10.1.0", + "@types/long": "^4.0.1", + "@types/node": "^13.7.0", "long": "^4.0.0" } }, @@ -3518,9 +3642,9 @@ } }, "readable-stream": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", - "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -3548,15 +3672,22 @@ "dev": true }, "raven": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/raven/-/raven-1.1.3.tgz", - "integrity": "sha1-QnPBrm005CMPUbLAEEGjK5Iygio=", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/raven/-/raven-2.6.4.tgz", + "integrity": "sha512-6PQdfC4+DQSFncowthLf+B6Hr0JpPsFBgTVYTAOq7tCmx/kR4SXbeawtPch20+3QfUcQDoJBLjWW1ybvZ4kXTw==", "requires": { "cookie": "0.3.1", - "json-stringify-safe": "5.0.1", - "lsmod": "1.0.0", - "stack-trace": "0.0.9", - "uuid": "3.0.0" + "md5": "^2.2.1", + "stack-trace": "0.0.10", + "timed-out": "4.0.1", + "uuid": "3.3.2" + }, + "dependencies": { + "stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=" + } } }, "read-pkg": { @@ -3581,9 +3712,9 @@ } }, "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -3592,13 +3723,6 @@ "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } } }, "readdirp": { @@ -3709,9 +3833,9 @@ } }, "safe-buffer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "safe-json-stringify": { "version": "1.2.0", @@ -3836,9 +3960,9 @@ } }, "snakecase-keys": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/snakecase-keys/-/snakecase-keys-3.1.0.tgz", - "integrity": "sha512-QM038drLbhdOY5HcRQVjO1ZJ1WR7yV5D5TIBzcOB/g3f5HURHhfpYEnvOyzXet8K+MQsgeIUA7O7vn90nAX6EA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/snakecase-keys/-/snakecase-keys-3.2.0.tgz", + "integrity": "sha512-WTJ0NhCH/37J+PU3fuz0x5b6TvtWQChTcKPOndWoUy0pteKOe0hrHMzSRsJOWSIP48EQkzUEsgQPmrG3W8pFNQ==", "requires": { "map-obj": "^4.0.0", "to-snake-case": "^1.0.0" @@ -3885,7 +4009,8 @@ "stack-trace": { "version": "0.0.9", "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.9.tgz", - "integrity": "sha1-qPbq7KkGdMMz58Q5U/J1tFFRBpU=" + "integrity": "sha1-qPbq7KkGdMMz58Q5U/J1tFFRBpU=", + "dev": true }, "stream-events": { "version": "1.0.5", @@ -3896,9 +4021,9 @@ } }, "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==" }, "string-width": { "version": "4.2.0", @@ -3948,13 +4073,6 @@ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "requires": { "safe-buffer": "~5.1.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } } }, "strip-ansi": { @@ -4038,21 +4156,21 @@ } }, "teeny-request": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-5.3.0.tgz", - "integrity": "sha512-sN9E3JvEBe2CFqB/jpJpw1erWD1C7MxyYCxogHFCQSyZfkHYcdf4wzVQSw7FZxbwcfnS+FP0W9BS0mp6SEOKjg==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-6.0.3.tgz", + "integrity": "sha512-TZG/dfd2r6yeji19es1cUIwAlVD8y+/svB1kAC2Y0bjEyysrfbO8EZvJBRwIE6WkwmUoB7uvWLwTIhJbMXZ1Dw==", "requires": { - "http-proxy-agent": "^2.1.0", - "https-proxy-agent": "^3.0.0", + "http-proxy-agent": "^4.0.0", + "https-proxy-agent": "^5.0.0", "node-fetch": "^2.2.0", "stream-events": "^1.0.5", - "uuid": "^3.3.2" + "uuid": "^7.0.0" }, "dependencies": { "uuid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", - "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz", + "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==" } } }, @@ -4069,13 +4187,19 @@ "dev": true }, "through2": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz", - "integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", + "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", "requires": { + "inherits": "^2.0.4", "readable-stream": "2 || 3" } }, + "timed-out": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", + "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=" + }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -4157,9 +4281,9 @@ "dev": true }, "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.12.0.tgz", + "integrity": "sha512-53RyidyjvkGpnWPMF9bQgFtWp+Sl8O2Rp13VavmJgfAP9WWG6q6TkrKU8iyJdnwnfgHI6k2hTlgqH4aSdjoTbg==" }, "typescript": { "version": "3.9.6", @@ -4182,9 +4306,9 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "uuid": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.0.0.tgz", - "integrity": "sha1-Zyj8BFnEUNeWqZwxg3VpvfZy1yg=" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" }, "v8-compile-cache": { "version": "2.1.1", @@ -4391,6 +4515,11 @@ "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + }, "yargs": { "version": "13.3.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", @@ -4499,9 +4628,9 @@ } }, "yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yn/-/yn-4.0.0.tgz", + "integrity": "sha512-huWiiCS4TxKc4SfgmTwW1K7JmXPPAmuXWYy4j9qjQo4+27Kni8mGhAAi1cloRWmBe2EqcLgt3IGqQoRL/MtPgg==" } } } diff --git a/libraries/logger/package.json b/libraries/logger/package.json index bb60c0c387..e2a6c28a4f 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -15,11 +15,11 @@ "lint": "eslint -f unix ." }, "dependencies": { - "@google-cloud/logging-bunyan": "^2.0.0", + "@google-cloud/logging-bunyan": "^3.0.0", "@overleaf/o-error": "^3.0.0", - "bunyan": "1.8.12", - "raven": "1.1.3", - "yn": "^3.1.1" + "bunyan": "^1.8.14", + "raven": "^2.6.4", + "yn": "^4.0.0" }, "devDependencies": { "chai": "^4.2.0", From 102c7524c9538ec8b943332e1f213db59dd717df Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Thu, 2 Jul 2020 11:12:07 +0100 Subject: [PATCH 66/93] Re-generate package-lock.json --- libraries/logger/package-lock.json | 412 ++++++++++++----------------- 1 file changed, 176 insertions(+), 236 deletions(-) diff --git a/libraries/logger/package-lock.json b/libraries/logger/package-lock.json index a94909bac2..1a42c26ded 100644 --- a/libraries/logger/package-lock.json +++ b/libraries/logger/package-lock.json @@ -5,27 +5,27 @@ "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.3.tgz", - "integrity": "sha512-fDx9eNW0qz0WkUeqL6tXEXzVlPh6Y5aCDEZesl0xBGA8ndRukX91Uk44ZqnkECp01NAZUdCAl+aiQNGi0k88Eg==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", "dev": true, "requires": { - "@babel/highlight": "^7.10.3" + "@babel/highlight": "^7.10.4" } }, "@babel/helper-validator-identifier": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.3.tgz", - "integrity": "sha512-bU8JvtlYpJSBPuj1VUmKpFGaDZuLxASky3LhaKj3bmpSTY6VWooSM8msk+Z0CZoErFye2tlABF6yDkT3FOPAXw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", "dev": true }, "@babel/highlight": { - "version": "7.10.3", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.3.tgz", - "integrity": "sha512-Ih9B/u7AtgEnySE2L2F0Xm0GaM729XqqLfHkalTsbjXGyqmf/6M0Cu0WpvqueUlW+xk88BHw9Nkpj49naU+vWw==", + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.10.3", + "@babel/helper-validator-identifier": "^7.10.4", "chalk": "^2.0.0", "js-tokens": "^4.0.0" } @@ -142,13 +142,6 @@ "integrity": "sha512-Hm+xOiqAhcpT9RYM8lc15dbQD7aQurM7ZU8ulmulepiPlN7iwBXXwP3vSBUimoFoApRqz7pSIisXU8pZaCB4og==", "requires": { "semver": "^6.2.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" - } } }, "@grpc/proto-loader": { @@ -172,11 +165,6 @@ "uuid": "^3.2.1" }, "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" - }, "uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", @@ -431,16 +419,6 @@ "integrity": "sha512-j1Q7cSCqN+AwrmDd+pzgqc0/NpC655x2bUf5ZjRIO77DcNBFmh+OgRNzF6OKdCC9RSCb19fGd99+bhXFdkRNqw==", "requires": { "debug": "4" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - } } }, "ajv": { @@ -569,6 +547,13 @@ "requires": { "semver": "^5.3.0", "shimmer": "^1.1.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } } }, "balanced-match": { @@ -729,9 +714,9 @@ } }, "cli-width": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", - "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", "dev": true }, "cliui": { @@ -838,6 +823,14 @@ "semver": "^5.5.0", "shebang-command": "^1.2.0", "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } } }, "crypt": { @@ -851,10 +844,9 @@ "integrity": "sha1-QAKofoUMv8n52XBrYPymE6MzbpA=" }, "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "requires": { "ms": "^2.1.1" } @@ -1053,9 +1045,9 @@ "dev": true }, "eslint": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.6.0.tgz", - "integrity": "sha512-PpEBq7b6qY/qrOmpYQ/jTMDYfuQMELR4g4WI1M/NaSDDD/bdcMb+dj4Hgks7p41kW2caXsPsEZAEAyAgjVVC0g==", + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", + "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -1073,7 +1065,7 @@ "file-entry-cache": "^5.0.1", "functional-red-black-tree": "^1.0.1", "glob-parent": "^5.0.0", - "globals": "^11.7.0", + "globals": "^12.1.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", @@ -1086,7 +1078,7 @@ "minimatch": "^3.0.4", "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "optionator": "^0.8.2", + "optionator": "^0.8.3", "progress": "^2.0.0", "regexpp": "^2.0.1", "semver": "^6.1.2", @@ -1095,29 +1087,6 @@ "table": "^5.2.3", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } } }, "eslint-config-prettier": { @@ -1159,15 +1128,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true - }, - "resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } } } }, @@ -1282,15 +1242,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true - }, - "resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } } } }, @@ -1338,10 +1289,10 @@ "eslint-visitor-keys": "^1.1.0" } }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", "dev": true } } @@ -1541,6 +1492,14 @@ "dev": true, "requires": { "is-buffer": "~2.0.3" + }, + "dependencies": { + "is-buffer": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", + "dev": true + } } }, "flat-cache": { @@ -1672,10 +1631,21 @@ } }, "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } + } }, "google-auth-library": { "version": "6.0.2", @@ -1772,11 +1742,6 @@ "jws": "^4.0.0", "lru-cache": "^5.0.0" } - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" } } }, @@ -1874,16 +1839,6 @@ "@tootallnate/once": "1", "agent-base": "6", "debug": "4" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - } } }, "https-proxy-agent": { @@ -1893,16 +1848,6 @@ "requires": { "agent-base": "6", "debug": "4" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - } } }, "iconv-lite": { @@ -1915,9 +1860,9 @@ } }, "ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, "import-fresh": { @@ -1957,21 +1902,21 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "inquirer": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.2.0.tgz", - "integrity": "sha512-E0c4rPwr9ByePfNlTIB8z51kK1s2n6jrHuJeEHENl/sbq2G/S1auvibgEwNR4uSyiU+PiYHqSwsgGiXjG8p5ZQ==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.0.tgz", + "integrity": "sha512-K+LZp6L/6eE5swqIcVXrxl21aGDU4S50gKH0/d96OMQnSBCyGyZl/oZhbkVmdp5sBoINHd4xZvFSARh2dk6DWA==", "dev": true, "requires": { "ansi-escapes": "^4.2.1", - "chalk": "^3.0.0", + "chalk": "^4.1.0", "cli-cursor": "^3.1.0", - "cli-width": "^2.0.0", + "cli-width": "^3.0.0", "external-editor": "^3.0.3", "figures": "^3.0.0", "lodash": "^4.17.15", "mute-stream": "0.0.8", "run-async": "^2.4.0", - "rxjs": "^6.5.3", + "rxjs": "^6.6.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0", "through": "^2.3.6" @@ -1988,9 +1933,9 @@ } }, "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -2065,10 +2010,9 @@ } }, "is-buffer": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", - "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", - "dev": true + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" }, "is-callable": { "version": "1.2.0", @@ -2230,14 +2174,6 @@ "dev": true, "requires": { "minimist": "^1.2.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - } } }, "just-extend": { @@ -2434,15 +2370,6 @@ "dev": true, "requires": { "minimist": "^1.2.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true, - "optional": true - } } }, "map-obj": { @@ -2458,13 +2385,6 @@ "charenc": "~0.0.1", "crypt": "~0.0.1", "is-buffer": "~1.1.1" - }, - "dependencies": { - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - } } }, "messageformat": { @@ -2510,16 +2430,16 @@ } }, "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "requires": { - "minimist": "0.0.8" + "minimist": "^1.2.5" } }, "mocha": { @@ -2555,11 +2475,14 @@ "yargs-unparser": "1.6.0" }, "dependencies": { - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } }, "find-up": { "version": "4.1.0", @@ -2751,6 +2674,14 @@ "resolve": "^1.10.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } } }, "normalize-path": { @@ -3024,14 +2955,11 @@ "restore-cursor": "^2.0.0" } }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } + "cli-width": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "dev": true }, "eslint": { "version": "5.16.0", @@ -3121,10 +3049,10 @@ "path-is-absolute": "^1.0.0" } }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, "inquirer": { @@ -3208,6 +3136,12 @@ "signal-exit": "^3.0.2" } }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -3287,14 +3221,11 @@ "restore-cursor": "^2.0.0" } }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } + "cli-width": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "dev": true }, "eslint": { "version": "5.16.0", @@ -3408,6 +3339,18 @@ "path-is-absolute": "^1.0.0" } }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "ignore": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "dev": true + }, "inquirer": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", @@ -3522,6 +3465,12 @@ "signal-exit": "^3.0.2" } }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -3683,10 +3632,10 @@ "uuid": "3.3.2" }, "dependencies": { - "stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=" + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" } } }, @@ -3765,9 +3714,9 @@ "dev": true }, "resolve": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", - "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -3796,16 +3745,6 @@ "requires": { "debug": "^4.1.1", "through2": "^3.0.1" - }, - "dependencies": { - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - } } }, "rimraf": { @@ -3824,9 +3763,9 @@ "dev": true }, "rxjs": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz", - "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.0.tgz", + "integrity": "sha512-3HMA8z/Oz61DUHe+SdOiQyzIf4tOx5oQHmMir7IZEu6TMqCLHT4LRcmNaUS0NwOz8VLvmmBduMsoaUvMaIiqzg==", "dev": true, "requires": { "tslib": "^1.9.0" @@ -3857,12 +3796,20 @@ "requires": { "require-like": "0.1.2", "stack-trace": "0.0.9" + }, + "dependencies": { + "stack-trace": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.9.tgz", + "integrity": "sha1-qPbq7KkGdMMz58Q5U/J1tFFRBpU=", + "dev": true + } } }, "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" }, "serialize-javascript": { "version": "3.0.0", @@ -4007,10 +3954,9 @@ "dev": true }, "stack-trace": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.9.tgz", - "integrity": "sha1-qPbq7KkGdMMz58Q5U/J1tFFRBpU=", - "dev": true + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=" }, "stream-events": { "version": "1.0.5", @@ -4165,13 +4111,6 @@ "node-fetch": "^2.2.0", "stream-events": "^1.0.5", "uuid": "^7.0.0" - }, - "dependencies": { - "uuid": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz", - "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==" - } } }, "text-table": { @@ -4249,14 +4188,6 @@ "json5": "^1.0.1", "minimist": "^1.2.0", "strip-bom": "^3.0.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - } } }, "tslib": { @@ -4306,9 +4237,9 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz", + "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==" }, "v8-compile-cache": { "version": "2.1.1", @@ -4363,6 +4294,15 @@ } } }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, "eslint-scope": { "version": "3.7.3", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz", From 97407980dbc18b7d6b0e77732fd393633d1d4840 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Thu, 2 Jul 2020 12:12:07 +0100 Subject: [PATCH 67/93] [misc] monkey patch prettier-eslint basepath --- libraries/logger/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/logger/package.json b/libraries/logger/package.json index e2a6c28a4f..64292544d3 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -10,8 +10,8 @@ "version": "2.1.1", "scripts": { "test": "mocha test/**/*.js", - "format": "prettier-eslint '**/*.js' --list-different", - "format:fix": "prettier-eslint '**/*.js' --write", + "format": "prettier-eslint $PWD'**/*.js' --list-different", + "format:fix": "prettier-eslint $PWD'**/*.js' --write", "lint": "eslint -f unix ." }, "dependencies": { From e61b1124bba84cb04444ab8e214a652a3e915c83 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Thu, 2 Jul 2020 12:15:22 +0100 Subject: [PATCH 68/93] [misc] bump eslint to 7.3.1 --- libraries/logger/package-lock.json | 412 ++++++++++++++--------------- libraries/logger/package.json | 2 +- 2 files changed, 202 insertions(+), 212 deletions(-) diff --git a/libraries/logger/package-lock.json b/libraries/logger/package-lock.json index 1a42c26ded..b0c374c317 100644 --- a/libraries/logger/package-lock.json +++ b/libraries/logger/package-lock.json @@ -439,23 +439,6 @@ "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true }, - "ansi-escapes": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", - "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", - "dev": true, - "requires": { - "type-fest": "^0.11.0" - }, - "dependencies": { - "type-fest": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", - "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", - "dev": true - } - } - }, "ansi-regex": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", @@ -704,21 +687,6 @@ "readdirp": "~3.3.0" } }, - "cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "dev": true, - "requires": { - "restore-cursor": "^3.1.0" - } - }, - "cli-width": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", - "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", - "dev": true - }, "cliui": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", @@ -951,12 +919,6 @@ "shimmer": "^1.2.0" } }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, "end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -965,6 +927,23 @@ "once": "^1.4.0" } }, + "enquirer": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.5.tgz", + "integrity": "sha512-BNT1C08P9XD0vNg3J475yIUG+mVdp9T6towYFHUv897X0KoHBjB1shyrNmhmtHWKP17iSWgo7Gqh7BBuzLZMSA==", + "dev": true, + "requires": { + "ansi-colors": "^3.2.1" + }, + "dependencies": { + "ansi-colors": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", + "integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==", + "dev": true + } + } + }, "ent": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", @@ -1045,22 +1024,23 @@ "dev": true }, "eslint": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", - "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.3.1.tgz", + "integrity": "sha512-cQC/xj9bhWUcyi/RuMbRtC3I0eW8MH0jhRELSvpKYkWep3C6YZ2OkvcvJVUeO6gcunABmzptbXBuDoXsjHmfTA==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", "ajv": "^6.10.0", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", "debug": "^4.0.1", "doctrine": "^3.0.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^1.4.3", - "eslint-visitor-keys": "^1.1.0", - "espree": "^6.1.2", - "esquery": "^1.0.1", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.0", + "eslint-utils": "^2.0.0", + "eslint-visitor-keys": "^1.2.0", + "espree": "^7.1.0", + "esquery": "^1.2.0", "esutils": "^2.0.2", "file-entry-cache": "^5.0.1", "functional-red-black-tree": "^1.0.1", @@ -1069,24 +1049,184 @@ "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^7.0.0", "is-glob": "^4.0.0", "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", + "levn": "^0.4.1", "lodash": "^4.17.14", "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "optionator": "^0.8.3", + "optionator": "^0.9.1", "progress": "^2.0.0", - "regexpp": "^2.0.1", - "semver": "^6.1.2", - "strip-ansi": "^5.2.0", - "strip-json-comments": "^3.0.1", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", "table": "^5.2.3", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } } }, "eslint-config-prettier": { @@ -1335,14 +1475,14 @@ "dev": true }, "espree": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", - "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.1.0.tgz", + "integrity": "sha512-dcorZSyfmm4WTuTnE5Y7MEN1DyoPYy1ZR783QW1FJoenn7RailyWFsq/UL6ZAAA7uXurN9FIpYyUs3OfiIW+Qw==", "dev": true, "requires": { - "acorn": "^7.1.1", + "acorn": "^7.2.0", "acorn-jsx": "^5.2.0", - "eslint-visitor-keys": "^1.1.0" + "eslint-visitor-keys": "^1.2.0" } }, "esprima": { @@ -1449,15 +1589,6 @@ "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz", "integrity": "sha512-dtm4QZH9nZtcDt8qJiOH9fcQd1NAgi+K1O2DbE6GG1PPCK/BWfOH3idCTRQ4ImXRUOyopDEgDEnVEE7Y/2Wrig==" }, - "figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, "file-entry-cache": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", @@ -1901,88 +2032,6 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "inquirer": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.0.tgz", - "integrity": "sha512-K+LZp6L/6eE5swqIcVXrxl21aGDU4S50gKH0/d96OMQnSBCyGyZl/oZhbkVmdp5sBoINHd4xZvFSARh2dk6DWA==", - "dev": true, - "requires": { - "ansi-escapes": "^4.2.1", - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-width": "^3.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.15", - "mute-stream": "0.0.8", - "run-async": "^2.4.0", - "rxjs": "^6.6.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0", - "through": "^2.3.6" - }, - "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", - "dev": true, - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "is": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/is/-/is-3.3.0.tgz", @@ -2032,12 +2081,6 @@ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, "is-glob": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", @@ -2415,12 +2458,6 @@ "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz", "integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA==" }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -2600,12 +2637,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, - "mute-stream": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", - "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", - "dev": true - }, "mv": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/mv/-/mv-2.1.1.tgz", @@ -2742,15 +2773,6 @@ "wrappy": "1" } }, - "onetime": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", - "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", - "dev": true, - "requires": { - "mimic-fn": "^2.1.0" - } - }, "optionator": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", @@ -3728,16 +3750,6 @@ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, - "restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "dev": true, - "requires": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - } - }, "retry-request": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-4.1.1.tgz", @@ -3971,28 +3983,6 @@ "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==" }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - } - } - }, "string.prototype.trimend": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 64292544d3..d6b370c559 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -23,7 +23,7 @@ }, "devDependencies": { "chai": "^4.2.0", - "eslint": "^6.6.0", + "eslint": "^7.3.1", "eslint-config-prettier": "^6.11.0", "eslint-config-standard": "^14.1.1", "eslint-plugin-chai-expect": "^2.1.0", From 98e4444585068ffbe95f382a2ed090da545ab317 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 18 Jul 2020 15:48:52 +0000 Subject: [PATCH 69/93] Bump lodash from 4.17.15 to 4.17.19 Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19) Signed-off-by: dependabot[bot] --- libraries/logger/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/logger/package-lock.json b/libraries/logger/package-lock.json index b0c374c317..3837260f94 100644 --- a/libraries/logger/package-lock.json +++ b/libraries/logger/package-lock.json @@ -2277,9 +2277,9 @@ } }, "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "version": "4.17.19", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", + "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", "dev": true }, "lodash.at": { From 50d28568413ff8e94cd81705dfcca1c967f0060a Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Fri, 3 Jul 2020 07:17:49 +0100 Subject: [PATCH 70/93] Re-instate metadata request as fallback for CLSI --- libraries/logger/logging-manager.js | 33 +- libraries/logger/package-lock.json | 291 +++++++++++++++++- libraries/logger/package.json | 1 + .../logger/test/unit/loggingManagerTests.js | 107 ++++++- 4 files changed, 418 insertions(+), 14 deletions(-) diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index a54cf4f139..c830d04378 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -1,4 +1,5 @@ const bunyan = require('bunyan') +const request = require('request') const fs = require('fs') const yn = require('yn') const OError = require('@overleaf/o-error') @@ -41,7 +42,7 @@ const Logger = (module.exports = { return this }, - checkLogLevel() { + checkLogLevelFile() { fs.readFile('/logging/tracingEndTime', (error, end) => { if (error || !end) { this.logger.level(this.defaultLevel) @@ -55,6 +56,36 @@ const Logger = (module.exports = { }) }, + checkLogLevelMetadata() { + const options = { + headers: { + 'Metadata-Flavor': 'Google' + }, + uri: `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` + } + request(options, (err, response, body) => { + if (err) { + this.logger.level(this.defaultLevel) + return + } + if (parseInt(body) > Date.now()) { + this.logger.level('trace') + } else { + this.logger.level(this.defaultLevel) + } + }) + }, + + checkLogLevel() { + fs.access('/logging', (err) => { + if (err) { + this.checkLogLevelMetadata() + } else { + this.checkLogLevelFile() + } + }) + }, + initializeErrorReporting(sentryDsn, options) { const raven = require('raven') this.raven = new raven.Client(sentryDsn, options) diff --git a/libraries/logger/package-lock.json b/libraries/logger/package-lock.json index 3837260f94..8248bcff61 100644 --- a/libraries/logger/package-lock.json +++ b/libraries/logger/package-lock.json @@ -425,7 +425,6 @@ "version": "6.12.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", - "dev": true, "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -511,6 +510,19 @@ "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==" }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, "assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -539,6 +551,21 @@ } } }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz", + "integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==" + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -549,6 +576,14 @@ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "requires": { + "tweetnacl": "^0.14.3" + } + }, "bignumber.js": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz", @@ -629,6 +664,11 @@ "quick-lru": "^4.0.1" } }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, "chai": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", @@ -738,6 +778,14 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, "common-tags": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.0.tgz", @@ -811,6 +859,14 @@ "resolved": "https://registry.npmjs.org/d64/-/d64-1.0.0.tgz", "integrity": "sha1-QAKofoUMv8n52XBrYPymE6MzbpA=" }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + } + }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -849,6 +905,11 @@ "object-keys": "^1.0.12" } }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, "diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", @@ -898,6 +959,15 @@ "stream-shift": "^1.0.0" } }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, "ecdsa-sig-formatter": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", @@ -1566,17 +1636,20 @@ "tmp": "^0.0.33" } }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, "fast-levenshtein": { "version": "2.0.6", @@ -1675,6 +1748,21 @@ "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", "dev": true }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -1739,6 +1827,14 @@ "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", "dev": true }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + } + }, "glob": { "version": "6.0.4", "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", @@ -1907,6 +2003,20 @@ "mime": "^2.2.0" } }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + } + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -1972,6 +2082,16 @@ "debug": "4" } }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, "https-proxy-agent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", @@ -2147,6 +2267,11 @@ "has-symbols": "^1.0.1" } }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -2158,6 +2283,11 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, "iterate-iterator": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/iterate-iterator/-/iterate-iterator-1.0.1.tgz", @@ -2190,6 +2320,11 @@ "esprima": "^4.0.0" } }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + }, "json-bigint": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-0.3.1.tgz", @@ -2198,11 +2333,15 @@ "bignumber.js": "^9.0.0" } }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -2210,6 +2349,11 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, "json5": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", @@ -2219,6 +2363,17 @@ "minimist": "^1.2.0" } }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, "just-extend": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.1.0.tgz", @@ -2458,6 +2613,19 @@ "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz", "integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA==" }, + "mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" + }, + "mime-types": { + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "requires": { + "mime-db": "1.44.0" + } + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -2721,6 +2889,11 @@ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + }, "object-inspect": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", @@ -2896,6 +3069,11 @@ "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", "dev": true }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, "picomatch": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", @@ -3582,6 +3760,11 @@ "long": "^4.0.0" } }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" + }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -3627,8 +3810,12 @@ "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, "quick-lru": { "version": "4.0.1", @@ -3711,6 +3898,40 @@ "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + } + } + }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -3797,8 +4018,7 @@ "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "sandboxed-module": { "version": "2.0.4", @@ -3965,6 +4185,22 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, "stack-trace": { "version": "0.0.10", "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", @@ -4168,6 +4404,15 @@ "to-no-case": "^1.0.0" } }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, "tsconfig-paths": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", @@ -4186,6 +4431,19 @@ "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", "dev": true }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -4216,7 +4474,6 @@ "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "dev": true, "requires": { "punycode": "^2.1.0" } @@ -4247,6 +4504,16 @@ "spdx-expression-parse": "^3.0.0" } }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, "vue-eslint-parser": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-2.0.3.tgz", diff --git a/libraries/logger/package.json b/libraries/logger/package.json index d6b370c559..9e1189b363 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -19,6 +19,7 @@ "@overleaf/o-error": "^3.0.0", "bunyan": "^1.8.14", "raven": "^2.6.4", + "request": "^2.88.2", "yn": "^4.0.0" }, "devDependencies": { diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index ba2e89ca49..b1a915f283 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -40,8 +40,10 @@ describe('LoggingManager', function () { this.Raven = { Client: sinon.stub().returns(this.ravenClient) } + this.Request = sinon.stub() this.Fs = { - readFile: sinon.stub() + readFile: sinon.stub(), + access: sinon.stub() } this.stackdriverStreamConfig = { stream: 'stackdriver' } this.stackdriverClient = { @@ -55,6 +57,7 @@ describe('LoggingManager', function () { requires: { bunyan: this.Bunyan, raven: this.Raven, + request: this.Request, fs: this.Fs, '@google-cloud/logging-bunyan': this.GCPLogging } @@ -288,8 +291,16 @@ describe('LoggingManager', function () { }) describe('checkLogLevel', function () { + beforeEach(function () { + this.Fs.access.yields(null) + }) + + it('should request log level override from the config map', function () { this.logger.checkLogLevel() + this.Fs.access.should.have.been.calledWithMatch( + '/logging' + ) this.Fs.readFile.should.have.been.calledWithMatch( '/logging/tracingEndTime' ) @@ -361,6 +372,100 @@ describe('LoggingManager', function () { 'trace' ) }) + }) + + describe('when /logging does not exist', function () { + beforeEach(function () { + this.Fs.access.yields(new Error) + }) + + describe('checkLogLevel', function() { + it('should request log level override from google meta data service', function() { + this.logger.checkLogLevel() + const options = { + headers: { + 'Metadata-Flavor': 'Google' + }, + uri: `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` + } + this.Request.should.have.been.calledWithMatch(options) + }) + + describe('when request has error', function() { + beforeEach(function() { + this.Request.yields('error') + this.logger.checkLogLevel() + }) + + it('should only set default level', function() { + this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( + 'debug' + ) + }) + }) + + describe('when statusCode is not 200', function() { + beforeEach(function() { + this.Request.yields(null, { statusCode: 404 }) + this.logger.checkLogLevel() + }) + + it('should only set default level', function() { + this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( + 'debug' + ) + }) + }) + + describe('when time value returned that is less than current time', function() { + beforeEach(function() { + this.Request.yields(null, { statusCode: 200 }, '1') + this.logger.checkLogLevel() + }) + + it('should only set default level', function() { + this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( + 'debug' + ) + }) + }) + + describe('when time value returned that is more than current time', function() { + describe('when level is already set', function() { + beforeEach(function() { + this.bunyanLogger.level.returns(10) + this.Request.yields(null, { statusCode: 200 }, this.start + 1000) + this.logger.checkLogLevel() + }) + + it('should set trace level', function() { + this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( + 'trace' + ) + }) + }) + + describe('when level is not already set', function() { + beforeEach(function() { + this.bunyanLogger.level.returns(20) + this.Request.yields(null, { statusCode: 200 }, this.start + 1000) + this.logger.checkLogLevel() + }) + + it('should set trace level', function() { + this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( + 'trace' + ) + }) + }) + }) + }) + + + + + + }) }) }) From 40a08bebdb8ac6135fcd875e7822d43b377e1ada Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Mon, 6 Jul 2020 14:53:49 +0100 Subject: [PATCH 71/93] WIP --- libraries/logger/logging-manager.js | 15 +- libraries/logger/package-lock.json | 291 +----------------- libraries/logger/package.json | 2 +- .../logger/test/unit/loggingManagerTests.js | 23 +- 4 files changed, 37 insertions(+), 294 deletions(-) diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index c830d04378..34bc08cd6d 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -1,5 +1,5 @@ const bunyan = require('bunyan') -const request = require('request') +const fetch = require('node-fetch') const fs = require('fs') const yn = require('yn') const OError = require('@overleaf/o-error') @@ -60,19 +60,18 @@ const Logger = (module.exports = { const options = { headers: { 'Metadata-Flavor': 'Google' - }, - uri: `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` - } - request(options, (err, response, body) => { - if (err) { - this.logger.level(this.defaultLevel) - return } + } + const uri = `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` + fetch.fetch(uri,options).then(res => res.text()).then(body => { if (parseInt(body) > Date.now()) { this.logger.level('trace') } else { this.logger.level(this.defaultLevel) } + }).catch(err => { + this.logger.level(this.defaultLevel) + return }) }, diff --git a/libraries/logger/package-lock.json b/libraries/logger/package-lock.json index 8248bcff61..3837260f94 100644 --- a/libraries/logger/package-lock.json +++ b/libraries/logger/package-lock.json @@ -425,6 +425,7 @@ "version": "6.12.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", + "dev": true, "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -510,19 +511,6 @@ "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==" }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - }, "assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -551,21 +539,6 @@ } } }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" - }, - "aws4": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz", - "integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==" - }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -576,14 +549,6 @@ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "requires": { - "tweetnacl": "^0.14.3" - } - }, "bignumber.js": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz", @@ -664,11 +629,6 @@ "quick-lru": "^4.0.1" } }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" - }, "chai": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", @@ -778,14 +738,6 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "requires": { - "delayed-stream": "~1.0.0" - } - }, "common-tags": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.0.tgz", @@ -859,14 +811,6 @@ "resolved": "https://registry.npmjs.org/d64/-/d64-1.0.0.tgz", "integrity": "sha1-QAKofoUMv8n52XBrYPymE6MzbpA=" }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "requires": { - "assert-plus": "^1.0.0" - } - }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -905,11 +849,6 @@ "object-keys": "^1.0.12" } }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, "diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", @@ -959,15 +898,6 @@ "stream-shift": "^1.0.0" } }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, "ecdsa-sig-formatter": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", @@ -1636,20 +1566,17 @@ "tmp": "^0.0.33" } }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" - }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true }, "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true }, "fast-levenshtein": { "version": "2.0.6", @@ -1748,21 +1675,6 @@ "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", "dev": true }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -1827,14 +1739,6 @@ "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", "dev": true }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "requires": { - "assert-plus": "^1.0.0" - } - }, "glob": { "version": "6.0.4", "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", @@ -2003,20 +1907,6 @@ "mime": "^2.2.0" } }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - } - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -2082,16 +1972,6 @@ "debug": "4" } }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, "https-proxy-agent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", @@ -2267,11 +2147,6 @@ "has-symbols": "^1.0.1" } }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -2283,11 +2158,6 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, "iterate-iterator": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/iterate-iterator/-/iterate-iterator-1.0.1.tgz", @@ -2320,11 +2190,6 @@ "esprima": "^4.0.0" } }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" - }, "json-bigint": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-0.3.1.tgz", @@ -2333,15 +2198,11 @@ "bignumber.js": "^9.0.0" } }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" - }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -2349,11 +2210,6 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" - }, "json5": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", @@ -2363,17 +2219,6 @@ "minimist": "^1.2.0" } }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, "just-extend": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.1.0.tgz", @@ -2613,19 +2458,6 @@ "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz", "integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA==" }, - "mime-db": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", - "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" - }, - "mime-types": { - "version": "2.1.27", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", - "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", - "requires": { - "mime-db": "1.44.0" - } - }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -2889,11 +2721,6 @@ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" - }, "object-inspect": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", @@ -3069,11 +2896,6 @@ "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", "dev": true }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" - }, "picomatch": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", @@ -3760,11 +3582,6 @@ "long": "^4.0.0" } }, - "psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" - }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -3810,12 +3627,8 @@ "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true }, "quick-lru": { "version": "4.0.1", @@ -3898,40 +3711,6 @@ "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, - "request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "dependencies": { - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" - } - } - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -4018,7 +3797,8 @@ "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true }, "sandboxed-module": { "version": "2.0.4", @@ -4185,22 +3965,6 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, "stack-trace": { "version": "0.0.10", "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", @@ -4404,15 +4168,6 @@ "to-no-case": "^1.0.0" } }, - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, "tsconfig-paths": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", @@ -4431,19 +4186,6 @@ "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", "dev": true }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" - }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -4474,6 +4216,7 @@ "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, "requires": { "punycode": "^2.1.0" } @@ -4504,16 +4247,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, "vue-eslint-parser": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-2.0.3.tgz", diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 9e1189b363..a94381f849 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -18,8 +18,8 @@ "@google-cloud/logging-bunyan": "^3.0.0", "@overleaf/o-error": "^3.0.0", "bunyan": "^1.8.14", + "node-fetch": "^2.6.0", "raven": "^2.6.4", - "request": "^2.88.2", "yn": "^4.0.0" }, "devDependencies": { diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index b1a915f283..3a143c3eed 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -29,6 +29,9 @@ describe('LoggingManager', function () { captureException: this.captureException, once: sinon.stub().yields() } + this.fetchResponse = { + text: sinon.stub().resolves('') + } this.Bunyan = { createLogger: sinon.stub().returns(this.bunyanLogger), RingBuffer: bunyan.RingBuffer, @@ -40,7 +43,9 @@ describe('LoggingManager', function () { this.Raven = { Client: sinon.stub().returns(this.ravenClient) } - this.Request = sinon.stub() + this.Fetch = { + fetch: sinon.stub().resolves(this.fetchResponse) + } this.Fs = { readFile: sinon.stub(), access: sinon.stub() @@ -57,7 +62,7 @@ describe('LoggingManager', function () { requires: { bunyan: this.Bunyan, raven: this.Raven, - request: this.Request, + 'node-fetch': this.Fetch, fs: this.Fs, '@google-cloud/logging-bunyan': this.GCPLogging } @@ -385,10 +390,10 @@ describe('LoggingManager', function () { const options = { headers: { 'Metadata-Flavor': 'Google' - }, - uri: `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` + } } - this.Request.should.have.been.calledWithMatch(options) + const uri = `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` + this.Fetch.fetch.should.have.been.calledWithMatch(uri,options) }) describe('when request has error', function() { @@ -448,7 +453,13 @@ describe('LoggingManager', function () { describe('when level is not already set', function() { beforeEach(function() { this.bunyanLogger.level.returns(20) - this.Request.yields(null, { statusCode: 200 }, this.start + 1000) + this.fetchResponse.text = sinon.stub().resolves(this.start + 1000) + this.Fetch.fetch = sinon.stub().resolves(this.fetchResponse) + //this.Request.yields(null, { statusCode: 200 }, this.start + 1000) + //this.fetchResponse = sinon.stub().resolves + + + //{data: this.start + 1000, status: 200} this.logger.checkLogLevel() }) From 14bac3922210f04e9d578800b5dce32b8782fcba Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Wed, 8 Jul 2020 11:22:54 +0100 Subject: [PATCH 72/93] Add MOCHA_GREP for testing --- libraries/logger/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/logger/package.json b/libraries/logger/package.json index a94381f849..f2947379a7 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -9,7 +9,7 @@ "license": "AGPL-3.0-only", "version": "2.1.1", "scripts": { - "test": "mocha test/**/*.js", + "test": "mocha --grep=$MOCHA_GREP test/**/*.js", "format": "prettier-eslint $PWD'**/*.js' --list-different", "format:fix": "prettier-eslint $PWD'**/*.js' --write", "lint": "eslint -f unix ." From 6b8dd86a26df28fe8db64f3e34af2ea317f885b8 Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Wed, 8 Jul 2020 11:24:56 +0100 Subject: [PATCH 73/93] WIP --- libraries/logger/logging-manager.js | 5 +++++ libraries/logger/test/unit/loggingManagerTests.js | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index 34bc08cd6d..7f61360d5f 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -64,12 +64,17 @@ const Logger = (module.exports = { } const uri = `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` fetch.fetch(uri,options).then(res => res.text()).then(body => { + console.log("About to parse Int", body) if (parseInt(body) > Date.now()) { + console.log("About to set logger level to trace") + console.log(this.logger) this.logger.level('trace') } else { + console.log("About to set logger level to default") this.logger.level(this.defaultLevel) } }).catch(err => { + console.log("ERROR: About to set logger level to default") this.logger.level(this.defaultLevel) return }) diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index 3a143c3eed..d822432028 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -30,7 +30,9 @@ describe('LoggingManager', function () { once: sinon.stub().yields() } this.fetchResponse = { - text: sinon.stub().resolves('') + text: sinon.stub().resolves(''), + status: 200, + ok: true } this.Bunyan = { createLogger: sinon.stub().returns(this.bunyanLogger), @@ -439,11 +441,14 @@ describe('LoggingManager', function () { describe('when level is already set', function() { beforeEach(function() { this.bunyanLogger.level.returns(10) - this.Request.yields(null, { statusCode: 200 }, this.start + 1000) + //this.Request.yields(null, { statusCode: 200 }, this.start + 1000) + console.log("In test ", this.start + 1000) + this.fetchResponse.text = sinon.stub().resolves(this.start + 1000) + this.Fetch.fetch = sinon.stub().resolves(this.fetchResponse) this.logger.checkLogLevel() }) - it('should set trace level', function() { + it.only('should set trace level', function() { this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( 'trace' ) From 6961f4148843693963c0a90907a7f6844cdf9419 Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Mon, 20 Jul 2020 16:57:43 +0100 Subject: [PATCH 74/93] Promisfy log level checks --- libraries/logger/logging-manager.js | 61 ++++++++++--------- .../logger/test/unit/loggingManagerTests.js | 20 +++--- 2 files changed, 44 insertions(+), 37 deletions(-) diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index 7f61360d5f..16c0154955 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -22,6 +22,7 @@ const errSerializer = function (err) { const Logger = (module.exports = { initialize(name) { + this.useMetadata = (process.env.USE_METADATA || '').toLowerCase() === 'true' this.isProduction = (process.env.NODE_ENV || '').toLowerCase() === 'production' this.defaultLevel = @@ -42,52 +43,54 @@ const Logger = (module.exports = { return this }, - checkLogLevelFile() { - fs.readFile('/logging/tracingEndTime', (error, end) => { - if (error || !end) { - this.logger.level(this.defaultLevel) - return - } - if (parseInt(end) > Date.now()) { + async checkLogLevelFile() { + try { + const end = await fs.promises.readFile('/logging/tracingEndTime') + if (!end) throw new Error("No end time found") + if (parseInt(end,10) > Date.now()) { this.logger.level('trace') } else { this.logger.level(this.defaultLevel) } - }) + } catch (err) { + this.logger.level(this.defaultLevel) + return + } }, - checkLogLevelMetadata() { +async checkLogLevelMetadata() { const options = { headers: { 'Metadata-Flavor': 'Google' } } const uri = `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` - fetch.fetch(uri,options).then(res => res.text()).then(body => { - console.log("About to parse Int", body) - if (parseInt(body) > Date.now()) { - console.log("About to set logger level to trace") - console.log(this.logger) - this.logger.level('trace') - } else { - console.log("About to set logger level to default") - this.logger.level(this.defaultLevel) - } - }).catch(err => { + try { + const res = await fetch(uri,options) + if (!res.ok) throw new Error("Metadata not okay") + const body = await res.text() + console.log("About to parse Int", body) + if (parseInt(body) > Date.now()) { + console.log("About to set logger level to trace") + console.log(this.logger) + this.logger.level('trace') + } else { + console.log("About to set logger level to default") + this.logger.level(this.defaultLevel) + } + } catch (err) { console.log("ERROR: About to set logger level to default") this.logger.level(this.defaultLevel) return - }) + } }, - checkLogLevel() { - fs.access('/logging', (err) => { - if (err) { - this.checkLogLevelMetadata() - } else { - this.checkLogLevelFile() - } - }) + async checkLogLevel() { + if (this.useMetadata) { + await this.checkLogLevelMetadata() + } else { + await this.checkLogLevelFile() + } }, initializeErrorReporting(sentryDsn, options) { diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index d822432028..505928a9cb 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -45,9 +45,7 @@ describe('LoggingManager', function () { this.Raven = { Client: sinon.stub().returns(this.ravenClient) } - this.Fetch = { - fetch: sinon.stub().resolves(this.fetchResponse) - } + this.Fetch = sinon.stub().resolves(this.fetchResponse) this.Fs = { readFile: sinon.stub(), access: sinon.stub() @@ -381,9 +379,14 @@ describe('LoggingManager', function () { }) }) - describe('when /logging does not exist', function () { + describe('when not running in GKE', function () { beforeEach(function () { - this.Fs.access.yields(new Error) + process.env.USE_METADATA = 'TRUE' + this.logger = this.LoggingManager.initialize(this.loggerName) + }) + + afterEach(function() { + process.env.USE_METADATA = undefined }) describe('checkLogLevel', function() { @@ -439,13 +442,14 @@ describe('LoggingManager', function () { describe('when time value returned that is more than current time', function() { describe('when level is already set', function() { - beforeEach(function() { + beforeEach(async function() { this.bunyanLogger.level.returns(10) //this.Request.yields(null, { statusCode: 200 }, this.start + 1000) console.log("In test ", this.start + 1000) this.fetchResponse.text = sinon.stub().resolves(this.start + 1000) - this.Fetch.fetch = sinon.stub().resolves(this.fetchResponse) - this.logger.checkLogLevel() + //this.Fetch = sinon.stub().resolves(this.fetchResponse) + + await this.logger.checkLogLevel() }) it.only('should set trace level', function() { From 02356c7f27b1cec8aa38c29bb133bd79d6af3abc Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Thu, 23 Jul 2020 17:03:55 +0100 Subject: [PATCH 75/93] All logging manager tests working --- .../logger/test/unit/loggingManagerTests.js | 69 ++++++++++--------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index 505928a9cb..39ab807fac 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -4,6 +4,8 @@ const chai = require('chai') const path = require('path') const sinon = require('sinon') const sinonChai = require('sinon-chai') +const { promises } = require('dns') +//const fetchMock = require('fetch-mock') chai.use(sinonChai) chai.should() @@ -48,7 +50,10 @@ describe('LoggingManager', function () { this.Fetch = sinon.stub().resolves(this.fetchResponse) this.Fs = { readFile: sinon.stub(), - access: sinon.stub() + access: sinon.stub(), + promises: { + readFile: sinon.stub() + } } this.stackdriverStreamConfig = { stream: 'stackdriver' } this.stackdriverClient = { @@ -296,24 +301,17 @@ describe('LoggingManager', function () { }) describe('checkLogLevel', function () { - beforeEach(function () { - this.Fs.access.yields(null) - }) - - it('should request log level override from the config map', function () { - this.logger.checkLogLevel() - this.Fs.access.should.have.been.calledWithMatch( - '/logging' - ) - this.Fs.readFile.should.have.been.calledWithMatch( + it('should request log level override from the config map', async function () { + await this.logger.checkLogLevel() + this.Fs.promises.readFile.should.have.been.calledWithMatch( '/logging/tracingEndTime' ) }) describe('when read errors', function () { beforeEach(function () { - this.Fs.readFile.yields(new Error('error')) + this.Fs.promises.readFile.yields(new Error('error')) this.logger.checkLogLevel() }) @@ -326,7 +324,7 @@ describe('LoggingManager', function () { describe('when the file is empty', function () { beforeEach(function () { - this.Fs.readFile.yields(null, '') + this.Fs.promises.readFile.yields(null, '') this.logger.checkLogLevel() }) @@ -339,7 +337,7 @@ describe('LoggingManager', function () { describe('when time value returned that is less than current time', function () { beforeEach(function () { - this.Fs.readFile.yields(null, '1') + this.Fs.promises.readFile.yields(null, '1') this.logger.checkLogLevel() }) @@ -352,10 +350,10 @@ describe('LoggingManager', function () { describe('when time value returned that is more than current time', function () { describe('when level is already set', function () { - beforeEach(function () { + beforeEach(async function () { this.bunyanLogger.level.returns(10) - this.Fs.readFile.yields(null, (this.start + 1000).toString()) - this.logger.checkLogLevel() + this.Fs.promises.readFile.returns((this.start + 1000).toString()) + await this.logger.checkLogLevel() }) it('should set trace level', function () { @@ -366,10 +364,10 @@ describe('LoggingManager', function () { }) describe('when level is not already set', function () { - beforeEach(function () { + beforeEach(async function () { this.bunyanLogger.level.returns(20) - this.Fs.readFile.yields(null, (this.start + 1000).toString()) - this.logger.checkLogLevel() + this.Fs.promises.readFile.returns((this.start + 1000).toString()) + await this.logger.checkLogLevel() }) it('should set trace level', function () { @@ -379,7 +377,7 @@ describe('LoggingManager', function () { }) }) - describe('when not running in GKE', function () { + describe('when using metadata', function () { beforeEach(function () { process.env.USE_METADATA = 'TRUE' this.logger = this.LoggingManager.initialize(this.loggerName) @@ -398,13 +396,14 @@ describe('LoggingManager', function () { } } const uri = `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` - this.Fetch.fetch.should.have.been.calledWithMatch(uri,options) + this.Fetch.should.have.been.calledWithMatch(uri,options) }) describe('when request has error', function() { - beforeEach(function() { - this.Request.yields('error') - this.logger.checkLogLevel() + beforeEach(async function() { + this.Fetch = sinon.stub().throws() + //this.Request.yields('error') + await this.logger.checkLogLevel() }) it('should only set default level', function() { @@ -415,9 +414,10 @@ describe('LoggingManager', function () { }) describe('when statusCode is not 200', function() { - beforeEach(function() { - this.Request.yields(null, { statusCode: 404 }) - this.logger.checkLogLevel() + beforeEach(async function() { + this.fetchResponse.status = 404 + //this.Request.yields(null, { statusCode: 404 }) + await this.logger.checkLogLevel() }) it('should only set default level', function() { @@ -428,9 +428,10 @@ describe('LoggingManager', function () { }) describe('when time value returned that is less than current time', function() { - beforeEach(function() { - this.Request.yields(null, { statusCode: 200 }, '1') - this.logger.checkLogLevel() + beforeEach(async function() { + //this.Request.yields(null, { statusCode: 200 }, '1') + this.fetchResponse.text = sinon.stub().resolves('1') + await this.logger.checkLogLevel() }) it('should only set default level', function() { @@ -452,7 +453,7 @@ describe('LoggingManager', function () { await this.logger.checkLogLevel() }) - it.only('should set trace level', function() { + it('should set trace level', function() { this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( 'trace' ) @@ -460,7 +461,7 @@ describe('LoggingManager', function () { }) describe('when level is not already set', function() { - beforeEach(function() { + beforeEach(async function() { this.bunyanLogger.level.returns(20) this.fetchResponse.text = sinon.stub().resolves(this.start + 1000) this.Fetch.fetch = sinon.stub().resolves(this.fetchResponse) @@ -469,7 +470,7 @@ describe('LoggingManager', function () { //{data: this.start + 1000, status: 200} - this.logger.checkLogLevel() + await this.logger.checkLogLevel() }) it('should set trace level', function() { From 0a15fedb34a6f561ff501781d9cd6c3e78f63730 Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Thu, 23 Jul 2020 17:10:09 +0100 Subject: [PATCH 76/93] Remove debug logs --- libraries/logger/logging-manager.js | 5 ----- libraries/logger/test/unit/loggingManagerTests.js | 1 - 2 files changed, 6 deletions(-) diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index 16c0154955..14e7cb2c35 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -69,17 +69,12 @@ async checkLogLevelMetadata() { const res = await fetch(uri,options) if (!res.ok) throw new Error("Metadata not okay") const body = await res.text() - console.log("About to parse Int", body) if (parseInt(body) > Date.now()) { - console.log("About to set logger level to trace") - console.log(this.logger) this.logger.level('trace') } else { - console.log("About to set logger level to default") this.logger.level(this.defaultLevel) } } catch (err) { - console.log("ERROR: About to set logger level to default") this.logger.level(this.defaultLevel) return } diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index 39ab807fac..f9532875ea 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -446,7 +446,6 @@ describe('LoggingManager', function () { beforeEach(async function() { this.bunyanLogger.level.returns(10) //this.Request.yields(null, { statusCode: 200 }, this.start + 1000) - console.log("In test ", this.start + 1000) this.fetchResponse.text = sinon.stub().resolves(this.start + 1000) //this.Fetch = sinon.stub().resolves(this.fetchResponse) From 6bc0d15d78ae4bff064656a50138a46c3f49b51d Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Fri, 24 Jul 2020 11:59:23 +0100 Subject: [PATCH 77/93] LOG_LEVEL_SOURCE env taking values file, gce_metadata or none, default file --- libraries/logger/logging-manager.js | 27 +- .../logger/test/unit/loggingManagerTests.js | 279 ++++++++++-------- 2 files changed, 170 insertions(+), 136 deletions(-) diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index 14e7cb2c35..4b384df0f1 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -22,7 +22,7 @@ const errSerializer = function (err) { const Logger = (module.exports = { initialize(name) { - this.useMetadata = (process.env.USE_METADATA || '').toLowerCase() === 'true' + this.logLevelSource = (process.env.LOG_LEVEL_SOURCE || 'file').toLowerCase() this.isProduction = (process.env.NODE_ENV || '').toLowerCase() === 'production' this.defaultLevel = @@ -80,14 +80,6 @@ async checkLogLevelMetadata() { } }, - async checkLogLevel() { - if (this.useMetadata) { - await this.checkLogLevelMetadata() - } else { - await this.checkLogLevelFile() - } - }, - initializeErrorReporting(sentryDsn, options) { const raven = require('raven') this.raven = new raven.Client(sentryDsn, options) @@ -274,10 +266,19 @@ async checkLogLevelMetadata() { if (this.checkInterval) { clearInterval(this.checkInterval) } - // check for log level override on startup - this.checkLogLevel() - // re-check log level every minute - this.checkInterval = setInterval(this.checkLogLevel.bind(this), 1000 * 60) + if (this.logLevelSource === 'file') { + // check for log level override on startup + this.checkLogLevelFile() + // re-check log level every minute + this.checkInterval = setInterval(this.checkLogLevelFile.bind(this), 1000 * 60) + } else if (this.logLevelSource === 'gce_metadata') { + // check for log level override on startup + this.checkLogLevelMetadata() + // re-check log level every minute + this.checkInterval = setInterval(this.checkLogLevelMetadata.bind(this), 1000 * 60) + } else if (this.logLevelSource !== 'none') { + console.log('Unrecognised log level source') + } } } }) diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index f9532875ea..ee13dbc56d 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -83,12 +83,14 @@ describe('LoggingManager', function () { describe('initialize', function () { beforeEach(function () { - this.checkLogLevelStub = sinon.stub(this.LoggingManager, 'checkLogLevel') + this.checkLogLevelFileStub = sinon.stub(this.LoggingManager, 'checkLogLevelFile') + this.checkLogLevelMetadataStub = sinon.stub(this.LoggingManager, 'checkLogLevelMetadata') this.Bunyan.createLogger.reset() }) afterEach(function () { - this.checkLogLevelStub.restore() + this.checkLogLevelFileStub.restore() + this.checkLogLevelMetadataStub.restore() }) describe('not in production', function () { @@ -103,41 +105,76 @@ describe('LoggingManager', function () { }) it('should not run checkLogLevel', function () { - this.checkLogLevelStub.should.not.have.been.called + this.checkLogLevelFileStub.should.not.have.been.called + this.checkLogLevelMetadataStub.should.not.have.been.called }) }) describe('in production', function () { beforeEach(function () { process.env.NODE_ENV = 'production' - this.logger = this.LoggingManager.initialize(this.loggerName) }) afterEach(() => delete process.env.NODE_ENV) it('should default to log level warn', function () { + this.logger = this.LoggingManager.initialize(this.loggerName) this.Bunyan.createLogger.firstCall.args[0].streams[0].level.should.equal( 'warn' ) }) - it('should run checkLogLevel', function () { - this.checkLogLevelStub.should.have.been.calledOnce + describe('logLevelSource file', function () { + beforeEach(function() { + this.logger = this.LoggingManager.initialize(this.loggerName) + }) + + it('should run checkLogLevel', function () { + this.checkLogLevelFileStub.should.have.been.calledOnce + }) + + describe('after 1 minute', () => + it('should run checkLogLevel again', function () { + this.clock.tick(61 * 1000) + this.checkLogLevelFileStub.should.have.been.calledTwice + })) + + describe('after 2 minutes', () => + it('should run checkLogLevel again', function () { + this.clock.tick(121 * 1000) + this.checkLogLevelFileStub.should.have.been.calledThrice + })) }) - describe('after 1 minute', () => - it('should run checkLogLevel again', function () { - this.clock.tick(61 * 1000) - this.checkLogLevelStub.should.have.been.calledTwice - })) + describe('logLevelSource gce_metadata', function () { + beforeEach(function () { + process.env.LOG_LEVEL_SOURCE = 'gce_metadata' + this.logger = this.LoggingManager.initialize(this.loggerName) + }) + + afterEach(() => delete process.env.LOG_LEVEL_SOURCE) + + it('should run checkLogLevel', function () { + this.checkLogLevelMetadataStub.should.have.been.calledOnce + }) + + describe('after 1 minute', () => + it('should run checkLogLevel again', function () { + this.clock.tick(61 * 1000) + this.checkLogLevelMetadataStub.should.have.been.calledTwice + })) + + describe('after 2 minutes', () => + it('should run checkLogLevel again', function () { + this.clock.tick(121 * 1000) + this.checkLogLevelMetadataStub.should.have.been.calledThrice + })) + }) - describe('after 2 minutes', () => - it('should run checkLogLevel again', function () { - this.clock.tick(121 * 1000) - this.checkLogLevelStub.should.have.been.calledThrice - })) }) + + describe('when LOG_LEVEL set in env', function () { beforeEach(function () { process.env.LOG_LEVEL = 'trace' @@ -300,10 +337,10 @@ describe('LoggingManager', function () { }) }) - describe('checkLogLevel', function () { + describe('checkLogLevelFile', function () { it('should request log level override from the config map', async function () { - await this.logger.checkLogLevel() + await this.logger.checkLogLevelFile() this.Fs.promises.readFile.should.have.been.calledWithMatch( '/logging/tracingEndTime' ) @@ -312,7 +349,7 @@ describe('LoggingManager', function () { describe('when read errors', function () { beforeEach(function () { this.Fs.promises.readFile.yields(new Error('error')) - this.logger.checkLogLevel() + this.logger.checkLogLevelFile() }) it('should only set default level', function () { @@ -325,7 +362,7 @@ describe('LoggingManager', function () { describe('when the file is empty', function () { beforeEach(function () { this.Fs.promises.readFile.yields(null, '') - this.logger.checkLogLevel() + this.logger.checkLogLevelFile() }) it('should only set default level', function () { @@ -338,7 +375,7 @@ describe('LoggingManager', function () { describe('when time value returned that is less than current time', function () { beforeEach(function () { this.Fs.promises.readFile.yields(null, '1') - this.logger.checkLogLevel() + this.logger.checkLogLevelFile() }) it('should only set default level', function () { @@ -353,7 +390,7 @@ describe('LoggingManager', function () { beforeEach(async function () { this.bunyanLogger.level.returns(10) this.Fs.promises.readFile.returns((this.start + 1000).toString()) - await this.logger.checkLogLevel() + await this.logger.checkLogLevelFile() }) it('should set trace level', function () { @@ -367,7 +404,7 @@ describe('LoggingManager', function () { beforeEach(async function () { this.bunyanLogger.level.returns(20) this.Fs.promises.readFile.returns((this.start + 1000).toString()) - await this.logger.checkLogLevel() + await this.logger.checkLogLevelFile() }) it('should set trace level', function () { @@ -376,118 +413,114 @@ describe('LoggingManager', function () { ) }) }) + }) + }) - describe('when using metadata', function () { - beforeEach(function () { - process.env.USE_METADATA = 'TRUE' - this.logger = this.LoggingManager.initialize(this.loggerName) +describe('checkLogLevelMetadata', function () { + beforeEach(function () { + this.logger = this.LoggingManager.initialize(this.loggerName) + }) + + describe('checkLogLevel', function() { + it('should request log level override from google meta data service', function() { + this.logger.checkLogLevelMetadata() + const options = { + headers: { + 'Metadata-Flavor': 'Google' + } + } + const uri = `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` + this.Fetch.should.have.been.calledWithMatch(uri,options) + }) + + describe('when request has error', function() { + beforeEach(async function() { + this.Fetch = sinon.stub().throws() + //this.Request.yields('error') + await this.logger.checkLogLevelMetadata() + }) + + it('should only set default level', function() { + this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( + 'debug' + ) + }) + }) + + describe('when statusCode is not 200', function() { + beforeEach(async function() { + this.fetchResponse.status = 404 + //this.Request.yields(null, { statusCode: 404 }) + await this.logger.checkLogLevelMetadata() + }) + + it('should only set default level', function() { + this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( + 'debug' + ) + }) + }) + + describe('when time value returned that is less than current time', function() { + beforeEach(async function() { + //this.Request.yields(null, { statusCode: 200 }, '1') + this.fetchResponse.text = sinon.stub().resolves('1') + await this.logger.checkLogLevelMetadata() + }) + + it('should only set default level', function() { + this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( + 'debug' + ) + }) + }) + + describe('when time value returned that is more than current time', function() { + describe('when level is already set', function() { + beforeEach(async function() { + this.bunyanLogger.level.returns(10) + //this.Request.yields(null, { statusCode: 200 }, this.start + 1000) + this.fetchResponse.text = sinon.stub().resolves(this.start + 1000) + //this.Fetch = sinon.stub().resolves(this.fetchResponse) + + await this.logger.checkLogLevelMetadata() }) - afterEach(function() { - process.env.USE_METADATA = undefined + it('should set trace level', function() { + this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( + 'trace' + ) + }) + }) + + describe('when level is not already set', function() { + beforeEach(async function() { + this.bunyanLogger.level.returns(20) + this.fetchResponse.text = sinon.stub().resolves(this.start + 1000) + this.Fetch.fetch = sinon.stub().resolves(this.fetchResponse) + //this.Request.yields(null, { statusCode: 200 }, this.start + 1000) + //this.fetchResponse = sinon.stub().resolves + + + //{data: this.start + 1000, status: 200} + await this.logger.checkLogLevelMetadata() }) - describe('checkLogLevel', function() { - it('should request log level override from google meta data service', function() { - this.logger.checkLogLevel() - const options = { - headers: { - 'Metadata-Flavor': 'Google' - } - } - const uri = `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` - this.Fetch.should.have.been.calledWithMatch(uri,options) - }) - - describe('when request has error', function() { - beforeEach(async function() { - this.Fetch = sinon.stub().throws() - //this.Request.yields('error') - await this.logger.checkLogLevel() - }) - - it('should only set default level', function() { - this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( - 'debug' - ) - }) - }) - - describe('when statusCode is not 200', function() { - beforeEach(async function() { - this.fetchResponse.status = 404 - //this.Request.yields(null, { statusCode: 404 }) - await this.logger.checkLogLevel() - }) - - it('should only set default level', function() { - this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( - 'debug' - ) - }) - }) - - describe('when time value returned that is less than current time', function() { - beforeEach(async function() { - //this.Request.yields(null, { statusCode: 200 }, '1') - this.fetchResponse.text = sinon.stub().resolves('1') - await this.logger.checkLogLevel() - }) - - it('should only set default level', function() { - this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( - 'debug' - ) - }) - }) - - describe('when time value returned that is more than current time', function() { - describe('when level is already set', function() { - beforeEach(async function() { - this.bunyanLogger.level.returns(10) - //this.Request.yields(null, { statusCode: 200 }, this.start + 1000) - this.fetchResponse.text = sinon.stub().resolves(this.start + 1000) - //this.Fetch = sinon.stub().resolves(this.fetchResponse) - - await this.logger.checkLogLevel() - }) - - it('should set trace level', function() { - this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( - 'trace' - ) - }) - }) - - describe('when level is not already set', function() { - beforeEach(async function() { - this.bunyanLogger.level.returns(20) - this.fetchResponse.text = sinon.stub().resolves(this.start + 1000) - this.Fetch.fetch = sinon.stub().resolves(this.fetchResponse) - //this.Request.yields(null, { statusCode: 200 }, this.start + 1000) - //this.fetchResponse = sinon.stub().resolves - - - //{data: this.start + 1000, status: 200} - await this.logger.checkLogLevel() - }) - - it('should set trace level', function() { - this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( - 'trace' - ) - }) - }) - }) + it('should set trace level', function() { + this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( + 'trace' + ) }) + }) + }) + }) - }) - }) + }) describe('ringbuffer', function () { From d42bd2da50d07a2d7fb08c3917ddb1ff8e2ed7ca Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Fri, 24 Jul 2020 12:17:31 +0100 Subject: [PATCH 78/93] Tidy up --- .../logger/test/unit/loggingManagerTests.js | 163 ++++++++---------- 1 file changed, 76 insertions(+), 87 deletions(-) diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index ee13dbc56d..b525114bad 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -5,7 +5,6 @@ const path = require('path') const sinon = require('sinon') const sinonChai = require('sinon-chai') const { promises } = require('dns') -//const fetchMock = require('fetch-mock') chai.use(sinonChai) chai.should() @@ -50,7 +49,6 @@ describe('LoggingManager', function () { this.Fetch = sinon.stub().resolves(this.fetchResponse) this.Fs = { readFile: sinon.stub(), - access: sinon.stub(), promises: { readFile: sinon.stub() } @@ -173,8 +171,6 @@ describe('LoggingManager', function () { }) - - describe('when LOG_LEVEL set in env', function () { beforeEach(function () { process.env.LOG_LEVEL = 'trace' @@ -416,113 +412,106 @@ describe('LoggingManager', function () { }) }) -describe('checkLogLevelMetadata', function () { - beforeEach(function () { - this.logger = this.LoggingManager.initialize(this.loggerName) - }) - - describe('checkLogLevel', function() { - it('should request log level override from google meta data service', function() { - this.logger.checkLogLevelMetadata() - const options = { - headers: { - 'Metadata-Flavor': 'Google' - } - } - const uri = `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` - this.Fetch.should.have.been.calledWithMatch(uri,options) + describe('checkLogLevelMetadata', function () { + beforeEach(function () { + this.logger = this.LoggingManager.initialize(this.loggerName) }) - describe('when request has error', function() { - beforeEach(async function() { - this.Fetch = sinon.stub().throws() - //this.Request.yields('error') - await this.logger.checkLogLevelMetadata() + describe('checkLogLevel', function() { + it('should request log level override from google meta data service', function() { + this.logger.checkLogLevelMetadata() + const options = { + headers: { + 'Metadata-Flavor': 'Google' + } + } + const uri = `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` + this.Fetch.should.have.been.calledWithMatch(uri,options) }) - it('should only set default level', function() { - this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( - 'debug' - ) - }) - }) - - describe('when statusCode is not 200', function() { - beforeEach(async function() { - this.fetchResponse.status = 404 - //this.Request.yields(null, { statusCode: 404 }) - await this.logger.checkLogLevelMetadata() - }) - - it('should only set default level', function() { - this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( - 'debug' - ) - }) - }) - - describe('when time value returned that is less than current time', function() { - beforeEach(async function() { - //this.Request.yields(null, { statusCode: 200 }, '1') - this.fetchResponse.text = sinon.stub().resolves('1') - await this.logger.checkLogLevelMetadata() - }) - - it('should only set default level', function() { - this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( - 'debug' - ) - }) - }) - - describe('when time value returned that is more than current time', function() { - describe('when level is already set', function() { + describe('when request has error', function() { beforeEach(async function() { - this.bunyanLogger.level.returns(10) - //this.Request.yields(null, { statusCode: 200 }, this.start + 1000) - this.fetchResponse.text = sinon.stub().resolves(this.start + 1000) - //this.Fetch = sinon.stub().resolves(this.fetchResponse) - + this.Fetch = sinon.stub().throws() + //this.Request.yields('error') await this.logger.checkLogLevelMetadata() }) - it('should set trace level', function() { + it('should only set default level', function() { this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( - 'trace' + 'debug' ) }) }) - describe('when level is not already set', function() { + describe('when statusCode is not 200', function() { beforeEach(async function() { - this.bunyanLogger.level.returns(20) - this.fetchResponse.text = sinon.stub().resolves(this.start + 1000) - this.Fetch.fetch = sinon.stub().resolves(this.fetchResponse) - //this.Request.yields(null, { statusCode: 200 }, this.start + 1000) - //this.fetchResponse = sinon.stub().resolves - - - //{data: this.start + 1000, status: 200} + this.fetchResponse.status = 404 + //this.Request.yields(null, { statusCode: 404 }) await this.logger.checkLogLevelMetadata() }) - it('should set trace level', function() { + it('should only set default level', function() { this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( - 'trace' + 'debug' ) }) }) + + describe('when time value returned that is less than current time', function() { + beforeEach(async function() { + //this.Request.yields(null, { statusCode: 200 }, '1') + this.fetchResponse.text = sinon.stub().resolves('1') + await this.logger.checkLogLevelMetadata() + }) + + it('should only set default level', function() { + this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( + 'debug' + ) + }) + }) + + describe('when time value returned that is more than current time', function() { + describe('when level is already set', function() { + beforeEach(async function() { + this.bunyanLogger.level.returns(10) + //this.Request.yields(null, { statusCode: 200 }, this.start + 1000) + this.fetchResponse.text = sinon.stub().resolves(this.start + 1000) + //this.Fetch = sinon.stub().resolves(this.fetchResponse) + + await this.logger.checkLogLevelMetadata() + }) + + it('should set trace level', function() { + this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( + 'trace' + ) + }) + }) + + describe('when level is not already set', function() { + beforeEach(async function() { + this.bunyanLogger.level.returns(20) + this.fetchResponse.text = sinon.stub().resolves(this.start + 1000) + this.Fetch.fetch = sinon.stub().resolves(this.fetchResponse) + //this.Request.yields(null, { statusCode: 200 }, this.start + 1000) + //this.fetchResponse = sinon.stub().resolves + + + //{data: this.start + 1000, status: 200} + await this.logger.checkLogLevelMetadata() + }) + + it('should set trace level', function() { + this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( + 'trace' + ) + }) + }) + }) }) }) - - - - - - - }) - describe('ringbuffer', function () { beforeEach(function () { this.logBufferMock = [ From 1ca6269aa58a57232a7ceb291e2416038f37bdaf Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Fri, 24 Jul 2020 12:18:33 +0100 Subject: [PATCH 79/93] Bump version to 2.2.0 --- libraries/logger/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/logger/package.json b/libraries/logger/package.json index f2947379a7..5ab7496e8f 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -7,7 +7,7 @@ "url": "http://github.com/sharelatex/logger-sharelatex.git" }, "license": "AGPL-3.0-only", - "version": "2.1.1", + "version": "2.2.0", "scripts": { "test": "mocha --grep=$MOCHA_GREP test/**/*.js", "format": "prettier-eslint $PWD'**/*.js' --list-different", From 74e2a5eaa1046a6fe4071f7af04ba686b3a2e2d7 Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Thu, 30 Jul 2020 12:49:54 +0100 Subject: [PATCH 80/93] WIP --- libraries/logger/logging-manager.js | 49 ++++----- .../logger/test/unit/loggingManagerTests.js | 101 ++++++++++-------- 2 files changed, 77 insertions(+), 73 deletions(-) diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index 4b384df0f1..decdb0b1d5 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -43,41 +43,33 @@ const Logger = (module.exports = { return this }, - async checkLogLevelFile() { + async checkLogLevel() { try { - const end = await fs.promises.readFile('/logging/tracingEndTime') - if (!end) throw new Error("No end time found") - if (parseInt(end,10) > Date.now()) { + const end = await this.getTracingEndTime() + if (parseInt(end, 10) > Date.now()) { this.logger.level('trace') } else { this.logger.level(this.defaultLevel) } } catch (err) { this.logger.level(this.defaultLevel) - return } }, -async checkLogLevelMetadata() { + async getTracingEndTimeFile() { + return fs.promises.readFile('/logging/tracingEndTime') + }, + +async getTracingEndTimeMetadata() { const options = { headers: { 'Metadata-Flavor': 'Google' } } const uri = `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` - try { - const res = await fetch(uri,options) - if (!res.ok) throw new Error("Metadata not okay") - const body = await res.text() - if (parseInt(body) > Date.now()) { - this.logger.level('trace') - } else { - this.logger.level(this.defaultLevel) - } - } catch (err) { - this.logger.level(this.defaultLevel) - return - } + const res = await fetch(uri,options) + if (!res.ok) throw new Error("Metadata not okay") + return res.text() }, initializeErrorReporting(sentryDsn, options) { @@ -267,18 +259,19 @@ async checkLogLevelMetadata() { clearInterval(this.checkInterval) } if (this.logLevelSource === 'file') { - // check for log level override on startup - this.checkLogLevelFile() - // re-check log level every minute - this.checkInterval = setInterval(this.checkLogLevelFile.bind(this), 1000 * 60) + this.getTracingEndTime = this.getTracingEndTimeFile } else if (this.logLevelSource === 'gce_metadata') { - // check for log level override on startup - this.checkLogLevelMetadata() - // re-check log level every minute - this.checkInterval = setInterval(this.checkLogLevelMetadata.bind(this), 1000 * 60) - } else if (this.logLevelSource !== 'none') { + this.getTracingEndTime = this.getTracingEndTimeMetadata + } else if (this.logLevelSource === 'none') { + return + } else { console.log('Unrecognised log level source') + return } + // check for log level override on startup + this.checkLogLevel() + // re-check log level every minute + this.checkInterval = setInterval(this.checkLogLevel.bind(this), 1000 * 60) } } }) diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index b525114bad..aafde78d93 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -81,14 +81,14 @@ describe('LoggingManager', function () { describe('initialize', function () { beforeEach(function () { - this.checkLogLevelFileStub = sinon.stub(this.LoggingManager, 'checkLogLevelFile') - this.checkLogLevelMetadataStub = sinon.stub(this.LoggingManager, 'checkLogLevelMetadata') + this.getTracingEndTimeFileStub = sinon.stub(this.LoggingManager, 'getTracingEndTimeFile') + this.getTracingEndTimeMetadataStub = sinon.stub(this.LoggingManager, 'getTracingEndTimeMetadata') this.Bunyan.createLogger.reset() }) afterEach(function () { - this.checkLogLevelFileStub.restore() - this.checkLogLevelMetadataStub.restore() + this.getTracingEndTimeFileStub.restore() + this.getTracingEndTimeMetadataStub.restore() }) describe('not in production', function () { @@ -102,9 +102,9 @@ describe('LoggingManager', function () { ) }) - it('should not run checkLogLevel', function () { - this.checkLogLevelFileStub.should.not.have.been.called - this.checkLogLevelMetadataStub.should.not.have.been.called + it('should not run getTracingEndTime', function () { + this.getTracingEndTimeFileStub.should.not.have.been.called + this.getTracingEndTimeMetadataStub.should.not.have.been.called }) }) @@ -115,32 +115,40 @@ describe('LoggingManager', function () { afterEach(() => delete process.env.NODE_ENV) - it('should default to log level warn', function () { - this.logger = this.LoggingManager.initialize(this.loggerName) - this.Bunyan.createLogger.firstCall.args[0].streams[0].level.should.equal( - 'warn' - ) + describe('blah', function () { + beforeEach(function () { + this.logger = this.LoggingManager.initialize(this.loggerName) + }) + it.only('should default to log level warn', function () { + + const level = this.Bunyan.createLogger.firstCall.args[0].streams[0].level + console.log(level) + level.should.equal( + 'warn' + ) + }) }) + describe('logLevelSource file', function () { beforeEach(function() { this.logger = this.LoggingManager.initialize(this.loggerName) }) it('should run checkLogLevel', function () { - this.checkLogLevelFileStub.should.have.been.calledOnce + this.getTracingEndTimeFileStub.should.have.been.calledOnce }) describe('after 1 minute', () => it('should run checkLogLevel again', function () { this.clock.tick(61 * 1000) - this.checkLogLevelFileStub.should.have.been.calledTwice + this.getTracingEndTimeFileStub.should.have.been.calledTwice })) describe('after 2 minutes', () => it('should run checkLogLevel again', function () { this.clock.tick(121 * 1000) - this.checkLogLevelFileStub.should.have.been.calledThrice + this.getTracingEndTimeFileStub.should.have.been.calledThrice })) }) @@ -153,19 +161,19 @@ describe('LoggingManager', function () { afterEach(() => delete process.env.LOG_LEVEL_SOURCE) it('should run checkLogLevel', function () { - this.checkLogLevelMetadataStub.should.have.been.calledOnce + this.getTracingEndTimeMetadataStub.should.have.been.calledOnce }) describe('after 1 minute', () => it('should run checkLogLevel again', function () { this.clock.tick(61 * 1000) - this.checkLogLevelMetadataStub.should.have.been.calledTwice + this.getTracingEndTimeMetadataStub.should.have.been.calledTwice })) describe('after 2 minutes', () => it('should run checkLogLevel again', function () { this.clock.tick(121 * 1000) - this.checkLogLevelMetadataStub.should.have.been.calledThrice + this.getTracingEndTimeMetadataStub.should.have.been.calledThrice })) }) @@ -336,16 +344,18 @@ describe('LoggingManager', function () { describe('checkLogLevelFile', function () { it('should request log level override from the config map', async function () { - await this.logger.checkLogLevelFile() + this.logger.getTracingEndTime = this.logger.getTracingEndTimeFile + await this.logger.checkLogLevel() this.Fs.promises.readFile.should.have.been.calledWithMatch( '/logging/tracingEndTime' ) }) describe('when read errors', function () { - beforeEach(function () { + beforeEach(async function () { this.Fs.promises.readFile.yields(new Error('error')) - this.logger.checkLogLevelFile() + this.logger.getTracingEndTime = this.logger.getTracingEndTimeFile + await this.logger.checkLogLevel() }) it('should only set default level', function () { @@ -356,9 +366,10 @@ describe('LoggingManager', function () { }) describe('when the file is empty', function () { - beforeEach(function () { + beforeEach(async function () { this.Fs.promises.readFile.yields(null, '') - this.logger.checkLogLevelFile() + this.logger.getTracingEndTime = this.logger.getTracingEndTimeFile + await this.logger.checkLogLevel() }) it('should only set default level', function () { @@ -369,9 +380,10 @@ describe('LoggingManager', function () { }) describe('when time value returned that is less than current time', function () { - beforeEach(function () { + beforeEach(async function () { this.Fs.promises.readFile.yields(null, '1') - this.logger.checkLogLevelFile() + this.logger.getTracingEndTime = this.logger.getTracingEndTimeFile + await this.logger.checkLogLevel() }) it('should only set default level', function () { @@ -386,7 +398,8 @@ describe('LoggingManager', function () { beforeEach(async function () { this.bunyanLogger.level.returns(10) this.Fs.promises.readFile.returns((this.start + 1000).toString()) - await this.logger.checkLogLevelFile() + this.logger.getTracingEndTime = this.logger.getTracingEndTimeFile + await this.logger.checkLogLevel() }) it('should set trace level', function () { @@ -400,7 +413,8 @@ describe('LoggingManager', function () { beforeEach(async function () { this.bunyanLogger.level.returns(20) this.Fs.promises.readFile.returns((this.start + 1000).toString()) - await this.logger.checkLogLevelFile() + this.logger.getTracingEndTime = this.logger.getTracingEndTimeFile + await this.logger.checkLogLevel() }) it('should set trace level', function () { @@ -418,8 +432,9 @@ describe('LoggingManager', function () { }) describe('checkLogLevel', function() { - it('should request log level override from google meta data service', function() { - this.logger.checkLogLevelMetadata() + it('should request log level override from google meta data service', async function() { + this.logger.getTracingEndTime = this.logger.getTracingEndTimeMetadata + await this.logger.checkLogLevel() const options = { headers: { 'Metadata-Flavor': 'Google' @@ -432,8 +447,8 @@ describe('LoggingManager', function () { describe('when request has error', function() { beforeEach(async function() { this.Fetch = sinon.stub().throws() - //this.Request.yields('error') - await this.logger.checkLogLevelMetadata() + this.logger.getTracingEndTime = this.logger.getTracingEndTimeMetadata + await this.logger.checkLogLevel() }) it('should only set default level', function() { @@ -446,8 +461,8 @@ describe('LoggingManager', function () { describe('when statusCode is not 200', function() { beforeEach(async function() { this.fetchResponse.status = 404 - //this.Request.yields(null, { statusCode: 404 }) - await this.logger.checkLogLevelMetadata() + this.logger.getTracingEndTime = this.logger.getTracingEndTimeMetadata + await this.logger.checkLogLevel() }) it('should only set default level', function() { @@ -459,9 +474,9 @@ describe('LoggingManager', function () { describe('when time value returned that is less than current time', function() { beforeEach(async function() { - //this.Request.yields(null, { statusCode: 200 }, '1') + this.logger.getTracingEndTime = this.logger.getTracingEndTimeMetadata this.fetchResponse.text = sinon.stub().resolves('1') - await this.logger.checkLogLevelMetadata() + await this.logger.checkLogLevel() }) it('should only set default level', function() { @@ -475,11 +490,10 @@ describe('LoggingManager', function () { describe('when level is already set', function() { beforeEach(async function() { this.bunyanLogger.level.returns(10) - //this.Request.yields(null, { statusCode: 200 }, this.start + 1000) this.fetchResponse.text = sinon.stub().resolves(this.start + 1000) - //this.Fetch = sinon.stub().resolves(this.fetchResponse) + this.logger.getTracingEndTime = this.logger.getTracingEndTimeMetadata - await this.logger.checkLogLevelMetadata() + await this.logger.checkLogLevel() }) it('should set trace level', function() { @@ -493,13 +507,10 @@ describe('LoggingManager', function () { beforeEach(async function() { this.bunyanLogger.level.returns(20) this.fetchResponse.text = sinon.stub().resolves(this.start + 1000) - this.Fetch.fetch = sinon.stub().resolves(this.fetchResponse) - //this.Request.yields(null, { statusCode: 200 }, this.start + 1000) - //this.fetchResponse = sinon.stub().resolves - - - //{data: this.start + 1000, status: 200} - await this.logger.checkLogLevelMetadata() + this.Fetch.fetch = sinon.stub().resolves(this.fetchResponse) + this.logger.getTracingEndTime = this.logger.getTracingEndTimeMetadata + + await this.logger.checkLogLevel() }) it('should set trace level', function() { From 6917847b10ca4621e41eb3044d9e2ac3d1ed687a Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Thu, 30 Jul 2020 14:45:49 +0100 Subject: [PATCH 81/93] catch --- libraries/logger/logging-manager.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index decdb0b1d5..11c06f2716 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -22,6 +22,7 @@ const errSerializer = function (err) { const Logger = (module.exports = { initialize(name) { + console.log("IN INIT") this.logLevelSource = (process.env.LOG_LEVEL_SOURCE || 'file').toLowerCase() this.isProduction = (process.env.NODE_ENV || '').toLowerCase() === 'production' @@ -39,6 +40,7 @@ const Logger = (module.exports = { }) this._setupRingBuffer() this._setupStackdriver() + console.log(this.logger) this._setupLogLevelChecker() return this }, @@ -52,6 +54,7 @@ const Logger = (module.exports = { this.logger.level(this.defaultLevel) } } catch (err) { + console.log(err) this.logger.level(this.defaultLevel) } }, @@ -253,6 +256,8 @@ async getTracingEndTimeMetadata() { }, _setupLogLevelChecker() { + console.log("In _setupLogLevelChecker") + console.log(this.logger) if (this.isProduction) { // clear interval if already set if (this.checkInterval) { @@ -269,7 +274,9 @@ async getTracingEndTimeMetadata() { return } // check for log level override on startup - this.checkLogLevel() + this.checkLogLevel().catch((error) => { + console.log(error) + }) // re-check log level every minute this.checkInterval = setInterval(this.checkLogLevel.bind(this), 1000 * 60) } From 8376cf1ca256ca957ad8009f4ffcd844d579b24f Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Thu, 30 Jul 2020 15:06:32 +0100 Subject: [PATCH 82/93] Get acceptance tests working --- .../logger/test/unit/loggingManagerTests.js | 42 ++++--------------- 1 file changed, 7 insertions(+), 35 deletions(-) diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index aafde78d93..ee918a507d 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -81,14 +81,12 @@ describe('LoggingManager', function () { describe('initialize', function () { beforeEach(function () { - this.getTracingEndTimeFileStub = sinon.stub(this.LoggingManager, 'getTracingEndTimeFile') - this.getTracingEndTimeMetadataStub = sinon.stub(this.LoggingManager, 'getTracingEndTimeMetadata') + this.checkLogLevelStub = sinon.stub(this.LoggingManager, 'checkLogLevel').resolves('') this.Bunyan.createLogger.reset() }) afterEach(function () { - this.getTracingEndTimeFileStub.restore() - this.getTracingEndTimeMetadataStub.restore() + this.checkLogLevelStub.restore() }) describe('not in production', function () { @@ -103,8 +101,7 @@ describe('LoggingManager', function () { }) it('should not run getTracingEndTime', function () { - this.getTracingEndTimeFileStub.should.not.have.been.called - this.getTracingEndTimeMetadataStub.should.not.have.been.called + this.checkLogLevelStub.should.not.have.been.called }) }) @@ -119,7 +116,7 @@ describe('LoggingManager', function () { beforeEach(function () { this.logger = this.LoggingManager.initialize(this.loggerName) }) - it.only('should default to log level warn', function () { + it('should default to log level warn', function () { const level = this.Bunyan.createLogger.firstCall.args[0].streams[0].level console.log(level) @@ -136,44 +133,19 @@ describe('LoggingManager', function () { }) it('should run checkLogLevel', function () { - this.getTracingEndTimeFileStub.should.have.been.calledOnce + this.checkLogLevelStub.should.have.been.calledOnce }) describe('after 1 minute', () => it('should run checkLogLevel again', function () { this.clock.tick(61 * 1000) - this.getTracingEndTimeFileStub.should.have.been.calledTwice + this.checkLogLevelStub.should.have.been.calledTwice })) describe('after 2 minutes', () => it('should run checkLogLevel again', function () { this.clock.tick(121 * 1000) - this.getTracingEndTimeFileStub.should.have.been.calledThrice - })) - }) - - describe('logLevelSource gce_metadata', function () { - beforeEach(function () { - process.env.LOG_LEVEL_SOURCE = 'gce_metadata' - this.logger = this.LoggingManager.initialize(this.loggerName) - }) - - afterEach(() => delete process.env.LOG_LEVEL_SOURCE) - - it('should run checkLogLevel', function () { - this.getTracingEndTimeMetadataStub.should.have.been.calledOnce - }) - - describe('after 1 minute', () => - it('should run checkLogLevel again', function () { - this.clock.tick(61 * 1000) - this.getTracingEndTimeMetadataStub.should.have.been.calledTwice - })) - - describe('after 2 minutes', () => - it('should run checkLogLevel again', function () { - this.clock.tick(121 * 1000) - this.getTracingEndTimeMetadataStub.should.have.been.calledThrice + this.checkLogLevelStub.should.have.been.calledThrice })) }) From 57ef07dc672d6a51f17182b4dba46dd6a5ed4f56 Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Thu, 30 Jul 2020 15:08:22 +0100 Subject: [PATCH 83/93] lint and format --- libraries/logger/logging-manager.js | 14 +++++++------- libraries/logger/test/unit/loggingManagerTests.js | 1 - 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index 11c06f2716..a4b4caeaa7 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -22,7 +22,7 @@ const errSerializer = function (err) { const Logger = (module.exports = { initialize(name) { - console.log("IN INIT") + console.log('IN INIT') this.logLevelSource = (process.env.LOG_LEVEL_SOURCE || 'file').toLowerCase() this.isProduction = (process.env.NODE_ENV || '').toLowerCase() === 'production' @@ -60,18 +60,18 @@ const Logger = (module.exports = { }, async getTracingEndTimeFile() { - return fs.promises.readFile('/logging/tracingEndTime') + return fs.promises.readFile('/logging/tracingEndTime') }, -async getTracingEndTimeMetadata() { + async getTracingEndTimeMetadata() { const options = { headers: { 'Metadata-Flavor': 'Google' } } const uri = `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` - const res = await fetch(uri,options) - if (!res.ok) throw new Error("Metadata not okay") + const res = await fetch(uri, options) + if (!res.ok) throw new Error('Metadata not okay') return res.text() }, @@ -256,7 +256,7 @@ async getTracingEndTimeMetadata() { }, _setupLogLevelChecker() { - console.log("In _setupLogLevelChecker") + console.log('In _setupLogLevelChecker') console.log(this.logger) if (this.isProduction) { // clear interval if already set @@ -266,7 +266,7 @@ async getTracingEndTimeMetadata() { if (this.logLevelSource === 'file') { this.getTracingEndTime = this.getTracingEndTimeFile } else if (this.logLevelSource === 'gce_metadata') { - this.getTracingEndTime = this.getTracingEndTimeMetadata + this.getTracingEndTime = this.getTracingEndTimeMetadata } else if (this.logLevelSource === 'none') { return } else { diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index ee918a507d..d0de9ad64b 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -4,7 +4,6 @@ const chai = require('chai') const path = require('path') const sinon = require('sinon') const sinonChai = require('sinon-chai') -const { promises } = require('dns') chai.use(sinonChai) chai.should() From e32411eaaa2bee65fbfae2a76b6875bfd335a542 Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Thu, 30 Jul 2020 15:23:04 +0100 Subject: [PATCH 84/93] Clean up acceptance tests --- libraries/logger/logging-manager.js | 4 ---- .../logger/test/unit/loggingManagerTests.js | 24 +++++++------------ 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index a4b4caeaa7..20156ec417 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -22,7 +22,6 @@ const errSerializer = function (err) { const Logger = (module.exports = { initialize(name) { - console.log('IN INIT') this.logLevelSource = (process.env.LOG_LEVEL_SOURCE || 'file').toLowerCase() this.isProduction = (process.env.NODE_ENV || '').toLowerCase() === 'production' @@ -40,7 +39,6 @@ const Logger = (module.exports = { }) this._setupRingBuffer() this._setupStackdriver() - console.log(this.logger) this._setupLogLevelChecker() return this }, @@ -256,8 +254,6 @@ const Logger = (module.exports = { }, _setupLogLevelChecker() { - console.log('In _setupLogLevelChecker') - console.log(this.logger) if (this.isProduction) { // clear interval if already set if (this.checkInterval) { diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index d0de9ad64b..23438a673a 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -111,21 +111,13 @@ describe('LoggingManager', function () { afterEach(() => delete process.env.NODE_ENV) - describe('blah', function () { - beforeEach(function () { - this.logger = this.LoggingManager.initialize(this.loggerName) - }) - it('should default to log level warn', function () { - - const level = this.Bunyan.createLogger.firstCall.args[0].streams[0].level - console.log(level) - level.should.equal( - 'warn' - ) - }) - }) - - + it('should default to log level warn', function () { + this.logger = this.LoggingManager.initialize(this.loggerName) + this.Bunyan.createLogger.firstCall.args[0].streams[0].level.should.equal( + 'warn' + ) + }) + describe('logLevelSource file', function () { beforeEach(function() { this.logger = this.LoggingManager.initialize(this.loggerName) @@ -324,7 +316,7 @@ describe('LoggingManager', function () { describe('when read errors', function () { beforeEach(async function () { - this.Fs.promises.readFile.yields(new Error('error')) + this.Fs.promises.readFile.throws(new Error('error')) this.logger.getTracingEndTime = this.logger.getTracingEndTimeFile await this.logger.checkLogLevel() }) From 397d5c8f1fba6b7d9e3831b38bbbd4b4fe90bdc1 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Fri, 31 Jul 2020 13:26:28 +0100 Subject: [PATCH 85/93] [misc] fix prettier-eslint glob for real -- include tests --- libraries/logger/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/logger/package.json b/libraries/logger/package.json index d6b370c559..43347658df 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -10,8 +10,8 @@ "version": "2.1.1", "scripts": { "test": "mocha test/**/*.js", - "format": "prettier-eslint $PWD'**/*.js' --list-different", - "format:fix": "prettier-eslint $PWD'**/*.js' --write", + "format": "prettier-eslint $PWD'/**/*.js' --list-different", + "format:fix": "prettier-eslint $PWD'/**/*.js' --write", "lint": "eslint -f unix ." }, "dependencies": { From 46b22b30c7f39443953c4856f96675552bc85540 Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Tue, 11 Aug 2020 09:46:52 +0100 Subject: [PATCH 86/93] Fix test description --- libraries/logger/test/unit/loggingManagerTests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index 23438a673a..c543b6321b 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -99,7 +99,7 @@ describe('LoggingManager', function () { ) }) - it('should not run getTracingEndTime', function () { + it('should not run checkLogLevel', function () { this.checkLogLevelStub.should.not.have.been.called }) }) From 5e9dca7ddf1c5ed3bf13e4163f6c149bdf1455a0 Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Tue, 11 Aug 2020 09:53:29 +0100 Subject: [PATCH 87/93] Ensure fetchResponse.text is a string in sinon stub --- libraries/logger/test/unit/loggingManagerTests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index c543b6321b..5f6ed7ca96 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -453,7 +453,7 @@ describe('LoggingManager', function () { describe('when level is already set', function() { beforeEach(async function() { this.bunyanLogger.level.returns(10) - this.fetchResponse.text = sinon.stub().resolves(this.start + 1000) + this.fetchResponse.text = sinon.stub().resolves((this.start + 1000).toString()) this.logger.getTracingEndTime = this.logger.getTracingEndTimeMetadata await this.logger.checkLogLevel() @@ -469,7 +469,7 @@ describe('LoggingManager', function () { describe('when level is not already set', function() { beforeEach(async function() { this.bunyanLogger.level.returns(20) - this.fetchResponse.text = sinon.stub().resolves(this.start + 1000) + this.fetchResponse.text = sinon.stub().resolves((this.start + 1000).toString()) this.Fetch.fetch = sinon.stub().resolves(this.fetchResponse) this.logger.getTracingEndTime = this.logger.getTracingEndTimeMetadata From 9b21292b44e979b2edb423c4e02ce07a8b7f9e58 Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Tue, 11 Aug 2020 09:53:29 +0100 Subject: [PATCH 88/93] Ensure fetchResponse.text is a string in sinon stub --- libraries/logger/test/unit/loggingManagerTests.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index c543b6321b..5f8c3a9d81 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -316,7 +316,7 @@ describe('LoggingManager', function () { describe('when read errors', function () { beforeEach(async function () { - this.Fs.promises.readFile.throws(new Error('error')) + this.Fs.promises.readFile.throws(new Error('test read error')) this.logger.getTracingEndTime = this.logger.getTracingEndTimeFile await this.logger.checkLogLevel() }) @@ -330,7 +330,7 @@ describe('LoggingManager', function () { describe('when the file is empty', function () { beforeEach(async function () { - this.Fs.promises.readFile.yields(null, '') + this.Fs.promises.readFile.returns('') this.logger.getTracingEndTime = this.logger.getTracingEndTimeFile await this.logger.checkLogLevel() }) @@ -344,7 +344,7 @@ describe('LoggingManager', function () { describe('when time value returned that is less than current time', function () { beforeEach(async function () { - this.Fs.promises.readFile.yields(null, '1') + this.Fs.promises.readFile.returns('1') this.logger.getTracingEndTime = this.logger.getTracingEndTimeFile await this.logger.checkLogLevel() }) @@ -453,7 +453,7 @@ describe('LoggingManager', function () { describe('when level is already set', function() { beforeEach(async function() { this.bunyanLogger.level.returns(10) - this.fetchResponse.text = sinon.stub().resolves(this.start + 1000) + this.fetchResponse.text = sinon.stub().resolves((this.start + 1000).toString()) this.logger.getTracingEndTime = this.logger.getTracingEndTimeMetadata await this.logger.checkLogLevel() @@ -469,7 +469,7 @@ describe('LoggingManager', function () { describe('when level is not already set', function() { beforeEach(async function() { this.bunyanLogger.level.returns(20) - this.fetchResponse.text = sinon.stub().resolves(this.start + 1000) + this.fetchResponse.text = sinon.stub().resolves((this.start + 1000).toString()) this.Fetch.fetch = sinon.stub().resolves(this.fetchResponse) this.logger.getTracingEndTime = this.logger.getTracingEndTimeMetadata From 20f2e1eb1d9620e4f583e95b8632bef4f698597e Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Tue, 11 Aug 2020 10:48:44 +0100 Subject: [PATCH 89/93] Don't catch checkLogLevel --- libraries/logger/logging-manager.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index 20156ec417..e6ed94fedb 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -270,9 +270,7 @@ const Logger = (module.exports = { return } // check for log level override on startup - this.checkLogLevel().catch((error) => { - console.log(error) - }) + this.checkLogLevel() // re-check log level every minute this.checkInterval = setInterval(this.checkLogLevel.bind(this), 1000 * 60) } From ea502a062383fca4ba5184a44b15c27eee03bc09 Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Tue, 11 Aug 2020 10:52:53 +0100 Subject: [PATCH 90/93] Put LoggingManager.initialize back as it was in tests --- libraries/logger/test/unit/loggingManagerTests.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index 5f8c3a9d81..6874425010 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -107,21 +107,18 @@ describe('LoggingManager', function () { describe('in production', function () { beforeEach(function () { process.env.NODE_ENV = 'production' + this.logger = this.LoggingManager.initialize(this.loggerName) }) afterEach(() => delete process.env.NODE_ENV) it('should default to log level warn', function () { - this.logger = this.LoggingManager.initialize(this.loggerName) this.Bunyan.createLogger.firstCall.args[0].streams[0].level.should.equal( 'warn' ) }) describe('logLevelSource file', function () { - beforeEach(function() { - this.logger = this.LoggingManager.initialize(this.loggerName) - }) it('should run checkLogLevel', function () { this.checkLogLevelStub.should.have.been.calledOnce From 8649277c9fdb6f40eb042183bd16400d7f0feb0b Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Tue, 11 Aug 2020 10:55:03 +0100 Subject: [PATCH 91/93] Format:fix --- .../logger/test/unit/loggingManagerTests.js | 61 ++++++++++--------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/libraries/logger/test/unit/loggingManagerTests.js b/libraries/logger/test/unit/loggingManagerTests.js index 6874425010..93c57bd807 100644 --- a/libraries/logger/test/unit/loggingManagerTests.js +++ b/libraries/logger/test/unit/loggingManagerTests.js @@ -80,7 +80,9 @@ describe('LoggingManager', function () { describe('initialize', function () { beforeEach(function () { - this.checkLogLevelStub = sinon.stub(this.LoggingManager, 'checkLogLevel').resolves('') + this.checkLogLevelStub = sinon + .stub(this.LoggingManager, 'checkLogLevel') + .resolves('') this.Bunyan.createLogger.reset() }) @@ -116,10 +118,9 @@ describe('LoggingManager', function () { this.Bunyan.createLogger.firstCall.args[0].streams[0].level.should.equal( 'warn' ) - }) - - describe('logLevelSource file', function () { + }) + describe('logLevelSource file', function () { it('should run checkLogLevel', function () { this.checkLogLevelStub.should.have.been.calledOnce }) @@ -136,7 +137,6 @@ describe('LoggingManager', function () { this.checkLogLevelStub.should.have.been.calledThrice })) }) - }) describe('when LOG_LEVEL set in env', function () { @@ -302,7 +302,6 @@ describe('LoggingManager', function () { }) describe('checkLogLevelFile', function () { - it('should request log level override from the config map', async function () { this.logger.getTracingEndTime = this.logger.getTracingEndTimeFile await this.logger.checkLogLevel() @@ -391,89 +390,93 @@ describe('LoggingManager', function () { this.logger = this.LoggingManager.initialize(this.loggerName) }) - describe('checkLogLevel', function() { - it('should request log level override from google meta data service', async function() { + describe('checkLogLevel', function () { + it('should request log level override from google meta data service', async function () { this.logger.getTracingEndTime = this.logger.getTracingEndTimeMetadata await this.logger.checkLogLevel() const options = { headers: { 'Metadata-Flavor': 'Google' - } + } } const uri = `http://metadata.google.internal/computeMetadata/v1/project/attributes/${this.loggerName}-setLogLevelEndTime` - this.Fetch.should.have.been.calledWithMatch(uri,options) + this.Fetch.should.have.been.calledWithMatch(uri, options) }) - describe('when request has error', function() { - beforeEach(async function() { + describe('when request has error', function () { + beforeEach(async function () { this.Fetch = sinon.stub().throws() this.logger.getTracingEndTime = this.logger.getTracingEndTimeMetadata await this.logger.checkLogLevel() }) - it('should only set default level', function() { + it('should only set default level', function () { this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( 'debug' ) }) }) - describe('when statusCode is not 200', function() { - beforeEach(async function() { + describe('when statusCode is not 200', function () { + beforeEach(async function () { this.fetchResponse.status = 404 this.logger.getTracingEndTime = this.logger.getTracingEndTimeMetadata await this.logger.checkLogLevel() }) - it('should only set default level', function() { + it('should only set default level', function () { this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( 'debug' ) }) }) - describe('when time value returned that is less than current time', function() { - beforeEach(async function() { + describe('when time value returned that is less than current time', function () { + beforeEach(async function () { this.logger.getTracingEndTime = this.logger.getTracingEndTimeMetadata this.fetchResponse.text = sinon.stub().resolves('1') await this.logger.checkLogLevel() }) - it('should only set default level', function() { + it('should only set default level', function () { this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( 'debug' ) }) }) - describe('when time value returned that is more than current time', function() { - describe('when level is already set', function() { - beforeEach(async function() { + describe('when time value returned that is more than current time', function () { + describe('when level is already set', function () { + beforeEach(async function () { this.bunyanLogger.level.returns(10) - this.fetchResponse.text = sinon.stub().resolves((this.start + 1000).toString()) + this.fetchResponse.text = sinon + .stub() + .resolves((this.start + 1000).toString()) this.logger.getTracingEndTime = this.logger.getTracingEndTimeMetadata await this.logger.checkLogLevel() }) - it('should set trace level', function() { + it('should set trace level', function () { this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( 'trace' ) }) }) - describe('when level is not already set', function() { - beforeEach(async function() { + describe('when level is not already set', function () { + beforeEach(async function () { this.bunyanLogger.level.returns(20) - this.fetchResponse.text = sinon.stub().resolves((this.start + 1000).toString()) - this.Fetch.fetch = sinon.stub().resolves(this.fetchResponse) + this.fetchResponse.text = sinon + .stub() + .resolves((this.start + 1000).toString()) + this.Fetch.fetch = sinon.stub().resolves(this.fetchResponse) this.logger.getTracingEndTime = this.logger.getTracingEndTimeMetadata await this.logger.checkLogLevel() }) - it('should set trace level', function() { + it('should set trace level', function () { this.bunyanLogger.level.should.have.been.calledOnce.and.calledWith( 'trace' ) From a66708a3195e0e2c6fde452a8ef11ce94a6b066f Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Tue, 11 Aug 2020 10:56:51 +0100 Subject: [PATCH 92/93] Ignore error --- libraries/logger/logging-manager.js | 1 - 1 file changed, 1 deletion(-) diff --git a/libraries/logger/logging-manager.js b/libraries/logger/logging-manager.js index e6ed94fedb..4351722209 100644 --- a/libraries/logger/logging-manager.js +++ b/libraries/logger/logging-manager.js @@ -52,7 +52,6 @@ const Logger = (module.exports = { this.logger.level(this.defaultLevel) } } catch (err) { - console.log(err) this.logger.level(this.defaultLevel) } }, From 1f3587114fd6290e24a08934563c19474d450fd7 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Tue, 27 Jul 2021 16:27:01 +0100 Subject: [PATCH 93/93] [misc] prepare for monorepo - add git ignore entries - sync/create package-lock.json - delete .nvmrc --- libraries/logger/.gitignore | 3 +++ libraries/logger/.nvmrc | 2 -- libraries/logger/package-lock.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) delete mode 100644 libraries/logger/.nvmrc diff --git a/libraries/logger/.gitignore b/libraries/logger/.gitignore index 3c3629e647..cbf8548194 100644 --- a/libraries/logger/.gitignore +++ b/libraries/logger/.gitignore @@ -1 +1,4 @@ node_modules + +.npmrc +Dockerfile diff --git a/libraries/logger/.nvmrc b/libraries/logger/.nvmrc deleted file mode 100644 index 62e05d11a6..0000000000 --- a/libraries/logger/.nvmrc +++ /dev/null @@ -1,2 +0,0 @@ -10.21.0 - diff --git a/libraries/logger/package-lock.json b/libraries/logger/package-lock.json index 3837260f94..fb0c5617bc 100644 --- a/libraries/logger/package-lock.json +++ b/libraries/logger/package-lock.json @@ -1,6 +1,6 @@ { "name": "logger-sharelatex", - "version": "2.1.1", + "version": "2.2.0", "lockfileVersion": 1, "requires": true, "dependencies": {