From 3012d424e8d6a58a1b218db856783ab28d68b2e8 Mon Sep 17 00:00:00 2001 From: Ivan Marban Date: Wed, 1 May 2019 09:48:19 +0200 Subject: [PATCH 1/9] Recover deleted prettier configuration --- .prettierrc | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..31ba22d --- /dev/null +++ b/.prettierrc @@ -0,0 +1,5 @@ +{ + "semi": false, + "singleQuote": true, + "printWidth": 120 +} From c867435b1cec3e5daf2341777ae5390314563c45 Mon Sep 17 00:00:00 2001 From: Ivan Marban Date: Sun, 16 Jun 2019 10:59:21 +0200 Subject: [PATCH 2/9] Fix require winston-telegram lib path in tests --- examples/batching-messages.js | 2 +- examples/custom-format.js | 2 +- examples/template-output.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/batching-messages.js b/examples/batching-messages.js index 7abf922..5f716aa 100644 --- a/examples/batching-messages.js +++ b/examples/batching-messages.js @@ -3,7 +3,7 @@ */ const logger = require('winston') -const TelegramLogger = require('winston-telegram') +const TelegramLogger = require('../lib/winston-telegram') logger.add( new TelegramLogger({ diff --git a/examples/custom-format.js b/examples/custom-format.js index 42a25e5..09698cd 100644 --- a/examples/custom-format.js +++ b/examples/custom-format.js @@ -3,7 +3,7 @@ */ const logger = require('winston') -const TelegramLogger = require('winston-telegram') +const TelegramLogger = require('../lib/winston-telegram') logger.add( new TelegramLogger({ diff --git a/examples/template-output.js b/examples/template-output.js index 69ca0b9..48cdb96 100644 --- a/examples/template-output.js +++ b/examples/template-output.js @@ -3,7 +3,7 @@ */ const logger = require('winston') -const TelegramLogger = require('winston-telegram') +const TelegramLogger = require('../lib/winston-telegram') logger.add( new TelegramLogger({ From 8c332d2bed334de8e50c66dab34895f1ea0d796f Mon Sep 17 00:00:00 2001 From: Ivan Marban Date: Sat, 22 Jun 2019 10:24:03 +0200 Subject: [PATCH 3/9] Drop request dependency --- lib/winston-telegram.js | 85 +++++++++++++++++++++++++---------------- package.json | 3 +- 2 files changed, 54 insertions(+), 34 deletions(-) diff --git a/lib/winston-telegram.js b/lib/winston-telegram.js index b4cbac3..0438858 100644 --- a/lib/winston-telegram.js +++ b/lib/winston-telegram.js @@ -5,7 +5,7 @@ * MIT LICENCE */ -const request = require('request') +const https = require('https') const format = require('sf') const Transport = require('winston-transport') @@ -34,9 +34,7 @@ module.exports = class Telegram extends Transport { throw new Error("winston-telegram requires 'token' and 'chatId' property") } if (options.formatMessage && typeof options.formatMessage !== 'function') { - throw new Error( - "winston-telegram 'formatMessage' property should be function" - ) + throw new Error("winston-telegram 'formatMessage' property should be function") } this.token = options.token @@ -59,7 +57,7 @@ module.exports = class Telegram extends Transport { * Core logging method exposed to Winston. * * @param {Object} info - TODO: add param description. - * @param {Function} callback - TODO: add param description. + * @param {Function} callback - Continuation to respond to when complete. * @returns {undefined} */ log (info, callback) { @@ -85,9 +83,7 @@ module.exports = class Telegram extends Transport { if (!this.batchingTimeout) { this.batchingTimeout = setTimeout(function () { - let combinedMessages = self.batchedMessages.join( - self.batchingSeparator - ) + let combinedMessages = self.batchedMessages.join(self.batchingSeparator) self.send(combinedMessages) self.batchedMessages = [] self.batchingTimeout = 0 @@ -97,7 +93,7 @@ module.exports = class Telegram extends Transport { self.send(messageText) } - return callback(null, true) + callback(null, true) } /** @@ -110,29 +106,54 @@ module.exports = class Telegram extends Transport { send (messageText) { let self = this - request( - { - url: 'https://api.telegram.org/bot' + this.token + '/sendMessage', - method: 'POST', - json: { - chat_id: this.chatId, - text: messageText, - disable_notification: this.disableNotification - } - }, - function (error, response, body) { - if (error) { - self.emit('error', error) - } - if (response && response.statusCode !== 200) { - self.emit( - 'error', - response.statusCode + - ((body && body.description && ': ' + body.description) || '') - ) - } - self.emit('logged') + const requestData = JSON.stringify({ + chat_id: this.chatId, + text: messageText, + disable_notification: this.disableNotification + }) + + const options = { + hostname: 'api.telegram.org', + path: '/bot' + this.token + '/sendMessage', + method: 'POST', + headers: { + 'Content-Type': 'application/json; charset=utf-8', + 'Content-Length': requestData.length + } + } + + self.request(options, requestData, function (error, response, body) { + if (error) { + self.emit('error', error) + } + if (response && response.statusCode !== 200) { + self.emit('error', response.statusCode + ((body && body.description && ': ' + body.description) || '')) } - ) + self.emit('logged') + }) + } + + /** + * Performs a https request to a server. + * + * @function request + * @param {Object} options - Request options. + * @param {Object} requestData - Request data. + * @param {Function} callback - Continuation to respond to when complete. + * @private + */ + request (options, requestData, callback) { + const request = https.request(options, function (response) { + let responseData = '' + response.on('data', function (chunk) { + responseData += chunk + }) + response.on('end', function () { + callback(null, response, JSON.parse(responseData)) + }) + }) + request.on('error', callback) + request.write(requestData, 'utf-8') + request.end() } } diff --git a/package.json b/package.json index bb5eae0..56fe67a 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "bot" ], "dependencies": { - "request": "^2.88.0", "sf": "^0.2.0", "winston-transport": "^4.3.0" }, @@ -43,7 +42,7 @@ "eslint-plugin-promise": "^4.1.1", "eslint-plugin-standard": "^4.0.0", "mocha": "^6.1.4", - "mockery": "^2.1.0", + "nock": "^10.0.6", "nyc": "^14.0.0", "prettier-standard": "^9.1.1", "sinon": "^7.3.2", From 85837242f3def745331ae2f90b419c1a2c928164 Mon Sep 17 00:00:00 2001 From: Ivan Marban Date: Sat, 22 Jun 2019 10:25:36 +0200 Subject: [PATCH 4/9] Adapt tests --- test/winston-telegram.test.js | 350 +++++++++++++++------------------- 1 file changed, 157 insertions(+), 193 deletions(-) diff --git a/test/winston-telegram.test.js b/test/winston-telegram.test.js index 050b145..582d9d0 100644 --- a/test/winston-telegram.test.js +++ b/test/winston-telegram.test.js @@ -4,30 +4,26 @@ const assert = require('chai').assert const sinon = require('sinon') const Transport = require('../lib/winston-telegram') const winston = require('winston') -const mockery = require('mockery') +const nock = require('nock') describe('winston-telegram', function () { describe('Creating the transport', function () { - it("Should throw an error when 'token' or 'chatId' are undefined", function () { - ;(() => new Transport()).should.throw( - Error, - "winston-telegram requires 'token' and 'chatId' property" - ) + it("Should throw an error when 'token' or 'chatId' are undefined", function (done) { + ;(() => new Transport()).should.throw(Error, "winston-telegram requires 'token' and 'chatId' property") + done() }) - it("Should throw an error when 'formatMessage' is not a function", function () { + it("Should throw an error when 'formatMessage' is not a function", function (done) { ;(() => new Transport({ token: 'foo', chatId: 'bar', formatMessage: 'foo' - })).should.throw( - Error, - "winston-telegram 'formatMessage' property should be function" - ) + })).should.throw(Error, "winston-telegram 'formatMessage' property should be function") + done() }) - it('Should have default options when instantiated', function () { + it('Should have default options when instantiated', function (done) { const transport = new Transport({ token: 'foo', chatId: 'bar' }) assert.ok(transport.level === 'info') @@ -40,9 +36,10 @@ describe('winston-telegram', function () { assert.ok(transport.formatMessage === undefined) assert.ok(transport.batchingDelay === 0) assert.ok(transport.batchingSeparator === '\n\n') + done() }) - it('Should allow options to be set when instantiated', function () { + it('Should allow options to be set when instantiated', function (done) { const transport = new Transport({ name: 'error-channel', token: 'foo', @@ -64,77 +61,74 @@ describe('winston-telegram', function () { assert.ok(transport.name === 'error-channel') assert.ok(transport.template === '{level} -- {message}') assert.ok(typeof transport.formatMessage === 'function') + done() }) - it("Should have a 'log' function", function () { + it("Should have a 'log' function", function (done) { const transport = new Transport({ token: 'foo', chatId: 'bar' }) assert.ok(typeof transport.log === 'function') + done() }) - it("Should have a 'send' function", function () { + it("Should have a 'send' function", function (done) { const transport = new Transport({ token: 'foo', chatId: 'bar' }) assert.ok(typeof transport.send === 'function') + done() + }) + + it("Should have a 'request' function", function (done) { + const transport = new Transport({ token: 'foo', chatId: 'bar' }) + assert.ok(typeof transport.request === 'function') + done() }) - it('Can be registered as winston transport', function () { + it('Can be registered as winston transport', function (done) { const logger = winston.createLogger({ transports: [new Transport({ token: 'foo', chatId: 'bar' })] }) assert.ok(logger._readableState.pipes.hasOwnProperty('token')) + done() }) }) describe('Logging messages', function () { - before(function () { - mockery.enable({ - warnOnReplace: false, - warnOnUnregistered: false, - useCleanCache: true - }) - this.requestStub = sinon.stub() - mockery.registerMock('request', this.requestStub) - this.TelegramTransport = require('../lib/winston-telegram') - this.clock = sinon.useFakeTimers() - }) + let spy, clock beforeEach(function () { winston.remove() - this.requestStub.reset() + clock = sinon.useFakeTimers() + spy = sinon.spy(Transport.prototype, 'request') }) - after(function () { - mockery.disable() - this.clock.restore() + afterEach(function () { + nock.cleanAll() + clock.restore() + if (spy) spy.restore() }) - it("Should send 'error' message", function () { - this.requestStub.yields( - null, - { statusCode: 200 }, - { ok: true, result: {} } - ) + it("Should send 'error' message", function (done) { + nock('https://api.telegram.org') + .post('/botfoo/sendMessage') + .reply(200, { ok: true, result: {} }) winston.add( - new this.TelegramTransport({ + new Transport({ token: 'foo', chatId: 'bar', level: 'error' }) ) winston.log({ level: 'error', message: 'error message' }) - assert.strictEqual( - this.requestStub.getCalls()[0].args[0]['json']['text'], - '[error] error message' - ) + assert.strictEqual(JSON.parse(spy.getCalls()[0].args[1]).text, '[error] error message') + assert.ok(spy.callCount === 1) + done() }) - it("Should send 'verbose' message only", function () { - this.requestStub.yields( - null, - { statusCode: 200 }, - { ok: true, result: {} } - ) + it("Should send 'verbose' message only", function (done) { + nock('https://api.telegram.org') + .post('/botfoo/sendMessage') + .reply(200, { ok: true, result: {} }) winston.add( - new this.TelegramTransport({ + new Transport({ token: 'foo', chatId: 'bar', level: 'verbose', @@ -143,21 +137,18 @@ describe('winston-telegram', function () { ) winston.log({ level: 'verbose', message: 'verbose message' }) winston.log({ level: 'info', message: 'info message' }) - assert.strictEqual( - this.requestStub.getCalls()[0].args[0]['json']['text'], - '[verbose] verbose message' - ) - assert.ok(this.requestStub.callCount === 1) + assert.strictEqual(JSON.parse(spy.getCalls()[0].args[1]).text, '[verbose] verbose message') + assert.ok(spy.callCount === 1) + done() }) - it('Should suppress output', function () { - this.requestStub.yields( - null, - { statusCode: 200 }, - { ok: true, result: {} } - ) + it('Should suppress output', function (done) { + nock('https://api.telegram.org') + .post('/botfoo/sendMessage') + .optionally() + .reply(200, { ok: true, result: {} }) winston.add( - new this.TelegramTransport({ + new Transport({ token: 'foo', chatId: 'bar', level: 'error', @@ -165,17 +156,17 @@ describe('winston-telegram', function () { }) ) winston.log({ level: 'error', message: 'error message' }) - assert.ok(this.requestStub.callCount === 0) + assert.ok(spy.callCount === 0) + done() }) - it('Should send message without notification', function () { - this.requestStub.yields( - null, - { statusCode: 200 }, - { ok: true, result: {} } - ) + it('Should send message without notification', function (done) { + nock('https://api.telegram.org') + .post('/botfoo/sendMessage') + .optionally() + .reply(200, { ok: true, result: {} }) winston.add( - new this.TelegramTransport({ + new Transport({ token: 'foo', chatId: 'bar', level: 'error', @@ -183,30 +174,22 @@ describe('winston-telegram', function () { }) ) winston.log({ level: 'error', message: 'error message' }) - assert.ok(this.requestStub.callCount === 1) - assert.strictEqual( - '[error] error message', - this.requestStub.getCalls()[0].args[0]['json']['text'] - ) - assert.strictEqual( - this.requestStub.getCalls()[0].args[0]['json']['disable_notification'], - true - ) + assert.strictEqual(JSON.parse(spy.getCalls()[0].args[1]).text, '[error] error message') + assert.strictEqual(JSON.parse(spy.getCalls()[0].args[1]).disable_notification, true) + assert.ok(spy.callCount === 1) + done() }) - it('Should send formatted message by template', function () { - this.requestStub.yields( - null, - { statusCode: 200 }, - { ok: true, result: {} } - ) + it('Should send formatted message by template', function (done) { + nock('https://api.telegram.org') + .post('/botfoo/sendMessage') + .reply(200, { ok: true, result: {} }) winston.add( - new this.TelegramTransport({ + new Transport({ token: 'foo', chatId: 'bar', level: 'error', - template: - '[{level}] [{message}] [{metadata.name}] [{metadata.surname}]' + template: '[{level}] [{message}] [{metadata.name}] [{metadata.surname}]' }) ) winston.log({ @@ -214,21 +197,17 @@ describe('winston-telegram', function () { message: 'foo', metadata: { name: 'bar', surname: 'baz' } }) - assert.strictEqual( - this.requestStub.getCalls()[0].args[0]['json']['text'], - '[error] [foo] [bar] [baz]' - ) - assert.ok(this.requestStub.callCount === 1) + assert.strictEqual(JSON.parse(spy.getCalls()[0].args[1]).text, '[error] [foo] [bar] [baz]') + assert.ok(spy.callCount === 1) + done() }) - it('Should send formatted message by custom function', function () { - this.requestStub.yields( - null, - { statusCode: 200 }, - { ok: true, result: {} } - ) + it('Should send formatted message by custom function', function (done) { + nock('https://api.telegram.org') + .post('/botfoo/sendMessage') + .reply(200, { ok: true, result: {} }) winston.add( - new this.TelegramTransport({ + new Transport({ token: 'foo', chatId: 'bar', level: 'error', @@ -242,21 +221,18 @@ describe('winston-telegram', function () { }) ) winston.error('Some error!!') - assert.strictEqual( - this.requestStub.getCalls()[0].args[0]['json']['text'], - '[Error] Some error!!' - ) - assert.ok(this.requestStub.callCount === 1) + assert.strictEqual(JSON.parse(spy.getCalls()[0].args[1]).text, '[Error] Some error!!') + assert.ok(spy.callCount === 1) + done() }) - it('Should send batching of messages', function () { - this.requestStub.yields( - null, - { statusCode: 200 }, - { ok: true, result: {} } - ) + it('Should send batching of messages', function (done) { + nock('https://api.telegram.org') + .post('/botfoo/sendMessage') + .times(2) + .reply(200, { ok: true, result: {} }) winston.add( - new this.TelegramTransport({ + new Transport({ token: 'foo', chatId: 'bar', level: 'info', @@ -271,103 +247,91 @@ describe('winston-telegram', function () { setTimeout(function () { winston.info('Fourth message: ' + new Date().toString()) }, 1500) - this.clock.tick(2500) - expect(this.requestStub.getCalls()[0].args[0]['json']['text']) + clock.tick(2500) + expect(JSON.parse(spy.getCalls()[0].args[1]).text) .to.be.an('string') .that.includes('First message') - expect(this.requestStub.getCalls()[0].args[0]['json']['text']) + expect(JSON.parse(spy.getCalls()[0].args[1]).text) .to.be.an('string') .that.includes('Second message') - expect(this.requestStub.getCalls()[0].args[0]['json']['text']) + expect(JSON.parse(spy.getCalls()[0].args[1]).text) .to.be.an('string') .that.includes('Third message') - expect(this.requestStub.getCalls()[1].args[0]['json']['text']) + expect(JSON.parse(spy.getCalls()[1].args[1]).text) .to.be.an('string') .that.includes('Fourth message') - assert.ok(this.requestStub.callCount === 2) + assert.ok(spy.callCount === 2) + done() }) }) - describe('Handling uncaught exceptions', function () { - // figure out a better way of testing uncaught exceptions since mocha wraps them - before(function () { - mockery.enable({ - warnOnReplace: false, - warnOnUnregistered: false, - useCleanCache: true - }) - this.requestStub = sinon.stub() - mockery.registerMock('request', this.requestStub) - this.TelegramTransport = require('../lib/winston-telegram') - this.clock = sinon.useFakeTimers() - }) - after(function () { - mockery.disable() - this.clock.restore() - }) - - it('Should handle general error', function () { - this.requestStub.yields( - 'error', - { statusCode: 500 }, - { ok: false, result: {} } - ) - winston.exceptions.handle(new winston.transports.Console()) - winston.add( - new this.TelegramTransport({ - token: 'foo', - chatId: 'bar', - level: 'info', - handleExceptions: true - }) - ) - try { - winston.error('foo') - } catch (error) { - expect(error.message) - .to.be.an('string') - .that.contains('error') - } + describe('Emitting errors', function () { + it('Should emit error if request returns an error', function (done) { + nock('https://api.telegram.org') + .post('/botfoo/sendMessage') + .replyWithError('something awful happened') + const transport = new Transport({ + token: 'foo', + chatId: 'bar', + level: 'error' + }) + const logger = winston.createLogger({ + transports: [transport], + exitOnError: false + }) + logger.on('error', function (error) { + expect(error) + .to.be.an.instanceOf(Error) + .that.has.property('message') + .that.is.a('string') + .that.eq('something awful happened') + done() + }) + logger.error('error') }) - it('Should handle statusCode !== 200 error', function () { - this.requestStub.yields(null, { statusCode: 503 }, { description: 'foo' }) - winston.exceptions.handle(new winston.transports.Console()) - winston.add( - new this.TelegramTransport({ - token: 'foo', - chatId: 'bar', - level: 'info', - handleExceptions: true - }) - ) - try { - winston.error('foo') - } catch (error) { - expect(error.message) - .to.be.an('string') - .that.contains('503: foo') - } + it('Should emit error if request returns statusCode !== 200', function (done) { + nock('https://api.telegram.org') + .post('/botfoo/sendMessage') + .reply(500, { ok: false, description: 'something awful happened' }) + const transport = new Transport({ + token: 'foo', + chatId: 'bar', + level: 'error' + }) + const logger = winston.createLogger({ + transports: [transport], + exitOnError: false + }) + logger.on('error', function (error) { + expect(error) + .to.be.a('string') + .that.eq('500: something awful happened') + done() + }) + logger.error('error') }) - it('Should handle statusCode !== 200 error with blank body', function () { - this.requestStub.yields(null, { statusCode: 503 }, {}) - winston.exceptions.handle(new winston.transports.Console()) - winston.add( - new this.TelegramTransport({ - token: 'foo', - chatId: 'bar', - level: 'info', - handleExceptions: true - }) - ) - try { - winston.error('foo') - } catch (error) { - expect(error.message) - .to.be.an('string') - .that.contains('503') - } + it('Should emit error if request returns statusCode !== 200 with empty body', function (done) { + nock('https://api.telegram.org') + .post('/botfoo/sendMessage') + .reply(500, { ok: false, description: null }) + const transport = new Transport({ + token: 'foo', + chatId: 'bar', + level: 'error' + }) + const logger = winston.createLogger({ + transports: [transport], + exitOnError: false + }) + logger.on('error', function (error) { + expect(error) + .to.be.a('string') + .that.eq('500') + done() + }) + logger.error('error') }) }) }) From 3c84de930288a5131fbf4989855330d316582f0b Mon Sep 17 00:00:00 2001 From: Ivan Marban Date: Sat, 22 Jun 2019 10:33:29 +0200 Subject: [PATCH 5/9] Added docker for testing purposes --- Dockerfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bb9afa8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM mhart/alpine-node:6 +WORKDIR /app +COPY . . +RUN npm install +RUN echo $'#!/bin/sh\n\ +sed -i "s/TELEGRAM_TOKEN/$TELEGRAM_TOKEN/g" /app/examples/*\n\ +sed -i "s/CHAT_ID_1/$CHAT_ID/g" /app/examples/*\n\ +sed -i "s/CHAT_ID_2/$CHAT_ID/g" /app/examples/*\n\ +sed -i "s/CHAT_ID/$CHAT_ID/g" /app/examples/*\n\ +files=$(find /app/examples -type f)\n\ +for i in $files\n\ +do\n\ + node $i\n\ + sleep 5\n\ +done'\ +>> /app/start.sh +RUN chmod +x /app/start.sh +CMD ["/bin/sh", "/app/start.sh"] From 650077aebf586905627a03dd251cec8c3466f202 Mon Sep 17 00:00:00 2001 From: Ivan Marban Date: Sat, 22 Jun 2019 10:42:15 +0200 Subject: [PATCH 6/9] Complete JSDoc on lib --- lib/winston-telegram.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/winston-telegram.js b/lib/winston-telegram.js index 0438858..8fc9ec0 100644 --- a/lib/winston-telegram.js +++ b/lib/winston-telegram.js @@ -56,7 +56,7 @@ module.exports = class Telegram extends Transport { /** * Core logging method exposed to Winston. * - * @param {Object} info - TODO: add param description. + * @param {Object} info - An object representing the log message * @param {Function} callback - Continuation to respond to when complete. * @returns {undefined} */ From cfc66f585791065f7a22c5cf87f4c20ecd5dc4b8 Mon Sep 17 00:00:00 2001 From: Ivan Marban Date: Sat, 22 Jun 2019 10:52:12 +0200 Subject: [PATCH 7/9] Update changelod and readme. Bump version number --- CHANGELOG.md | 6 + README.md | 1 + package-lock.json | 458 +++++++++++++++++++++++++++------------------- package.json | 2 +- 4 files changed, 278 insertions(+), 189 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18dfc44..01c2fd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [v2.1.0] - 2019-06-22 +- Replace [Request](https://github.com/request/request) by standard https Node.js lib. +- Fix examples. + ## [v2.0.1] - 2019-04-28 - Code style: ESLint + Standard + Prettier. - Test coverage. @@ -58,6 +62,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [v0.1.0] - 2015-11-12 - First version. +[unreleased]: https://github.com/ivanmarban/winston-telegram/compare/v2.1.0...develop +[v2.1.0]: https://github.com/ivanmarban/winston-telegram/compare/v2.0.1...v2.1.0 [v2.0.1]: https://github.com/ivanmarban/winston-telegram/compare/v2.0.0...v2.0.1 [v2.0.0]: https://github.com/ivanmarban/winston-telegram/compare/v1.3.1...v2.0.0 [v1.3.1]: https://github.com/ivanmarban/winston-telegram/compare/v1.3.0...v1.3.1 diff --git a/README.md b/README.md index e14379f..9ebb205 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ A [Telegram][0] transport for [winston][1]. [![Coverage Status](https://coveralls.io/repos/github/ivanmarban/winston-telegram/badge.svg?branch=master)](https://coveralls.io/github/ivanmarban/winston-telegram?branch=master) [![dependencies Status](https://david-dm.org/ivanmarban/winston-telegram/status.svg)](https://david-dm.org/ivanmarban/winston-telegram) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) +[![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SJLW6PTHQQNBS) ## winston-telegram@2 diff --git a/package-lock.json b/package-lock.json index 5aac430..a08e58f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "winston-telegram", - "version": "2.0.1", + "version": "2.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -67,9 +67,9 @@ } }, "@babel/parser": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.4.tgz", - "integrity": "sha512-5pCS4mOsL+ANsFZGdvNLybx4wtqAZJ0MJjMHxvzI3bvIsz6sQvzW8XX92EYIkiPtIvcfG3Aj+Ir5VNyjnZhP7w==", + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.5.tgz", + "integrity": "sha512-9mUqkL1FF5T7f0WDFfAoDdiMVPWsdD1gZYzSnaXsxUCUqzuch/8of9G3VUSNiZmMBoRxT3neyVsqeiL/ZPcjew==", "dev": true }, "@babel/template": { @@ -84,16 +84,16 @@ } }, "@babel/traverse": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.4.tgz", - "integrity": "sha512-Gw6qqkw/e6AGzlyj9KnkabJX7VcubqPtkUQVAwkc0wUMldr3A/hezNB3Rc5eIvId95iSGkGIOe5hh1kMKf951A==", + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.5.tgz", + "integrity": "sha512-Vc+qjynwkjRmIFGxy0KYoPj4FdVDxLej89kMHFsWScq999uX+pwcX4v9mWRjW0KcAYTPAuVQl2LKP1wEVLsp+A==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", "@babel/generator": "^7.4.4", "@babel/helper-function-name": "^7.1.0", "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.4.4", + "@babel/parser": "^7.4.5", "@babel/types": "^7.4.4", "debug": "^4.1.0", "globals": "^11.1.0", @@ -131,9 +131,9 @@ } }, "@sinonjs/samsam": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.3.1.tgz", - "integrity": "sha512-wRSfmyd81swH0hA1bxJZJ57xr22kC07a1N4zuIL47yTS04bDk6AoCkczcqHEjcRPmJ+FruGJ9WBQiJwMtIElFw==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.3.2.tgz", + "integrity": "sha512-ILO/rR8LfAb60Y1Yfp9vxfYAASK43NFC2mLzpvLUbCQY/Qu8YwReboseu8aheCEkyElZF2L2T9mHcR2bgdvZyA==", "dev": true, "requires": { "@sinonjs/commons": "^1.0.2", @@ -163,6 +163,7 @@ "version": "6.10.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", + "dev": true, "requires": { "fast-deep-equal": "^2.0.1", "fast-json-stable-stringify": "^2.0.0", @@ -337,6 +338,7 @@ "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, "requires": { "safer-buffer": "~2.1.0" } @@ -344,7 +346,8 @@ "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true }, "assertion-error": { "version": "1.1.0", @@ -370,17 +373,20 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true }, "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true }, "aws4": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "dev": true }, "babel-runtime": { "version": "6.26.0", @@ -402,6 +408,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, "requires": { "tweetnacl": "^0.14.3" } @@ -449,7 +456,8 @@ "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true }, "center-align": { "version": "0.1.3", @@ -587,9 +595,10 @@ } }, "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==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, "requires": { "delayed-stream": "~1.0.0" } @@ -602,9 +611,9 @@ "optional": true }, "comment-parser": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-0.5.4.tgz", - "integrity": "sha512-0h7W6Y1Kb6zKQMJqdX41C5qf9ITCVIsD2qP2RaqDF3GFkXFrmuAuv5zUOuo19YzyC9scjBNpqzuaRQ2Sy5pxMQ==", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-0.5.5.tgz", + "integrity": "sha512-oB3TinFT+PV3p8UwDQt71+HkG03+zwPwikDlKU6ZDmql6QX2zFlQ+G0GGSDqyJhdZi4PSlzFBm+YJ+ebOX3Vgw==", "dev": true }, "commondir": { @@ -635,9 +644,9 @@ } }, "core-js": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz", - "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==", + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz", + "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==", "dev": true }, "core-util-is": { @@ -646,9 +655,9 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, "coveralls": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.0.3.tgz", - "integrity": "sha512-viNfeGlda2zJr8Gj1zqXpDMRjw9uM54p7wzZdvLRyOgnAfCe974Dq4veZkjJdxQXbmdppu6flEajFYseHYaUhg==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.0.4.tgz", + "integrity": "sha512-eyqUWA/7RT0JagiL0tThVhjbIjoiEUyWCjtUJoOPcWoeofP5WK/jb2OJYoBFrR6DvplR+AxOyuBqk4JHkk5ykA==", "dev": true, "requires": { "growl": "~> 1.10.0", @@ -657,14 +666,6 @@ "log-driver": "^1.2.7", "minimist": "^1.2.0", "request": "^2.86.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } } }, "cp-file": { @@ -705,6 +706,7 @@ "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, "requires": { "assert-plus": "^1.0.0" } @@ -733,6 +735,12 @@ "type-detect": "^4.0.0" } }, + "deep-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", + "dev": true + }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -760,7 +768,8 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true }, "diagnostics": { "version": "1.1.1", @@ -792,6 +801,7 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, "requires": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -988,9 +998,9 @@ } }, "eslint-plugin-import": { - "version": "2.17.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.17.2.tgz", - "integrity": "sha512-m+cSVxM7oLsIpmwNn2WXTJoReOF9f/CtLMo7qOVmKd1KntBy0hEcuNZ3erTmWjx+DxRO0Zcrm5KwAvI9wHcV5g==", + "version": "2.17.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.17.3.tgz", + "integrity": "sha512-qeVf/UwXFJbeyLbxuY8RgqDyEKCkqV7YC+E5S5uOjAp4tOc8zj01JP3ucoBM8JcEqd1qRasJSg6LLlisirfy0Q==", "dev": true, "requires": { "array-includes": "^3.0.3", @@ -1003,7 +1013,7 @@ "lodash": "^4.17.11", "minimatch": "^3.0.4", "read-pkg-up": "^2.0.0", - "resolve": "^1.10.0" + "resolve": "^1.11.0" }, "dependencies": { "debug": { @@ -1034,9 +1044,9 @@ } }, "eslint-plugin-jsdoc": { - "version": "4.8.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-4.8.3.tgz", - "integrity": "sha512-lKOaphUUzv0qKJrAdEwQGEWcNN2Foae5W111u1ASKQeliyJkKXCVxia0dakATuI/s2ojr6Q3FVzWwT6uE1icBg==", + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-4.8.4.tgz", + "integrity": "sha512-VDP+BI2hWpKNNdsJDSPofSQ9q7jGLgWbDMI0LzOeEcfsTjSS7jQtHDUuVLQ5E+OV2MPyQPk/3lnVcHfStXk5yA==", "dev": true, "requires": { "comment-parser": "^0.5.4", @@ -1068,9 +1078,9 @@ }, "dependencies": { "ignore": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.1.tgz", - "integrity": "sha512-DWjnQIFLenVrwyRCKZT+7a7/U4Cqgar4WG8V++K3hw+lrW1hc/SIwdiGmtxKCVACmHULTuGeBbHJmbwW7/sAvA==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.2.tgz", + "integrity": "sha512-vdqWBp7MyzdmHkkRWV5nY+PfGRbYbahfuvsBCh277tq+w9zyNi7h5CYJCK0kmzti9kU+O/cB7sE8HvKv6aXAKQ==", "dev": true } } @@ -1187,7 +1197,8 @@ "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true }, "external-editor": { "version": "3.0.3", @@ -1203,17 +1214,20 @@ "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true }, "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=" + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "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=" + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true }, "fast-levenshtein": { "version": "2.0.6", @@ -1404,12 +1418,14 @@ "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true }, "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==", + "dev": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -1465,14 +1481,15 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, "requires": { "assert-plus": "^1.0.0" } }, "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -1484,9 +1501,9 @@ } }, "globals": { - "version": "11.11.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz", - "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==", + "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 }, "graceful-fs": { @@ -1524,12 +1541,14 @@ "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true }, "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==", + "dev": true, "requires": { "ajv": "^6.5.5", "har-schema": "^2.0.0" @@ -1586,6 +1605,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, "requires": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", @@ -1634,14 +1654,14 @@ } }, "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "inquirer": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.3.1.tgz", - "integrity": "sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.4.1.tgz", + "integrity": "sha512-/Jw+qPZx4EDYsaT6uz7F4GJRNFMRdKNeUZw3ZnKV8lyuUgz/YWRCSUAJMZSVhSq4Ec0R2oYnyi6b3d4JXcL5Nw==", "dev": true, "requires": { "ansi-escapes": "^3.2.0", @@ -1775,7 +1795,8 @@ "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true }, "isarray": { "version": "1.0.0", @@ -1796,55 +1817,56 @@ "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true }, "istanbul-lib-coverage": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", - "integrity": "sha512-LXTBICkMARVgo579kWDm8SqfB6nvSDKNqIOBEjmJRnL04JvoMHCYGWaMddQnseJYtkEuEvO/sIcOxPLk9gERug==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", "dev": true }, "istanbul-lib-hook": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.6.tgz", - "integrity": "sha512-829DKONApZ7UCiPXcOYWSgkFXa4+vNYoNOt3F+4uDJLKL1OotAoVwvThoEj1i8jmOj7odbYcR3rnaHu+QroaXg==", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.7.tgz", + "integrity": "sha512-vrRztU9VRRFDyC+aklfLoeXyNdTfga2EI3udDGn4cZ6fpSXpHLV9X6CHvfoMCPtggg8zvDDmC4b9xfu0z6/llA==", "dev": true, "requires": { "append-transform": "^1.0.0" } }, "istanbul-lib-instrument": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.2.0.tgz", - "integrity": "sha512-06IM3xShbNW4NgZv5AP4QH0oHqf1/ivFo8eFys0ZjPXHGldHJQWb3riYOKXqmOqfxXBfxu4B+g/iuhOPZH0RJg==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz", + "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", "dev": true, "requires": { - "@babel/generator": "^7.0.0", - "@babel/parser": "^7.0.0", - "@babel/template": "^7.0.0", - "@babel/traverse": "^7.0.0", - "@babel/types": "^7.0.0", - "istanbul-lib-coverage": "^2.0.4", + "@babel/generator": "^7.4.0", + "@babel/parser": "^7.4.3", + "@babel/template": "^7.4.0", + "@babel/traverse": "^7.4.3", + "@babel/types": "^7.4.0", + "istanbul-lib-coverage": "^2.0.5", "semver": "^6.0.0" }, "dependencies": { "semver": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz", - "integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.1.1.tgz", + "integrity": "sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ==", "dev": true } } }, "istanbul-lib-report": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.7.tgz", - "integrity": "sha512-wLH6beJBFbRBLiTlMOBxmb85cnVM1Vyl36N48e4e/aTKSM3WbOx7zbVIH1SQ537fhhsPbX0/C5JB4qsmyRXXyA==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz", + "integrity": "sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==", "dev": true, "requires": { - "istanbul-lib-coverage": "^2.0.4", + "istanbul-lib-coverage": "^2.0.5", "make-dir": "^2.1.0", - "supports-color": "^6.0.0" + "supports-color": "^6.1.0" }, "dependencies": { "supports-color": { @@ -1859,15 +1881,15 @@ } }, "istanbul-lib-source-maps": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.5.tgz", - "integrity": "sha512-eDhZ7r6r1d1zQPVZehLc3D0K14vRba/eBYkz3rw16DLOrrTzve9RmnkcwrrkWVgO1FL3EK5knujVe5S8QHE9xw==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz", + "integrity": "sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==", "dev": true, "requires": { "debug": "^4.1.1", - "istanbul-lib-coverage": "^2.0.4", + "istanbul-lib-coverage": "^2.0.5", "make-dir": "^2.1.0", - "rimraf": "^2.6.2", + "rimraf": "^2.6.3", "source-map": "^0.6.1" }, "dependencies": { @@ -1880,12 +1902,12 @@ } }, "istanbul-reports": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.3.tgz", - "integrity": "sha512-T6EbPuc8Cb620LWAYyZ4D8SSn06dY9i1+IgUX2lTH8gbwflMc9Obd33zHTyNX653ybjpamAHS9toKS3E6cGhTw==", + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.6.tgz", + "integrity": "sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA==", "dev": true, "requires": { - "handlebars": "^4.1.0" + "handlebars": "^4.1.2" } }, "js-tokens": { @@ -1907,7 +1929,8 @@ "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true }, "jsdoctypeparser": { "version": "3.1.0", @@ -1930,12 +1953,14 @@ "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -1946,12 +1971,14 @@ "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=" + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, "requires": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -2075,9 +2102,9 @@ } }, "lolex": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.0.1.tgz", - "integrity": "sha512-UHuOBZ5jjsKuzbB/gRNNW8Vg8f00Emgskdq2kvZxgBJCS0aqquAuXai/SkWORlKeZEiNQWZjFZOqIUcH9LqKCw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.1.0.tgz", + "integrity": "sha512-BYxIEXiVq5lGIXeVHnsFzqa1TxN5acnKnPCdlZSpzm8viNEOhiigupA4vTQ9HEFQ6nLTQ9wQOgBknJgzUYQ9Aw==", "dev": true }, "longest": { @@ -2179,12 +2206,14 @@ "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==" + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", + "dev": true }, "mime-types": { "version": "2.1.24", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "dev": true, "requires": { "mime-db": "1.40.0" } @@ -2205,9 +2234,9 @@ } }, "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, "mkdirp": { @@ -2217,6 +2246,14 @@ "dev": true, "requires": { "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } } }, "mocha": { @@ -2268,6 +2305,20 @@ "locate-path": "^3.0.0" } }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -2278,6 +2329,12 @@ "path-exists": "^3.0.0" } }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, "p-limit": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", @@ -2313,16 +2370,10 @@ } } }, - "mockery": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mockery/-/mockery-2.1.0.tgz", - "integrity": "sha512-9VkOmxKlWXoDO/h1jDZaS4lH33aWfRiJiNT/tKj+8OGzrcFDLo8d0syGdbsc3Bc4GvRXPb+NMMvojotmuGJTvA==", - "dev": true - }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, "mute-stream": { @@ -2338,9 +2389,9 @@ "dev": true }, "neo-async": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.0.tgz", - "integrity": "sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", + "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", "dev": true }, "nested-error-stacks": { @@ -2356,24 +2407,33 @@ "dev": true }, "nise": { - "version": "1.4.10", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.4.10.tgz", - "integrity": "sha512-sa0RRbj53dovjc7wombHmVli9ZihXbXCQ2uH3TNm03DyvOSIQbxg+pbqDKrk2oxMK1rtLGVlKxcB9rrc6X5YjA==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.0.tgz", + "integrity": "sha512-Z3sfYEkLFzFmL8KY6xnSJLRxwQwYBjOXi/24lb62ZnZiGA0JUzGGTI6TBIgfCSMIDl9Jlu8SRmHNACLTemDHww==", "dev": true, "requires": { "@sinonjs/formatio": "^3.1.0", "@sinonjs/text-encoding": "^0.7.1", "just-extend": "^4.0.2", - "lolex": "^2.3.2", + "lolex": "^4.1.0", "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 - } + } + }, + "nock": { + "version": "10.0.6", + "resolved": "https://registry.npmjs.org/nock/-/nock-10.0.6.tgz", + "integrity": "sha512-b47OWj1qf/LqSQYnmokNWM8D88KvUl2y7jT0567NB3ZBAZFz2bWp2PC81Xn7u8F2/vJxzkzNZybnemeFa7AZ2w==", + "dev": true, + "requires": { + "chai": "^4.1.2", + "debug": "^4.1.0", + "deep-equal": "^1.0.0", + "json-stringify-safe": "^5.0.1", + "lodash": "^4.17.5", + "mkdirp": "^0.5.0", + "propagate": "^1.0.0", + "qs": "^6.5.1", + "semver": "^5.5.0" } }, "node-environment-flags": { @@ -2414,9 +2474,9 @@ "dev": true }, "nyc": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-14.0.0.tgz", - "integrity": "sha512-R1zC6UZak6pzn5BZQorkSH5GdOGafrwyeja+eimS5Tu+KJ/hCgBc8qA1QWSzxQmT2FDl2lbpqPw7tBDbSvhAHg==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-14.1.1.tgz", + "integrity": "sha512-OI0vm6ZGUnoGZv/tLdZ2esSVzDwUC88SNs+6JoSOMVxA+gKMB8Tk7jBwgemLx4O40lhhvZCVw1C+OYLOBOPXWw==", "dev": true, "requires": { "archy": "^1.0.0", @@ -2427,19 +2487,20 @@ "find-up": "^3.0.0", "foreground-child": "^1.5.6", "glob": "^7.1.3", - "istanbul-lib-coverage": "^2.0.4", - "istanbul-lib-hook": "^2.0.6", - "istanbul-lib-instrument": "^3.2.0", - "istanbul-lib-report": "^2.0.7", - "istanbul-lib-source-maps": "^3.0.5", - "istanbul-reports": "^2.2.2", + "istanbul-lib-coverage": "^2.0.5", + "istanbul-lib-hook": "^2.0.7", + "istanbul-lib-instrument": "^3.3.0", + "istanbul-lib-report": "^2.0.8", + "istanbul-lib-source-maps": "^3.0.6", + "istanbul-reports": "^2.2.4", + "js-yaml": "^3.13.1", "make-dir": "^2.1.0", "merge-source-map": "^1.1.0", "resolve-from": "^4.0.0", "rimraf": "^2.6.3", "signal-exit": "^3.0.2", "spawn-wrap": "^1.4.2", - "test-exclude": "^5.2.2", + "test-exclude": "^5.2.3", "uuid": "^3.3.2", "yargs": "^13.2.2", "yargs-parser": "^13.0.0" @@ -2493,7 +2554,8 @@ "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true }, "object-keys": { "version": "1.1.1", @@ -2619,6 +2681,12 @@ "wordwrap": "~0.0.2" }, "dependencies": { + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + }, "wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", @@ -2801,7 +2869,8 @@ "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true }, "pify": { "version": "2.3.0", @@ -2856,12 +2925,6 @@ "path-exists": "^3.0.0" } }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, "p-limit": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", @@ -2895,9 +2958,9 @@ "dev": true }, "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + "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", @@ -2905,6 +2968,12 @@ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, + "propagate": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/propagate/-/propagate-1.0.0.tgz", + "integrity": "sha1-AMLa7t2iDofjeCs0Stuhzd1q1wk=", + "dev": true + }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", @@ -2912,9 +2981,10 @@ "dev": true }, "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==" + "version": "1.1.33", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.33.tgz", + "integrity": "sha512-LTDP2uSrsc7XCb5lO7A8BI1qYxRe/8EqlRvMeEl6rsnYAqDOl8xHR+8lSAIVfrNaSAlTPTNOCgNjWcoUL3AZsw==", + "dev": true }, "pump": { "version": "3.0.0", @@ -2929,12 +2999,14 @@ "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true }, "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-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true }, "ramda": { "version": "0.26.1", @@ -3007,6 +3079,7 @@ "version": "2.88.0", "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "dev": true, "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -3043,9 +3116,9 @@ "dev": true }, "resolve": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.1.tgz", - "integrity": "sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", + "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -3094,9 +3167,9 @@ } }, "rxjs": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.1.tgz", - "integrity": "sha512-y0j31WJc83wPu31vS1VlAFW5JGrnGC+j+TtGAa1fRQphy48+fDYiDmX8tjGloToEsMkxnouOg/1IzXGKkJnZMg==", + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz", + "integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==", "dev": true, "requires": { "tslib": "^1.9.0" @@ -3110,7 +3183,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 }, "semver": { "version": "5.7.0", @@ -3258,6 +3332,7 @@ "version": "1.16.1", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dev": true, "requires": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -3345,9 +3420,9 @@ } }, "table": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/table/-/table-5.2.3.tgz", - "integrity": "sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.1.tgz", + "integrity": "sha512-E6CK1/pZe2N75rGZQotFOdmzWQ1AILtgYbMAbAjvms0S1l5IDB47zG3nCnFGB/w+7nB3vKofbLXCH7HPBo864w==", "dev": true, "requires": { "ajv": "^6.9.1", @@ -3385,9 +3460,9 @@ } }, "test-exclude": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.2.tgz", - "integrity": "sha512-N2pvaLpT8guUpb5Fe1GJlmvmzH3x+DAKmmyEQmFP792QcLYoGE1syxztSvPD1V8yPe6VrcCt6YGQVjSRjCASsA==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz", + "integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==", "dev": true, "requires": { "glob": "^7.1.3", @@ -3536,6 +3611,7 @@ "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==", + "dev": true, "requires": { "psl": "^1.1.24", "punycode": "^1.4.1" @@ -3544,7 +3620,8 @@ "punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true } } }, @@ -3560,15 +3637,16 @@ "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" }, "tslib": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", - "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", + "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", "dev": true }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, "requires": { "safe-buffer": "^5.0.1" } @@ -3576,7 +3654,8 @@ "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true }, "type-check": { "version": "0.3.2", @@ -3594,9 +3673,9 @@ "dev": true }, "uglify-js": { - "version": "3.5.9", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.9.tgz", - "integrity": "sha512-WpT0RqsDtAWPNJK955DEnb6xjymR8Fn0OlK4TT4pS0ASYsVPqr5ELhgwOwLCP5J5vHeJ4xmMmz3DEgdqC10JeQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", + "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==", "dev": true, "optional": true, "requires": { @@ -3617,6 +3696,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" } @@ -3662,7 +3742,8 @@ "uuid": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true }, "validate-npm-package-license": { "version": "3.0.4", @@ -3678,6 +3759,7 @@ "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, "requires": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", @@ -3726,9 +3808,9 @@ }, "dependencies": { "readable-stream": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz", - "integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.4.0.tgz", + "integrity": "sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==", "dev": true, "requires": { "inherits": "^2.0.3", @@ -3821,9 +3903,9 @@ } }, "write-file-atomic": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.2.tgz", - "integrity": "sha512-s0b6vB3xIVRLWywa6X9TOMA7k9zio0TMOsl9ZnDkliA/cfJlpHXAscj0gbHVJiTdIuAYpIyqS5GW91fqm6gG5g==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", "dev": true, "requires": { "graceful-fs": "^4.1.11", diff --git a/package.json b/package.json index 56fe67a..1dd69a5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "winston-telegram", "description": "A Telegram transport for winston", - "version": "2.0.1", + "version": "2.1.0", "author": "Ivan Marban", "repository": { "type": "git", From f9b1007647ea31e34ec3f41d87d1d9576ee75b0c Mon Sep 17 00:00:00 2001 From: Ivan Marban Date: Sat, 22 Jun 2019 10:57:02 +0200 Subject: [PATCH 8/9] Update readme --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9ebb205..2a26c39 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,18 @@ String template is based on named arguments: ## Examples -Take a look at the [examples][3] +Follow below steps to run the examples: + +``` sh +$ git clone git@github.com:ivanmarban/winston-telegram.git -b master --single-branch +$ npm install +``` + +Replace `TELEGRAM_TOKEN` and `CHAT_ID` with appropiate values, then run whatever example you want: + +``` sh +$ node examples/default-logger.js +``` [0]: https://telegram.org/ [1]: https://github.com/flatiron/winston From e90ca4ab2c9bdee6c7e75e8dd6c8105b5743a81b Mon Sep 17 00:00:00 2001 From: Ivan Marban Date: Sat, 22 Jun 2019 11:12:24 +0200 Subject: [PATCH 9/9] Update dev dependencies. Fix JSDoc --- lib/winston-telegram.js | 6 +++--- package-lock.json | 44 +++++++++++++++++++++++++++-------------- package.json | 4 ++-- 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/lib/winston-telegram.js b/lib/winston-telegram.js index 8fc9ec0..e5fd3b4 100644 --- a/lib/winston-telegram.js +++ b/lib/winston-telegram.js @@ -56,7 +56,7 @@ module.exports = class Telegram extends Transport { /** * Core logging method exposed to Winston. * - * @param {Object} info - An object representing the log message + * @param {object} info - An object representing the log message. * @param {Function} callback - Continuation to respond to when complete. * @returns {undefined} */ @@ -137,8 +137,8 @@ module.exports = class Telegram extends Transport { * Performs a https request to a server. * * @function request - * @param {Object} options - Request options. - * @param {Object} requestData - Request data. + * @param {object} options - Request options. + * @param {object} requestData - Request data. * @param {Function} callback - Continuation to respond to when complete. * @private */ diff --git a/package-lock.json b/package-lock.json index a08e58f..5943748 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1044,13 +1044,15 @@ } }, "eslint-plugin-jsdoc": { - "version": "4.8.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-4.8.4.tgz", - "integrity": "sha512-VDP+BI2hWpKNNdsJDSPofSQ9q7jGLgWbDMI0LzOeEcfsTjSS7jQtHDUuVLQ5E+OV2MPyQPk/3lnVcHfStXk5yA==", + "version": "8.4.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-8.4.3.tgz", + "integrity": "sha512-5vz6pVP+ZqiRmwfh/sWQxcRSj/uWsB8fYfgwtWhr/48wcSN3Lo6btWbMfP5I7GFc6D5TzdyhvMELcth7WPQ3hg==", "dev": true, "requires": { - "comment-parser": "^0.5.4", - "jsdoctypeparser": "3.1.0", + "comment-parser": "^0.5.5", + "debug": "^4.1.1", + "flat-map-polyfill": "^0.3.8", + "jsdoctypeparser": "4.0.0", "lodash": "^4.17.11" } }, @@ -1064,17 +1066,17 @@ } }, "eslint-plugin-node": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-8.0.1.tgz", - "integrity": "sha512-ZjOjbjEi6jd82rIpFSgagv4CHWzG9xsQAVp1ZPlhRnnYxcTgENUVBvhYmkQ7GvT1QFijUSo69RaiOJKhMu6i8w==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-9.1.0.tgz", + "integrity": "sha512-ZwQYGm6EoV2cfLpE1wxJWsfnKUIXfM/KM09/TlorkukgCAwmkgajEJnPCmyzoFPQQkmvo5DrW/nyKutNIw36Mw==", "dev": true, "requires": { - "eslint-plugin-es": "^1.3.1", + "eslint-plugin-es": "^1.4.0", "eslint-utils": "^1.3.1", - "ignore": "^5.0.2", + "ignore": "^5.1.1", "minimatch": "^3.0.4", - "resolve": "^1.8.1", - "semver": "^5.5.0" + "resolve": "^1.10.1", + "semver": "^6.1.0" }, "dependencies": { "ignore": { @@ -1082,6 +1084,12 @@ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.2.tgz", "integrity": "sha512-vdqWBp7MyzdmHkkRWV5nY+PfGRbYbahfuvsBCh277tq+w9zyNi7h5CYJCK0kmzti9kU+O/cB7sE8HvKv6aXAKQ==", "dev": true + }, + "semver": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.1.1.tgz", + "integrity": "sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ==", + "dev": true } } }, @@ -1367,6 +1375,12 @@ "write": "1.0.3" } }, + "flat-map-polyfill": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/flat-map-polyfill/-/flat-map-polyfill-0.3.8.tgz", + "integrity": "sha512-ZfmD5MnU7GglUEhiky9C7yEPaNq1/wh36RDohe+Xr3nJVdccwHbdTkFIYvetcdsoAckUKT51fuf44g7Ni5Doyg==", + "dev": true + }, "flatted": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.0.tgz", @@ -1933,9 +1947,9 @@ "dev": true }, "jsdoctypeparser": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-3.1.0.tgz", - "integrity": "sha512-JNbkKpDFqbYjg+IU3FNo7qjX7Opy7CwjHywT32zgAcz/d4lX6Umn5jOHVETUdnNNgGrMk0nEx1gvP0F4M0hzlQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-4.0.0.tgz", + "integrity": "sha512-Bh6AW8eJ1bVdofhYUuqgFOVo0FE9qII+a+Go+juEnAfaDS5lZAiIqBAFm9gDu80OqBcQ1UI3v/8cP+3D5IGVww==", "dev": true }, "jsesc": { diff --git a/package.json b/package.json index 1dd69a5..2babf94 100644 --- a/package.json +++ b/package.json @@ -36,9 +36,9 @@ "eslint": "^5.16.0", "eslint-config-standard": "^12.0.0", "eslint-plugin-import": "^2.17.2", - "eslint-plugin-jsdoc": "^4.8.3", + "eslint-plugin-jsdoc": "^8.4.3", "eslint-plugin-mocha": "^5.3.0", - "eslint-plugin-node": "^8.0.1", + "eslint-plugin-node": "^9.1.0", "eslint-plugin-promise": "^4.1.1", "eslint-plugin-standard": "^4.0.0", "mocha": "^6.1.4",