diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..d0ec255 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false + diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..cad047a --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,17 @@ +module.exports = { + env: { + node: true, + commonjs: true, + es2021: true, + }, + extends: 'eslint:recommended', + parserOptions: { + ecmaVersion: 12, + }, + rules: { + indent: ['error', 2], + 'linebreak-style': ['error', 'unix'], + quotes: ['error', 'single'], + semi: ['error', 'always'], + }, +}; diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..bec1ad2 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,33 @@ +## Description + + + +## Motivation and Context + + + + +## How Has This Been Tested? + + + + + +## Screenshots (if appropriate): + +## Types of changes + + + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to change) + +## Checklist: + + + + +- [ ] My code follows the code style of this project. +- [ ] I have added tests to cover my changes. +- [ ] All new and existing tests passed. diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml new file mode 100644 index 0000000..428bdc6 --- /dev/null +++ b/.github/workflows/actions.yml @@ -0,0 +1,35 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + name: Lint and Test + steps: + - uses: actions/checkout@v2 + name: Check out repository + - uses: actions/setup-node@v2 + name: Setup Node.js + with: + node-version: '14.17.5' + - run: | + cp lib/config/config.json.sample lib/config/config.json + name: Setting up configuration + - run: | + npm ci + name: Installing Dependencies + - run: | + npm run eslint + name: Running ESLint checks on source + - run: | + npm run eslint:test + name: Running ESLint checks on tests + - run: | + npm run test + name: Running tests diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e4435a8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +node_modules +tmp/ +config.json +.nyc_output +logs/ diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..e8e2d57 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v14.17.5 diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..aaa2cc8 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +logs/ +.github/ +.nyc_output/ +.vscode/ diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..916ffb9 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,8 @@ +{ + "singleQuote": true, + "tabWidth": 2, + "endOfLine": "lf", + "semi": true, + "trailingComma": "es5", + "useTabs": false +} diff --git a/.rotate.js b/.rotate.js new file mode 100644 index 0000000..5eeb04a --- /dev/null +++ b/.rotate.js @@ -0,0 +1,12 @@ +module.exports = { + filter(data) { + return data.req; + }, + output: { + path: './proxy.log', + options: { + path: './logs', + interval: '1d', + }, + }, +}; diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..534143c --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,17 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "pwa-node", + "request": "launch", + "name": "ws-reconnect-proxy", + "skipFiles": ["/**"], + "program": "${workspaceFolder}/cluster.js", + "outputCapture": "std", + "console": "internalConsole", + "env": { + "NODE_ENV": "dev" + } + } + ] +} diff --git a/README.md b/README.md index a05123b..d8b239a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,72 @@ # ws-reconnect-proxy -Proxy Server that is between a ws server and a ws client. In case of either server / client disconnects graceful or otherwise - initiates/ supports reconnection . + +Proxy Server that is between a ws server and a ws client. In case of either server / client disconnects graceful or otherwise - initiates/ supports reconnection. + +Read more about [📝 design](docs/design.md) + +### README Contents: + +- [How to contribute](#how-to-contribute) +- [Development Internals](#development-internals) + +### ✨ How to contribute + +We are very happy to receive and merge your contributions into this repository! + +To contribute via pull request, follow these steps: + +1. Create an issue describing the feature you want to work on (or + have a look at the [issues](https://github.com/browserstack/ws-reconnect-proxy/issues)) +2. Write your code, tests and format them with `npm run format` +3. Create a pull request describing your changes + +Your pull request will be reviewed by a maintainer, who will get +back to you about any necessary changes or questions. + +## ⚡️ Development Internals + +### 🔨 Installing Dependencies + +To install dependencies + +```bash +npm install +``` + +### ✅ Running the Tests + +In order to run the tests, make sure that you have installed dependencies: + +```bash +npm run test +``` + +### 🎨 Formatting + +To reformat files execute + +```bash +npm run format +``` + +### 🚀 Run proxy + +🔧 Before, executing proxy create the `config.json` by running the following command: + +```bash +cp lib/config/config.json.sample lib/config/config.json +``` + +Additionally, you can configuration your proxy based on your needs. Refer here - [config.json.sample](lib/config/config.json.sample) + +Then execute proxy by running the following command: + +```bash +npm run start +``` + +_NOTE: By default it runs in `dev` environment you can configure your env by the following command:_ + +```bash +NODE_ENV= node cluster.js +``` diff --git a/cluster.js b/cluster.js new file mode 100644 index 0000000..b768306 --- /dev/null +++ b/cluster.js @@ -0,0 +1,69 @@ +'use strict'; + +const cluster = require('cluster'); +const { config } = require('./lib/config/constants.js'); +const { watch } = require('fs'); +const logger = require('./lib/util/loggerFactory.js'); +const Proxy = require('./lib/core/Proxy.js'); + +const WORKER_CNT = config.workerVal; +const activeWorkers = []; + +const path = require('path'); + +const RESTART_FILE = path.join(__dirname, 'tmp', 'restart.txt'); + +const forceKill = (worker) => { + if (!worker.isDead()) { + logger.info(`Worker ${worker.process.pid} is ${worker.state}, Killing it`); + worker.kill('SIGUSR2'); + } +}; + +const disconnectOldWorkers = () => { + const len = activeWorkers.length; + for (let i = 0; i < len; i++) { + const oldWorker = activeWorkers.shift(); + oldWorker.disconnect(); + setTimeout(() => forceKill(oldWorker), config.workerKillTimer); + } +}; + +const spawnNewWorkers = () => { + if (cluster.isMaster) { + for (let i = 0; i < WORKER_CNT; ++i) { + const worker = cluster.fork(); + worker.on('error', (err) => { + logger.error(`Received error event on ${worker.id} : ${err}`); + }); + logger.info(`Created worker with id ${worker.id}`); + activeWorkers.push(worker); + } + } +}; + +if (cluster.isMaster) { + cluster.on('online', function (worker) { + logger.info(`Worker ${worker.process.pid} is online`); + }); + + cluster.on('exit', (worker, code, signal) => { + logger.info( + `worker ${worker.process.pid} died with signal ${signal} code ${code}` + ); + if (activeWorkers.length == 0) spawnNewWorkers(); + }); + + spawnNewWorkers(); + + let currTime = Date.now(); + watch(RESTART_FILE, () => { + if (Date.now() > currTime) { + currTime = Date.now(); + disconnectOldWorkers(); + spawnNewWorkers(); + } + }); +} else { + new Proxy(); +} diff --git a/docs/design.md b/docs/design.md new file mode 100644 index 0000000..8d3e95a --- /dev/null +++ b/docs/design.md @@ -0,0 +1,134 @@ +# High Level Design + +WebSocket reconnect proxy as the name suggest it as a mediator between two client & server. The proxy receives the message from client and sends message to server. + +To get clear understanding lets define following entities - + +1. Client - Who sends data to proxy via websocket connection. +2. Proxy - Who receives the data from client & sends the message to upstream. +3. Server - Who receives data sent by the proxy over websocket connection. + +``` +|-----------| |-----------| |-----------| +| CLIENT |<--->| PROXY |<--->| SERVER | +|-----------| |-----------| |-----------| +``` + +# Low Level Design + +As we know, proxy sits between client & the server. Proxy job is to deliver messages back & forth to both of the parties. + +## Constraints - + +1. It should send and receive messages from client & server. +2. It should handle disconnects & retry / reconnect. + +## Scenarios - + +### 1. Client & Server connect + +When client is connected it registers itself and proxy connects to the server. Once connection are established successfully client is ready to send messages as well as server is ready to send message. + +> Connection between client and the proxy aka `IncomingSocket`
+> Connection between proxy and the server aka `OutgoingSocket` + +``` +|-----------|(IncomingSocket)|-----------|(OutgoingSocket)|-----------| +| CLIENT |<-------------->| PROXY |<-------------->| SERVER | +|-----------| |-----------| |-----------| +``` + +### 2. Server Disconnect + +Lets consider if server disconnects due to abrupt close / deploys on server. Proxy job is to retry connecting to server with `t` interval & retry `n` times connecting to server. + +``` +|------------| |-----------| |-----------| +| CLIENT(C1) |<--->| PROXY |<-X->| SERVER | +|------------| |-----------| |-----------| +``` + +Now, as the server is in a disconnected state & if the client sends any messages, the Proxy's job is to queue the client messages aka `IncomingQueue`. + +``` +|------------| |-----------| |-----------| +| CLIENT(C1) |<--->| PROXY |<-X->| SERVER | +|------------| |-----------| |-----------| + [ M1 | M2 | M3 ] +``` + +Once, the server is connected all the messages from `IncomingQueue` is drained by Proxy & sent to server. + +``` +|------------| |-----------| |-----------| +| CLIENT(C1) |<--->| PROXY |<--->| SERVER | +|------------| |-----------| |-----------| + [ M1 | M2 | M3 ] +``` + +### 3. Client Disconnect + +If for some reason the client disconnects, Proxy also breaks the connection between server after `t` interval. + +``` +|------------| |-----------| |----------| +| CLIENT(C1) |<-X->| PROXY |<--->| SERVER | +|------------| |-----------| |----------| +``` + +As we know, client has disconnected and after `t` interval proxy closes the connection between server. And within this time frame if server sends message to client. The messages starts queued up aka `OutgoingQueue` + +``` +|------------| |-----------| |-----------| +| CLIENT(C1) |<-X->| PROXY |<--->| SERVER | +|------------| |-----------| |-----------| + [ M1 | M2 | M3 ] +``` + +Once the client reconnects with same `connectionId` i.e `C1` as the first time connection was established. Proxy then drains the messages from `OutgoingQueue` & sends to client `(C1)`. + +``` +|------------| |-----------| |-----------| +| CLIENT(C1) |<--->| PROXY |<--->| SERVER | +|------------| |-----------| |-----------| +[ M1 | M2 | M3 ] +``` + +## Class Level Structure + +``` +class Proxy: + WebSocketServer server + Map contexts + +class Context: + String connectionId + IncomingWebSocket incomingSocket + OutgoingWebSocket outgoingSocket + boolean incomingLock + boolean outgoingLock + +class IncomingWebSocket: + WebSocket connection + Object request + List queue //IncomingQueue + +class OutgoingWebSocket: + String url + Object headers + String connectionId + boolean shouldRetry + WebSocket connection + Object reconnectInfo + Integer retryCount + List queue //OutgoingQueue +``` + +- `Proxy` holds the map of contexts for which connection is established. +- `Context` should hold the `IncomingSocket` & `OutgoingSocket` data. +- If the server is disconnected `incomingLock` is set to `true` & therefore messages coming from client is queued. Additionally, if `OutgoingSocket` is closed, then retry `n` times. Post all the retries, terminate the `IncomingSocket`. +- If the client is disconnected `outgoingLock` is set to `true` & therefore messages coming from upstream is queued. Additionally, if `IncomingSocket` is closed then `OutgoingSocket` not be closed immediately and wait for `t` interval before closing the `OutgoingSocket`. + +- If the server is reconnected then drain the messages from `IncomingQueue` & send those messages to `OutgoingSocket`. + +- If the client reconnects with same `connectionId` drain the messages from `OutgoingQueue` & send those messages to `IncomingSocket`. diff --git a/lib/config/config.json.sample b/lib/config/config.json.sample new file mode 100644 index 0000000..4e2c92d --- /dev/null +++ b/lib/config/config.json.sample @@ -0,0 +1,33 @@ +{ + "prod": { + "workers": 1, + "port": 9124, + "hostname": "127.0.0.1", + "upstream": "ws://localhost:9125", + "retryDelay": 10000, + "closeTimer": 15000, + "enableInstrumentation": true, + "instrumentationTimer": 60000 + }, + "test": { + "workers": 1, + "port": 8999, + "hostname": "127.0.0.1", + "upstream": "ws://localhost:8999", + "retryDelay": 10000, + "closeTimer": 15000, + "enableInstrumentation": true, + "instrumentationTimer": 60000 + }, + "dev": { + "workers": 1, + "port": 9124, + "hostname": "127.0.0.1", + "upstream": "ws://localhost:9125", + "retryDelay": 10000, + "closeTimer": 15000, + "workerKillTimer": 10000, + "enableInstrumentation": true, + "instrumentationTimer": 60000 + } +} diff --git a/lib/config/constants.js b/lib/config/constants.js new file mode 100644 index 0000000..a8f6707 --- /dev/null +++ b/lib/config/constants.js @@ -0,0 +1,254 @@ +'use strict'; + +const env = process.env.NODE_ENV || 'dev'; +const config = require('./config.json')[env]; +const logger = require('../util/loggerFactory'); +const { + isUndefined, + isNotNumber, + isNotString, + isNumber, + isNotBoolean, +} = require('../util/typeSanity'); + +const kUpstreamClosed = Symbol('kUpstreamClosed'); +const kMessageReceived = Symbol('kMessageReceived'); +const kError = Symbol('kError'); +const kSendMessage = Symbol('kSendMessage'); +const kQueueMessage = Symbol('kQueueMessage'); +const kDrainMessage = Symbol('kDrainMessage'); +const kConnectionOpened = Symbol('kConnectionOpened'); +const kDequeueMessage = Symbol('kDequeueMessage'); +const kClientClosed = Symbol('kClientClosed'); +const kEnableOutgoingQueue = Symbol('kEnableOutgoingQueue'); +const kEnableIncomingQueue = Symbol('kEnableIncomingQueue'); +const kCleanup = Symbol('kCleanup'); +const kDrainCompleted = Symbol('kDrainCompleted'); +const kReleaseTap = Symbol('kReleaseTap'); +const kAddNewContext = Symbol('kAddNewContext'); +const kUpstreamRestart = Symbol('kUpstreamRestart'); + +const RECONNECT = 'RECONNECT'; +const SERVICE_RESTART = 'Service Restart'; +const PROXY_RESTART = 'PROXY_RESTART'; +const PROXY_LOCKED = 'PROXY_LOCKED'; + +const DISALLOWED_HEADERS = [ + 'host', + 'connection', + 'sec-websocket-key', + 'sec-websocket-version', + 'upgrade', +]; + +const CONNECTION_ID_HEADER = 'x-connection-id'; +const RECONNECT_ID_HEADER = 'x-reconnect-id'; + +const OUTGOING = '[OUTGOING]'; +const INCOMING = '[INCOMING]'; + +class ConfigParser { + setRetries() { + const { retryLimit } = config; + let retryVal; + if (isUndefined(retryLimit)) { + logger.info('No retry limit specified using default (10)'); + retryVal = 10; + } else if (isNotNumber(retryLimit)) { + logger.error( + `Invalid value for retrylimit: ${retryLimit} using default (10)` + ); + retryVal = 10; + } else { + retryVal = retryLimit; + } + this.retryVal = retryVal; + return this; + } + + setRetryDelay() { + const { retryDelay } = config; + let retryDelayVal; + if (isUndefined(retryDelay)) { + logger.info('No retry delay value sent using default (10)'); + retryDelayVal = 10; + } else if (isNotNumber(retryDelay)) { + logger.error( + `Inavlid value for retryDelay: ${retryDelay} using default (10)` + ); + retryDelayVal = 10; + } else { + retryDelayVal = retryDelay; + } + this.retryDelayVal = retryDelayVal; + return this; + } + + setHooks() { + const { hooksInfo = {} } = config; + if (Object.keys(hooksInfo).length === 0) { + logger.info('Alert hook not setup'); + } else if (isNotString(hooksInfo.url)) { + logger.error('Hooks URL is not string, using nothing'); + } + return this; + } + + setWorkers() { + const { workers } = config; + let workerVal = 2; + if (isNotNumber(workers)) { + logger.error('Invalid workers defined using default (2)'); + } else { + workerVal = workers; + } + this.workerVal = workerVal; + return this; + } + + setUpstream() { + this.upstream = config.upstream; + return this; + } + + setPort() { + const { port } = config; + let portVal; + if (isNotNumber(port)) { + logger.info('Not a valid port number, using default (8081)'); + portVal = 8081; + } else { + portVal = port; + } + this.port = portVal; + return this; + } + + setHostname() { + const { hostname } = config; + let hostnameVal; + if (isNotString(hostname)) { + logger.info('Not a valid port number, using default (8081)'); + hostnameVal = '127.0.0.1'; + } else { + hostnameVal = hostname; + } + this.hostname = hostnameVal; + return this; + } + + setCloseTimer() { + const { closeTimer } = config; + let newCloseTimer = 5000; + if (isNotNumber(closeTimer)) { + logger.info(`No close timer value sent using default (${newCloseTimer})`); + } else { + newCloseTimer = closeTimer; + } + this.closeTimer = newCloseTimer; + return this; + } + + setWorkerKillTimer() { + const { workerKillTimer } = config; + let defaultTimer = 60 * 10 * 1000; + if (isNotNumber(workerKillTimer)) { + logger.info( + `No worker kill timer configured using default (${defaultTimer})` + ); + } else { + defaultTimer = workerKillTimer; + } + this.workerKillTimer = defaultTimer; + return this; + } + + setInstrumentation() { + const { enableInstrumentation } = config; + let newEnableInstrumentation = true; + if (isNotBoolean(enableInstrumentation)) { + logger.info( + `No instrumentation configured using default (${newEnableInstrumentation})` + ); + } else { + newEnableInstrumentation = enableInstrumentation; + } + this.enableInstrumentation = newEnableInstrumentation; + return this; + } + + setLogPath() { + const { logPath } = config; + let newLogPath = './logs/proxy.log'; + if (isNotString(logPath)) { + logger.info(`No log path configured using default (${newLogPath})`); + } else { + newLogPath = logPath; + } + this.logPath = newLogPath; + return this; + } + + setInstrumentationTimer() { + const { instrumentationTimer } = config; + let newInstrumentationTimer = 60000; + if (isNotNumber(instrumentationTimer)) { + logger.info( + `No instrumentation timer configured using default (${newInstrumentationTimer})` + ); + } else { + newInstrumentationTimer = instrumentationTimer; + } + this.instrumentationTimer = newInstrumentationTimer; + return this; + } + + setRootConfig() { + this.rootConfig = config; + return this; + } +} + +const configParser = new ConfigParser() + .setHooks() + .setRetries() + .setRetryDelay() + .setPort() + .setHostname() + .setWorkers() + .setUpstream() + .setCloseTimer() + .setWorkerKillTimer() + .setInstrumentation() + .setLogPath() + .setRootConfig() + .setInstrumentationTimer(); + +module.exports = { + config: configParser, + RECONNECT, + SERVICE_RESTART, + DISALLOWED_HEADERS, + CONNECTION_ID_HEADER, + RECONNECT_ID_HEADER, + INCOMING, + OUTGOING, + kUpstreamClosed, + kMessageReceived, + kError, + kSendMessage, + kQueueMessage, + kDrainMessage, + kConnectionOpened, + kDequeueMessage, + kClientClosed, + kCleanup, + kDrainCompleted, + kReleaseTap, + kAddNewContext, + kEnableIncomingQueue, + kEnableOutgoingQueue, + kUpstreamRestart, + PROXY_LOCKED, + PROXY_RESTART, +}; diff --git a/lib/core/Context.js b/lib/core/Context.js new file mode 100644 index 0000000..a300274 --- /dev/null +++ b/lib/core/Context.js @@ -0,0 +1,251 @@ +'use strict'; + +const EventEmitter = require('events'); +const IncomingWebSocket = require('./IncomingWebSocket'); +const OutgoingWebSocket = require('./OutgoingWebSocket'); +const logger = require('../util/loggerFactory'); +const { createTarget } = require('../util/util'); +const { + kUpstreamClosed, + kMessageReceived, + kEnableIncomingQueue, + kEnableOutgoingQueue, + kError, + PROXY_LOCKED, + kSendMessage, + kQueueMessage, + kDrainMessage, + kConnectionOpened, + kDequeueMessage, + kClientClosed, + kCleanup, + kDrainCompleted, + kReleaseTap, + kAddNewContext, + kUpstreamRestart, + config, + INCOMING, + OUTGOING, +} = require('../config/constants'); +const { isUndefined, isNotUndefined } = require('../util/typeSanity'); +const { + incrClosedConnectionCount, + decrActiveConnectionCount, + incrErrorConnectionCount, + incrNewConnect, + incrActiveConnectionCount, +} = require('../util/metrics'); + +/** + * Context holds the information for the incoming and outgoing sockets. + * + * Instantiates the incoming and outgoing sockets and registers the listeners. + * Acts as a bridge between incoming and outgoing sockets. + */ +class Context extends EventEmitter { + /** + * Creates the context with connection identifier. + * + * @param {string} connectionId + */ + constructor(connectionId) { + super(); + this.connectionId = connectionId; + this.incomingSocket = null; + this.outgoingSocket = null; + this.incomingLock = true; + this.outgoingLock = false; + } + + /** + * Adds a new incoming and outgoing connection. + * + * @param {WebSocket} socket + * @param {object} request + */ + addNewConnection(socket, request) { + if (isUndefined(this.incomingSocket)) { + this.incomingSocket = new IncomingWebSocket(socket, request); + this.outgoingSocket = new OutgoingWebSocket( + createTarget(request.url), + request.headers + ); + this.outgoingSocket.addSocket(); + this.registerIncomingListeners(); + this.registerOutgoingListeners(); + } else { + this.incomingSocket.setSocket(socket, request); + this.outgoingSocket.emit(kDequeueMessage); + clearTimeout(this.upstreamCloseTimer); + this.upstreamCloseTimer = null; + } + } + + /** + * Registers the incoming socket listeners. + */ + registerIncomingListeners() { + this.incomingSocket.on(kMessageReceived, (msg) => { + if (this.incomingLock) { + logger.debug(`${INCOMING} [${this.connectionId}] [QUEUE] - ${msg}`); + this.incomingSocket.addToQueue(msg); + } else this.outgoingSocket.emit(kSendMessage, msg); + }); + + this.incomingSocket.on(kError, () => { + logger.error(`${INCOMING} [${this.connectionId}] [ERROR]`); + incrErrorConnectionCount(); + }); + + this.incomingSocket.on(kQueueMessage, () => { + this.incomingLock = true; + logger.info(`${INCOMING} [${this.connectionId}] [QUEUE] - STARTED`); + }); + + this.incomingSocket.on(kSendMessage, (msg) => { + this.incomingSocket.send(msg); + logger.debug(`${INCOMING} [${this.connectionId}] [MESSAGE] - ${msg}`); + }); + + this.incomingSocket.on(kDrainMessage, (msg) => { + this.outgoingSocket.emit(kSendMessage, msg); + }); + + this.incomingSocket.on(kConnectionOpened, () => { + if (isNotUndefined(this.upstreamCloseTimer)) { + clearTimeout(this.upstreamCloseTimer); + this.upstreamCloseTimer = null; + } + this.outgoingSocket.emit(kDequeueMessage); + logger.debug(`${INCOMING} [${this.connectionId}] [OPEN]`); + incrNewConnect(); + incrActiveConnectionCount(); + }); + + this.incomingSocket.on(kClientClosed, (code, msg) => { + logger.info( + `${INCOMING} [${this.connectionId}] [CLOSE] - Socket closed with ${code} and ${msg}` + ); + this.outgoingSocket.emit(kQueueMessage); + this.upstreamCloseTimer = setTimeout( + this.closingOutgoingSocket.bind(this), + config.closeTimer + ); + incrClosedConnectionCount(); + decrActiveConnectionCount(); + }); + + this.incomingSocket.on(kDequeueMessage, () => { + this.incomingSocket.drainQueue(); + }); + + this.incomingSocket.on(kEnableOutgoingQueue, () => { + this.outgoingLock = true; + this.incomingSocket.emit(kSendMessage, PROXY_LOCKED); + }); + + this.incomingSocket.on(kDrainCompleted, () => { + if (this.incomingLock) { + this.incomingLock = false; + logger.info(`${INCOMING} [${this.connectionId}] [QUEUE] - COMPLETED`); + } + }); + } + + /** + * Registers the outgoing socket listeners. + */ + registerOutgoingListeners() { + this.outgoingSocket.on(kReleaseTap, () => { + this.incomingSocket.drainQueue(); + this.outgoingSocket.drainQueue(); + }); + + this.outgoingSocket.on(kAddNewContext, (connectionId) => { + this.emit(kAddNewContext, connectionId); + }); + + this.outgoingSocket.on(kMessageReceived, (msg) => { + if (this.outgoingLock) { + logger.debug(`${OUTGOING} [${this.connectionId}] [QUEUE] - ${msg}`); + this.outgoingSocket.addToQueue(msg); + } else this.incomingSocket.emit(kSendMessage, msg); + }); + + this.outgoingSocket.on(kError, () => { + logger.error(`${OUTGOING} [${this.connectionId}] [ERROR]`); + incrErrorConnectionCount(); + }); + + this.outgoingSocket.on(kQueueMessage, () => { + this.outgoingLock = true; + logger.info(`${OUTGOING} [${this.connectionId}] [QUEUE] - STARTED`); + }); + + this.outgoingSocket.on(kEnableIncomingQueue, () => { + this.incomingLock = true; + this.outgoingSocket.emit(kSendMessage, PROXY_LOCKED); + }); + + this.outgoingSocket.on(kSendMessage, (msg) => { + this.outgoingSocket.send(msg); + logger.debug(`${OUTGOING} [${this.connectionId}] [MESSAGE] - ${msg}`); + }); + + this.outgoingSocket.on(kDequeueMessage, () => { + this.outgoingSocket.drainQueue(); + }); + + this.outgoingSocket.on(kUpstreamClosed, (code, msg) => { + this.incomingSocket.close(); + this.emit(kCleanup, this.connectionId); + logger.info( + `${OUTGOING} [${this.connectionId}] [CLOSE] - Socket closed with ${code} and ${msg}` + ); + }); + + this.outgoingSocket.on(kUpstreamRestart, (code, msg) => { + this.incomingSocket.emit(kQueueMessage); + logger.info( + `${OUTGOING} [${this.connectionId}] [RESTART] ${code} - ${msg}` + ); + }); + + this.outgoingSocket.on(kConnectionOpened, () => { + this.incomingSocket.emit(kDequeueMessage); + logger.debug(`${OUTGOING} [${this.connectionId}] [OPEN] `); + incrNewConnect(); + incrActiveConnectionCount(); + }); + + this.outgoingSocket.on(kDrainMessage, (msg) => { + this.incomingSocket.emit(kSendMessage, msg); + }); + + this.outgoingSocket.on(kDrainCompleted, () => { + if (this.outgoingLock) { + this.outgoingLock = false; + logger.info(`${OUTGOING} [${this.connectionId}] [QUEUE]- COMPLETED`); + } + }); + } + + /** + * Closes outgoing socket and emits clean up event. + */ + closingOutgoingSocket() { + this.outgoingSocket.close(); + this.emit(kCleanup, this.connectionId); + } + + /** + * Sets the connection id. + * + * @param {string} connectionId + */ + setConnectionId(connectionId) { + this.connectionId = connectionId; + } +} + +module.exports = Context; diff --git a/lib/core/IncomingWebSocket.js b/lib/core/IncomingWebSocket.js new file mode 100644 index 0000000..300d4d5 --- /dev/null +++ b/lib/core/IncomingWebSocket.js @@ -0,0 +1,133 @@ +'use strict'; + +const EventEmitter = require('events'); +const { + kConnectionOpened, + kMessageReceived, + kError, + kClientClosed, + kEnableOutgoingQueue, + kDrainMessage, + kDrainCompleted, + PROXY_RESTART, +} = require('../config/constants'); +const Queue = require('./Queue'); + +/** + * Incoming connection to the proxy will be treated as an IncomingWebSocket. + * This will be the object having 1:1 relationship with the + * OutgoingWebSocket object. Since each client connection will + * have its own unique upstream. + * + * Each Incoming and Outgoing WebSocket is tied with a context. Context is an + * object which store the state for the session. + */ +class IncomingWebSocket extends EventEmitter { + constructor(socket, request) { + super(); + this.socket = socket; + this.request = request; + this.queue = new Queue(); + this.teardown = false; + this.registerListeners(); + } + + /** + * Registers the socket listeners. + */ + registerListeners() { + this.socket.on('open', this.openHandler.bind(this)); + this.socket.on('message', this.messageHandler.bind(this)); + this.socket.on('close', this.closeHandler.bind(this)); + this.socket.on('error', this.errorHandler.bind(this)); + } + + /** + * Triggers when socket connection is opened. + */ + openHandler() { + this.emit(kConnectionOpened); + } + + /** + * Triggers when message is received on socket. + * + * @param {string} msg + */ + messageHandler(msg) { + if (msg === PROXY_RESTART) { + this.emit(kEnableOutgoingQueue); + return; + } + this.emit(kMessageReceived, msg); + } + + /** + * Triggers when socket connection is closed. + * + * @param {number} code + * @param {string} msg + */ + closeHandler(code, msg) { + if (!this.teardown) { + this.emit(kClientClosed, code, msg); + } + } + + /** + * Triggers when error occured on socket. + */ + errorHandler() { + this.emit(kError); + } + + /** + * Sets the incoming socket. + * + * @param {WebSocket} socket + * @param {object} request + */ + setSocket(socket, request) { + this.socket = socket; + this.request = request; + this.registerListeners(); + } + + /** + * Adds message to queue. + * + * @param {string} msg + */ + addToQueue(msg) { + this.queue.enqueue(msg); + } + + /** + * Drains the queue and emits completed event. + */ + drainQueue() { + while (!this.queue.isEmpty()) { + this.emit(kDrainMessage, this.queue.dequeue()); + } + this.emit(kDrainCompleted); + } + + /** + * Closes the socket connection. + */ + close() { + this.teardown = true; + this.socket.terminate(); + } + + /** + * Sends the message on socket. + * + * @param {string} msg + */ + send(msg) { + this.socket.send(msg); + } +} + +module.exports = IncomingWebSocket; diff --git a/lib/core/OutgoingWebSocket.js b/lib/core/OutgoingWebSocket.js new file mode 100644 index 0000000..a82e187 --- /dev/null +++ b/lib/core/OutgoingWebSocket.js @@ -0,0 +1,210 @@ +'use strict'; + +const EventEmitter = require('events'); +const WebSocket = require('ws'); +const Queue = require('./Queue'); +const { promisify } = require('util'); +const logger = require('../util/loggerFactory'); +const sleep = promisify(setTimeout); +const { + config, + kConnectionOpened, + kEnableIncomingQueue, + kAddNewContext, + kReleaseTap, + kMessageReceived, + kError, + kUpstreamRestart, + kUpstreamClosed, + kDrainMessage, + kDrainCompleted, + SERVICE_RESTART, + RECONNECT, + PROXY_RESTART, + DISALLOWED_HEADERS, + OUTGOING, +} = require('../config/constants'); +const { extractConnectionId } = require('../util/util'); +const { incrReconnectionCount } = require('../util/metrics'); +const { isNotUndefined } = require('../util/typeSanity'); + +/** + * Outgoing WebSocket connection is the connection object + * to the upstream server. Each upstream will have a unique + * client connection (IncomingWebSocket edge). This is a general + * abstraction over WebSocket so that custom events can be emitted + * on the object itself and the implementation can be handled in the + * class member function itself. + */ +class OutgoingWebSocket extends EventEmitter { + constructor(url, headers) { + super(); + this.url = url; + this.setHeaders(headers); + this.setConnectionId(); + this.shouldRetry = false; + this.socket = null; + this.reconnectInfo = null; + this.queue = new Queue(); + this.retryCount = config.retryVal; + } + + /** + * Adds the Outgoing socket & registers the listeners + */ + addSocket() { + logger.info(`Trying to connect with socket: ${this.url}`); + this.socket = new WebSocket(this.url, { + headers: { + ...this.headers, + ...(isNotUndefined(this.reconnectInfo) && { 'x-reconnect': true }), + }, + }); + this.registerListeners(); + } + + /** + * Registers the socket listeners. + */ + registerListeners() { + this.socket.on('open', this.openHandler.bind(this)); + this.socket.on('message', this.messageHandler.bind(this)); + this.socket.on('close', this.closeHandler.bind(this)); + this.socket.on('error', this.errorHandler.bind(this)); + } + + /** + * Triggers when socket connection is opened. + */ + openHandler() { + if (isNotUndefined(this.reconnectInfo)) { + logger.info( + `${OUTGOING} [${this.connectionId}] [RECONNECT] - ${this.reconnectInfo}` + ); + this.send(this.reconnectInfo); + } + this.emit(kConnectionOpened); + this.shouldRetry = false; + this.retryCount = config.retryVal; + } + + /** + * Triggers when message is received on socket. + * + * @param {string} msg + */ + messageHandler(msg) { + if (isNotUndefined(msg) && msg.substring(0, 9) === RECONNECT) { + incrReconnectionCount(); + this.reconnectInfo = msg; + this.emit(kAddNewContext, this.connectionId); + this.emit(kReleaseTap); + return; + } + if (msg === PROXY_RESTART) { + this.emit(kEnableIncomingQueue); + return; + } + this.emit(kMessageReceived, msg); + } + + /** + * Triggers when socket connection is closed. + * + * @param {number} code + * @param {string} msg + */ + closeHandler(code, msg) { + if (!this.shouldRetry) { + if (msg === SERVICE_RESTART) { + this.shouldRetry = true; + this.emit(kUpstreamRestart, code, msg); + this.startRetries(code, msg); + } else { + this.emit(kUpstreamClosed, code, msg); + } + } + } + + /** + * Triggers when error occured on socket. + */ + errorHandler() { + this.emit(kError); + } + + /** + * Retries upstream socket until max retries reached. + * + * @param {number} code + * @param {string} msg + */ + async startRetries(code, msg) { + if (this.shouldRetry) { + if (this.retryCount == 0) { + this.emit(kUpstreamClosed, code, msg); + } else { + this.retryCount = this.retryCount - 1; + await sleep(config.retryDelayVal); + this.addSocket(); + } + logger.info( + `${OUTGOING} [${this.connectionId}] [RETRIES LEFT: ${this.retryCount}] ` + ); + } + } + + /** + * Closes the socket connection. + */ + close() { + this.socket.close(); + } + + /** + * Adds message to queue. + * + * @param {string} msg + */ + addToQueue(msg) { + this.queue.enqueue(msg); + } + + /** + * Sends the message on socket. + * + * @param {string} msg + */ + send(msg) { + this.socket.send(msg); + } + + /** + * Drains the queue and emits completed event. + */ + drainQueue() { + while (!this.queue.isEmpty()) { + this.emit(kDrainMessage, this.queue.dequeue()); + } + this.emit(kDrainCompleted); + } + + /** + * Sets connection identifier from headers + */ + setConnectionId() { + this.connectionId = extractConnectionId(this.headers); + } + + /** + * Sets the headers and sanitises it. + * + * @param {object} headers + */ + setHeaders(headers) { + DISALLOWED_HEADERS.forEach((h) => delete headers[h]); + this.headers = headers; + } +} + +module.exports = OutgoingWebSocket; diff --git a/lib/core/Proxy.js b/lib/core/Proxy.js new file mode 100644 index 0000000..a63cf01 --- /dev/null +++ b/lib/core/Proxy.js @@ -0,0 +1,124 @@ +'use strict'; + +const WebSocket = require('ws'); +const { config, kCleanup, kAddNewContext } = require('../config/constants'); +const logger = require('../util/loggerFactory'); +const Context = require('./Context'); +const { + isReconnectHeader, + extractConnectionId, + extractReconnectId, +} = require('../util/util'); +const { isString } = require('../util/typeSanity'); +const http = require('http'); +const { URL } = require('url'); +const { setMetrics } = require('../util/metrics'); +const AlertManager = require('../util/AlertManager'); +const Instrumentation = require('../util/Instrumentation'); +const ErrorHandler = require('../util/ErrorHandler'); + +/** + * Proxy is the entrypoint and instantiates the context among the socket connection. + * WebSocket server is created & maintaining contexts of connections that are established. + * + * Registers the contexts holding all the connections which are created. + */ +class Proxy { + /** + * Creates the Proxy. + */ + constructor( + alertManager = new AlertManager(), + instrumentation = new Instrumentation() + ) { + this.alertManager = alertManager; + this.instrumentation = instrumentation; + this.httpServer = http.createServer(this.requestHandler.bind(this)); + this.httpServer.listen(config.port, config.hostname); + this.upstreamURL = new URL(config.upstream); + this.server = new WebSocket.Server({ server: this.httpServer }); + this.contexts = new Map(); + this.server.on('connection', this.connectionHandler.bind(this)); + if (config.enableInstrumentation) { + this.captureInstrumentation(); + } + process.on( + 'uncaughtException', + new ErrorHandler(this.alertManager).onError + ); + } + + /** + * Pipes the request and response. + * + * @param {Object} request + * @param {Object} response + */ + requestHandler(request, response) { + request.headers.host = this.upstreamURL.host; + const options = { + hostname: this.upstreamURL.hostname, + port: this.upstreamURL.port, + path: request.url, + method: request.method, + headers: request.headers, + }; + const proxyReq = http.request(options, (proxyResponse) => { + response.writeHead(proxyResponse.statusCode, proxyResponse.headers); + proxyResponse.pipe(response, { + end: true, + }); + }); + + request.pipe(proxyReq, { + end: true, + }); + } + + /** + * Triggers when connection is established on socket. + * + * @param {WebSocket} socket + * @param {object} request + */ + connectionHandler(socket, request) { + if (isReconnectHeader(request.headers)) { + const reconnectId = extractReconnectId(request.headers); + if (this.contexts.has(reconnectId)) { + const context = this.contexts.get(reconnectId); + context.addNewConnection(socket, request); + } else { + logger.info(`[${reconnectId}] - Unable to find reconnectId`); + } + } else { + const connId = extractConnectionId(request.headers); + const context = new Context(connId); + context.addNewConnection(socket, request); + context.on(kCleanup, (connectionId) => { + this.contexts.delete(connectionId); + context.removeAllListeners(kCleanup); + }); + + context.on(kAddNewContext, (connectionId) => { + this.contexts.set(connectionId, context); + context.removeAllListeners(kAddNewContext); + }); + + if (isString(connId)) { + this.contexts.set(connId, context); + } + } + } + + /** + * Captures the instrumentation and pushes the metrics. + */ + captureInstrumentation() { + setInterval(() => { + this.instrumentation.pushMetrics(); + setMetrics(); + }, config.instrumentationTimer); + } +} + +module.exports = Proxy; diff --git a/lib/core/Queue.js b/lib/core/Queue.js new file mode 100644 index 0000000..c0f47da --- /dev/null +++ b/lib/core/Queue.js @@ -0,0 +1,28 @@ +'use strict'; + +class Queue { + constructor() { + this.list = []; + } + + enqueue(data) { + this.list.push(data); + } + + dequeue() { + if (this.isEmpty()) { + return null; + } + return this.list.shift(); + } + + size() { + return this.list.length; + } + + isEmpty() { + return this.size() === 0; + } +} + +module.exports = Queue; diff --git a/lib/util/AlertManager.js b/lib/util/AlertManager.js new file mode 100644 index 0000000..7efc461 --- /dev/null +++ b/lib/util/AlertManager.js @@ -0,0 +1,30 @@ +const logger = require('./loggerFactory'); + +/** + * Sends alert information. + */ +class AlertManager { + + /** + * Creates the AlertManager. + */ + constructor() { + this.sendAlerts = this.sendAlerts.bind(this); + } + + /** + * Logs the alert information that needs to be sent. + * Here, you can configure your alert endpoint. + * + * @param {String} title + * @param {String} subject + * @param {String} message + */ + sendAlerts(subject, message) { + logger.info( + `Alert with subject: ${subject} message: ${message}` + ); + } +} + +module.exports = AlertManager; diff --git a/lib/util/ErrorHandler.js b/lib/util/ErrorHandler.js new file mode 100644 index 0000000..a851a8a --- /dev/null +++ b/lib/util/ErrorHandler.js @@ -0,0 +1,37 @@ +'use strict'; +const logger = require('./loggerFactory'); +const packageJson = require('../../package.json'); + +/** + * Used for processing application level error handling. + */ +class ErrorHandler { + /** + * Creates the ErrorHandler with the AlertManager configured. + * + * @param {AlertManager} alertManager + */ + constructor(alertManager) { + this.alertManager = alertManager; + this.onError = this.onError.bind(this); + } + + /** + * Handle errors and notify. + * + * @param {Object} err + */ + onError(err) { + const stackTrace = err.stack ? err.stack.toString() : err.toString(); + logger.error(`Global Exception: ${err.toString()} ${stackTrace}`); + + if (process.env.NODE_ENV === 'prod') { + const title = packageJson.name; + const subject = `Global Exception: ${err.toString()}`; + const message = `Global Exception: ${err.toString()} ${stackTrace}`; + this.alertManager.sendAlert(title, subject, message); + } + } +} + +module.exports = ErrorHandler; diff --git a/lib/util/Instrumentation.js b/lib/util/Instrumentation.js new file mode 100644 index 0000000..c8a6fe4 --- /dev/null +++ b/lib/util/Instrumentation.js @@ -0,0 +1,18 @@ +const logger = require('./loggerFactory'); +const { getMetrics } = require('./metrics'); + +class Instrumentation { + constructor() { + this.pushMetrics = this.pushMetrics.bind(this); + } + + /** + * Logs the metrics information. + * Here you can configure endpoint to push metrics + */ + pushMetrics() { + logger.info(`[METRICS] ${JSON.stringify(getMetrics())}`); + } +} + +module.exports = Instrumentation; diff --git a/lib/util/loggerFactory.js b/lib/util/loggerFactory.js new file mode 100644 index 0000000..37d4f85 --- /dev/null +++ b/lib/util/loggerFactory.js @@ -0,0 +1,33 @@ +'use strict'; + +const os = require('os'); +const pino = require('pino'); +const packageJson = require('../../package.json'); +const { isString } = require('./typeSanity'); +const Logger = pino( + { + level: process.env.NODE_ENV === 'prod' ? 'info' : 'debug', + base: null, + timestamp: () => `, "time": "${new Date(Date.now()).toISOString()}"`, + messageKey: 'message', + formatters: { + level(label) { + return { level: label }; + }, + }, + }, + isString(process.env.LOG_PATH) && pino.destination(process.env.LOG_PATH) +); + +function getDefaultObjects() { + return { + meta: { + application: packageJson.name, + component: packageJson.name, + pid: process.pid, + hostname: os.hostname(), + }, + }; +} + +module.exports = Logger.child(getDefaultObjects()); diff --git a/lib/util/metrics.js b/lib/util/metrics.js new file mode 100644 index 0000000..7a53de1 --- /dev/null +++ b/lib/util/metrics.js @@ -0,0 +1,63 @@ +let metric = { + newConnectionsCount: 0, + reconnectionCount: 0, + closedConnectionCount: 0, + activeConnectionCount: 0, + errorConnectionCount: 0, + memoryUsage: {}, +}; + +const incrNewConnect = () => { + metric.newConnectionsCount += 1; +}; + +const incrReconnectionCount = () => { + metric.reconnectionCount += 1; +}; + +const incrClosedConnectionCount = () => { + metric.closedConnectionCount += 1; +}; + +const incrActiveConnectionCount = () => { + metric.activeConnectionCount += 1; +}; + +const decrActiveConnectionCount = () => { + metric.activeConnectionCount -= 1; +}; + +const incrErrorConnectionCount = () => { + metric.errorConnectionCount += 1; +}; + +const setMemoryUsage = () => { + metric.memoryUsage = process.memoryUsage(); +}; + +const getMetrics = () => { + setMemoryUsage(); + return metric; +}; + +const setMetrics = () => { + metric = { + newConnectionsCount: 0, + reconnectionCount: 0, + closedConnectionCount: 0, + activeConnectionCount: metric.activeConnectionCount, + errorConnectionCount: 0, + memoryUsage: {}, + }; +}; + +module.exports = { + incrNewConnect, + incrActiveConnectionCount, + incrClosedConnectionCount, + incrErrorConnectionCount, + decrActiveConnectionCount, + incrReconnectionCount, + getMetrics, + setMetrics, +}; diff --git a/lib/util/typeSanity.js b/lib/util/typeSanity.js new file mode 100644 index 0000000..2706da2 --- /dev/null +++ b/lib/util/typeSanity.js @@ -0,0 +1,26 @@ +const isUndefined = (val) => val === undefined || val === null || val === ''; + +const isNotUndefined = (val) => !isUndefined(val); + +const isString = (val) => isNotUndefined(val) && typeof val === 'string'; + +const isNotString = (val) => !isString(val); + +const isNumber = (val) => isNotUndefined(val) && typeof val === 'number'; + +const isNotNumber = (val) => !isNumber(val); + +const isBoolean = (val) => isNotUndefined(val) && typeof val === 'boolean'; + +const isNotBoolean = (val) => !isBoolean(val); + +module.exports = { + isUndefined, + isNotUndefined, + isString, + isNotString, + isNumber, + isNotNumber, + isBoolean, + isNotBoolean, +}; diff --git a/lib/util/util.js b/lib/util/util.js new file mode 100644 index 0000000..c58f06f --- /dev/null +++ b/lib/util/util.js @@ -0,0 +1,34 @@ +'use strict'; + +const { + config, + CONNECTION_ID_HEADER, + RECONNECT_ID_HEADER, +} = require('../config/constants'); +const { isNotUndefined } = require('./typeSanity'); + +function createTarget(suffixURL) { + const url = new URL(suffixURL, config.upstream); + return url.href; +} + +function extractReconnectId(headers) { + const { [RECONNECT_ID_HEADER]: reconnectId } = headers; + return reconnectId; +} + +function extractConnectionId(headers) { + const { [CONNECTION_ID_HEADER]: connectionId } = headers; + return connectionId; +} + +function isReconnectHeader(headers) { + return isNotUndefined(extractReconnectId(headers)); +} + +module.exports = { + createTarget, + extractReconnectId, + extractConnectionId, + isReconnectHeader, +}; diff --git a/logs/proxy.log b/logs/proxy.log new file mode 100644 index 0000000..e69de29 diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..34cb8a7 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,3048 @@ +{ + "name": "ws-reconnect-proxy", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.14.5.tgz", + "integrity": "sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.14.5" + } + }, + "@babel/compat-data": { + "version": "7.14.9", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.14.9.tgz", + "integrity": "sha512-p3QjZmMGHDGdpcwEYYWu7i7oJShJvtgMjJeb0W95PPhSm++3lm8YXYOh45Y6iCN9PkZLTZ7CIX5nFrp7pw7TXw==", + "dev": true + }, + "@babel/core": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.14.8.tgz", + "integrity": "sha512-/AtaeEhT6ErpDhInbXmjHcUQXH0L0TEgscfcxk1qbOvLuKCa5aZT0SOOtDKFY96/CLROwbLSKyFor6idgNaU4Q==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.14.5", + "@babel/generator": "^7.14.8", + "@babel/helper-compilation-targets": "^7.14.5", + "@babel/helper-module-transforms": "^7.14.8", + "@babel/helpers": "^7.14.8", + "@babel/parser": "^7.14.8", + "@babel/template": "^7.14.5", + "@babel/traverse": "^7.14.8", + "@babel/types": "^7.14.8", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.1.2", + "semver": "^6.3.0", + "source-map": "^0.5.0" + } + }, + "@babel/generator": { + "version": "7.14.9", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.9.tgz", + "integrity": "sha512-4yoHbhDYzFa0GLfCzLp5GxH7vPPMAHdZjyE7M/OajM9037zhx0rf+iNsJwp4PT0MSFpwjG7BsHEbPkBQpZ6cYA==", + "dev": true, + "requires": { + "@babel/types": "^7.14.9", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-compilation-targets": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.14.5.tgz", + "integrity": "sha512-v+QtZqXEiOnpO6EYvlImB6zCD2Lel06RzOPzmkz/D/XgQiUu3C/Jb1LOqSt/AIA34TYi/Q+KlT8vTQrgdxkbLw==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.14.5", + "@babel/helper-validator-option": "^7.14.5", + "browserslist": "^4.16.6", + "semver": "^6.3.0" + } + }, + "@babel/helper-function-name": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz", + "integrity": "sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.14.5", + "@babel/template": "^7.14.5", + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz", + "integrity": "sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-hoist-variables": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.14.5.tgz", + "integrity": "sha512-R1PXiz31Uc0Vxy4OEOm07x0oSjKAdPPCh3tPivn/Eo8cvz6gveAeuyUUPB21Hoiif0uoPQSSdhIPS3352nvdyQ==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.14.7", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.14.7.tgz", + "integrity": "sha512-TMUt4xKxJn6ccjcOW7c4hlwyJArizskAhoSTOCkA0uZ+KghIaci0Qg9R043kUMWI9mtQfgny+NQ5QATnZ+paaA==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-module-imports": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.14.5.tgz", + "integrity": "sha512-SwrNHu5QWS84XlHwGYPDtCxcA0hrSlL2yhWYLgeOc0w7ccOl2qv4s/nARI0aYZW+bSwAL5CukeXA47B/1NKcnQ==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-module-transforms": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.8.tgz", + "integrity": "sha512-RyE+NFOjXn5A9YU1dkpeBaduagTlZ0+fccnIcAGbv1KGUlReBj7utF7oEth8IdIBQPcux0DDgW5MFBH2xu9KcA==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.14.5", + "@babel/helper-replace-supers": "^7.14.5", + "@babel/helper-simple-access": "^7.14.8", + "@babel/helper-split-export-declaration": "^7.14.5", + "@babel/helper-validator-identifier": "^7.14.8", + "@babel/template": "^7.14.5", + "@babel/traverse": "^7.14.8", + "@babel/types": "^7.14.8" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.14.5.tgz", + "integrity": "sha512-IqiLIrODUOdnPU9/F8ib1Fx2ohlgDhxnIDU7OEVi+kAbEZcyiF7BLU8W6PfvPi9LzztjS7kcbzbmL7oG8kD6VA==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-replace-supers": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.14.5.tgz", + "integrity": "sha512-3i1Qe9/8x/hCHINujn+iuHy+mMRLoc77b2nI9TB0zjH1hvn9qGlXjWlggdwUcju36PkPCy/lpM7LLUdcTyH4Ow==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.14.5", + "@babel/helper-optimise-call-expression": "^7.14.5", + "@babel/traverse": "^7.14.5", + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-simple-access": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.14.8.tgz", + "integrity": "sha512-TrFN4RHh9gnWEU+s7JloIho2T76GPwRHhdzOWLqTrMnlas8T9O7ec+oEDNsRXndOmru9ymH9DFrEOxpzPoSbdg==", + "dev": true, + "requires": { + "@babel/types": "^7.14.8" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz", + "integrity": "sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA==", + "dev": true, + "requires": { + "@babel/types": "^7.14.5" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.14.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz", + "integrity": "sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g==", + "dev": true + }, + "@babel/helper-validator-option": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz", + "integrity": "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==", + "dev": true + }, + "@babel/helpers": { + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.14.8.tgz", + "integrity": "sha512-ZRDmI56pnV+p1dH6d+UN6GINGz7Krps3+270qqI9UJ4wxYThfAIcI5i7j5vXC4FJ3Wap+S9qcebxeYiqn87DZw==", + "dev": true, + "requires": { + "@babel/template": "^7.14.5", + "@babel/traverse": "^7.14.8", + "@babel/types": "^7.14.8" + } + }, + "@babel/highlight": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", + "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.5", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "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" + } + } + } + }, + "@babel/parser": { + "version": "7.14.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.9.tgz", + "integrity": "sha512-RdUTOseXJ8POjjOeEBEvNMIZU/nm4yu2rufRkcibzkkg7DmQvXU8v3M4Xk9G7uuI86CDGkKcuDWgioqZm+mScQ==", + "dev": true + }, + "@babel/template": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.14.5.tgz", + "integrity": "sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.14.5", + "@babel/parser": "^7.14.5", + "@babel/types": "^7.14.5" + } + }, + "@babel/traverse": { + "version": "7.14.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.9.tgz", + "integrity": "sha512-bldh6dtB49L8q9bUyB7bC20UKgU+EFDwKJylwl234Kv+ySZeMD31Xeht6URyueQ6LrRRpF2tmkfcZooZR9/e8g==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.14.5", + "@babel/generator": "^7.14.9", + "@babel/helper-function-name": "^7.14.5", + "@babel/helper-hoist-variables": "^7.14.5", + "@babel/helper-split-export-declaration": "^7.14.5", + "@babel/parser": "^7.14.9", + "@babel/types": "^7.14.9", + "debug": "^4.1.0", + "globals": "^11.1.0" + } + }, + "@babel/types": { + "version": "7.14.9", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.9.tgz", + "integrity": "sha512-u0bLTnv3DFHeaQLYzb7oRJ1JHr1sv/SYDM7JSqHFFLwXG1wTZRughxFI5NCP8qBEo1rVVsn7Yg2Lvw49nne/Ow==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.9", + "to-fast-properties": "^2.0.0" + } + }, + "@eslint/eslintrc": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", + "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "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" + } + }, + "globals": { + "version": "13.10.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.10.0.tgz", + "integrity": "sha512-piHC3blgLGFjvOuMmWZX60f+na1lXFDhQXBf1UYp2fXPXqvEUbOhNwi6BsQ0bQishwedgnjkwv1d9zKf+MWw3g==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + } + } + }, + "@hapi/bourne": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@hapi/bourne/-/bourne-2.0.0.tgz", + "integrity": "sha512-WEezM1FWztfbzqIUbsDzFRVMxSoLy3HugVcux6KDDtTqzPsLE8NDRHfXvev66aH1i2oOKKar3/XDjbvh/OUBdg==" + }, + "@humanwhocodes/config-array": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + } + }, + "@humanwhocodes/object-schema": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz", + "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==", + "dev": true + }, + "@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "dependencies": { + "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" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "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": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "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" + } + } + } + }, + "@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true + }, + "@sinonjs/commons": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", + "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", + "dev": true, + "requires": { + "type-detect": "4.0.8" + } + }, + "@sinonjs/fake-timers": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-7.1.2.tgz", + "integrity": "sha512-iQADsW4LBMISqZ6Ci1dupJL9pprqwcVFTcOsEmQOEhW+KLCVn/Y4Jrvg2k19fIHCp+iFprriYPTdRcQR8NbUPg==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.7.0" + } + }, + "@sinonjs/samsam": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-6.0.2.tgz", + "integrity": "sha512-jxPRPp9n93ci7b8hMfJOFDPRLFYadN6FSpeROFTR4UNF4i5b+EK6m4QXPO46BDhFgRy1JuS87zAnFOzCUwMJcQ==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.6.0", + "lodash.get": "^4.4.2", + "type-detect": "^4.0.8" + } + }, + "@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 + }, + "@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true + }, + "@vrbo/pino-rotating-file": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@vrbo/pino-rotating-file/-/pino-rotating-file-3.0.0.tgz", + "integrity": "sha512-o00EXEzWfZVOL0gqxakDRkTqGKuCFI/h81uXR+xaD0G/i+kFEbltSgwXqbsyQbGyfrC+W0HiSsl2m4dOmThTzg==", + "requires": { + "debug": "^4.1.1", + "minimist": "^1.2.0", + "pump": "^3.0.0", + "rotating-file-stream": "^2.1.3", + "split2": "^3.1.0", + "through2": "^4.0.0" + } + }, + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true + }, + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "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-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-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "append-transform": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", + "dev": true, + "requires": { + "default-require-extensions": "^3.0.0" + } + }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "args": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/args/-/args-5.0.1.tgz", + "integrity": "sha512-1kqmFCFsPffavQFGt8OxJdIcETti99kySRUPMpOhaGjL6mRJn8HFU1OxKY5bMqfZKUwTQc1mZkAjmGYaVOHFtQ==", + "requires": { + "camelcase": "5.0.0", + "chalk": "2.4.2", + "leven": "2.1.0", + "mri": "1.1.4" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + } + } + }, + "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 + }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, + "atomic-sleep": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", + "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==" + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "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", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "browserslist": { + "version": "4.16.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", + "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001219", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.723", + "escalade": "^3.1.1", + "node-releases": "^1.1.71" + } + }, + "caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "dev": true, + "requires": { + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "camelcase": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", + "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==" + }, + "caniuse-lite": { + "version": "1.0.30001248", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001248.tgz", + "integrity": "sha512-NwlQbJkxUFJ8nMErnGtT0QTM2TJ33xgz4KXJSMIrjXIbDVdaYueGyjOrLKRtJC+rTiWfi6j5cnZN1NBiSBJGNw==", + "dev": true + }, + "chai": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz", + "integrity": "sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==", + "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.1", + "type-detect": "^4.0.5" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "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==", + "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==" + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true + }, + "chokidar": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", + "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", + "dev": true, + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "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 + }, + "string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "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" + } + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "colorette": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", + "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "convert-source-map": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.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==", + "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" + } + }, + "dateformat": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.5.1.tgz", + "integrity": "sha512-OD0TZ+B7yP7ZgpJf5K2DIbj3FZvFvxgFUuaqA/V5zTjAtAAXZ1E8bktHxmAGs4x5b7PflqA9LeQ84Og7wYtF7Q==" + }, + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "requires": { + "ms": "2.1.2" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, + "decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true + }, + "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 + }, + "default-require-extensions": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", + "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", + "dev": true, + "requires": { + "strip-bom": "^4.0.0" + } + }, + "diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true + }, + "doctrine": { + "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" + } + }, + "electron-to-chromium": { + "version": "1.3.792", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.792.tgz", + "integrity": "sha512-RM2O2xrNarM7Cs+XF/OE2qX/aBROyOZqqgP+8FXMXSuWuUqCfUUzg7NytQrzZU3aSqk1Qq6zqnVkJsbfMkIatg==", + "dev": true + }, + "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", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "requires": { + "once": "^1.4.0" + } + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, + "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=" + }, + "eslint": { + "version": "7.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", + "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", + "dev": true, + "requires": { + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.3", + "@humanwhocodes/config-array": "^0.5.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.1.2", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.9", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "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" + } + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "globals": { + "version": "13.10.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.10.0.tgz", + "integrity": "sha512-piHC3blgLGFjvOuMmWZX60f+na1lXFDhQXBf1UYp2fXPXqvEUbOhNwi6BsQ0bQishwedgnjkwv1d9zKf+MWw3g==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "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" + } + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + } + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.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" + }, + "dependencies": { + "eslint-visitor-keys": { + "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 + } + } + }, + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + }, + "espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "dev": true, + "requires": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "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 + } + } + }, + "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.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "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 + }, + "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.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": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fast-redact": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.0.1.tgz", + "integrity": "sha512-kYpn4Y/valC9MdrISg47tZOpYBNoTXKgT9GYXFpHN/jYFs+lFkPoisY+LcBODdKVMY96ATzvzsWv+ES/4Kmufw==" + }, + "fast-safe-stringify": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.8.tgz", + "integrity": "sha512-lXatBjf3WPjmWD6DpIZxkeSsCOwqI0maYMpgDlx8g4U2qi4lbjA9oH/HD2a87G+KfsUmo5WbJFmqBZlPxtptag==" + }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, + "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-cache-dir": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", + "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true + }, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + } + }, + "flatstr": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/flatstr/-/flatstr-1.0.12.tgz", + "integrity": "sha512-4zPxDyhCyiN2wIAtSLI6gc82/EjqZc1onI4Mz/l0pWrAlsSfYH/2ZIcU+e3oA2wDwbzIWNKwa23F8rh6+DRWkw==" + }, + "flatted": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.2.tgz", + "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==", + "dev": true + }, + "foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + } + }, + "fromentries": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", + "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": 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 + }, + "gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true + }, + "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", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, + "glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "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 + }, + "graceful-fs": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", + "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 + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "hasha": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", + "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", + "dev": true, + "requires": { + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" + } + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true + }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "dependencies": { + "resolve-from": { + "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 + } + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "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", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "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==" + }, + "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-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": "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-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-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-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true + }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", + "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", + "dev": true, + "requires": { + "append-transform": "^2.0.0" + } + }, + "istanbul-lib-instrument": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "dev": true, + "requires": { + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + } + }, + "istanbul-lib-processinfo": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", + "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", + "dev": true, + "requires": { + "archy": "^1.0.0", + "cross-spawn": "^7.0.0", + "istanbul-lib-coverage": "^3.0.0-alpha.1", + "make-dir": "^3.0.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^3.3.3" + }, + "dependencies": { + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + } + } + }, + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "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": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", + "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "istanbul-reports": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", + "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, + "jmespath": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz", + "integrity": "sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc=" + }, + "joycon": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.0.1.tgz", + "integrity": "sha512-SJcJNBg32dGgxhPtM0wQqxqV0ax9k/9TaUskGDSJkSFSQOEWWvQ3zzWdGQRIUry2j1zA5+ReH13t0Mf3StuVZA==" + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "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 + }, + "json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "just-extend": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", + "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", + "dev": true + }, + "leven": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", + "integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=" + }, + "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" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, + "lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", + "dev": true + }, + "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.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.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", + "dev": true + }, + "log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + } + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + }, + "mocha": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.0.3.tgz", + "integrity": "sha512-hnYFrSefHxYS2XFGtN01x8un0EwNu2bzKvhpRFhgoybIvMaOkkL60IVPmkb5h6XDmUl4IMSB+rT5cIO4/4bJgg==", + "dev": true, + "requires": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.2", + "debug": "4.3.1", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.7", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "3.0.4", + "ms": "2.1.3", + "nanoid": "3.1.23", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "wide-align": "1.1.3", + "workerpool": "6.1.5", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "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 + }, + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "mri": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.4.tgz", + "integrity": "sha512-6y7IjGPm8AzlvoUrwAaw1tLnUBudaS3752vcd8JtrpGGQn+rXIe63LFVHm/YMwtqAuh+LJPCFdlLYPWM1nYn6w==" + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "nanoid": { + "version": "3.1.23", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz", + "integrity": "sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "nise": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.0.tgz", + "integrity": "sha512-W5WlHu+wvo3PaKLsJJkgPup2LrsXCcm7AWwyNZkUnn5rwPkuPBi3Iwk5SQtN0mv+K65k7nKKjwNQ30wg3wLAQQ==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.7.0", + "@sinonjs/fake-timers": "^7.0.4", + "@sinonjs/text-encoding": "^0.7.1", + "just-extend": "^4.0.2", + "path-to-regexp": "^1.7.0" + } + }, + "node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", + "dev": true, + "requires": { + "process-on-spawn": "^1.0.0" + } + }, + "node-releases": { + "version": "1.1.73", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.73.tgz", + "integrity": "sha512-uW7fodD6pyW2FZNZnp/Z3hvWKeEW1Y8R1+1CnErE8cXFXzl5blBOoVB41CvMer6P6Q0S5FXDwcHgFd1Wj0U9zg==", + "dev": true + }, + "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 + }, + "nyc": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", + "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", + "dev": true, + "requires": { + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^2.0.0", + "get-package-type": "^0.1.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" + }, + "dependencies": { + "ansi-regex": { + "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": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.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 + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "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": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "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 + }, + "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" + } + }, + "string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "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" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.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": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "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" + } + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.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 + }, + "package-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + } + }, + "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" + } + }, + "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 + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-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 + }, + "path-to-regexp": { + "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" + } + }, + "pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true + }, + "picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "dev": true + }, + "pino": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/pino/-/pino-6.13.0.tgz", + "integrity": "sha512-mRXSTfa34tbfrWqCIp1sUpZLqBhcoaGapoyxfEwaWwJGMpLijlRdDKIQUyvq4M3DUfFH5vEglwSw8POZYwbThA==", + "requires": { + "fast-redact": "^3.0.0", + "fast-safe-stringify": "^2.0.8", + "flatstr": "^1.0.12", + "pino-std-serializers": "^3.1.0", + "quick-format-unescaped": "^4.0.3", + "sonic-boom": "^1.0.2" + } + }, + "pino-pretty": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-5.1.2.tgz", + "integrity": "sha512-20HWKSHFvF/pF/C4spBVW0RQdnBYptCj4Bwgb6pFkWY5FOYiElCGHkkPU1173iK8fsoiBMHMEvS0wB2loQZJ+Q==", + "requires": { + "@hapi/bourne": "^2.0.0", + "args": "^5.0.1", + "chalk": "^4.0.0", + "dateformat": "^4.5.1", + "fast-safe-stringify": "^2.0.7", + "jmespath": "^0.15.0", + "joycon": "^3.0.0", + "pump": "^3.0.0", + "readable-stream": "^3.6.0", + "rfdc": "^1.3.0", + "split2": "^3.1.1", + "strip-json-comments": "^3.1.1" + } + }, + "pino-std-serializers": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-3.2.0.tgz", + "integrity": "sha512-EqX4pwDPrt3MuOAAUBMU0Tk5kR/YcCM5fNPEzgCO2zJ5HfX0vbiH9HbJglnyeQsN96Kznae6MWD47pZB5avTrg==" + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + }, + "dependencies": { + "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" + } + }, + "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" + } + } + } + }, + "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 + }, + "prettier": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", + "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==", + "dev": true + }, + "process-on-spawn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", + "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", + "dev": true, + "requires": { + "fromentries": "^1.2.0" + } + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "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" + } + }, + "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 + }, + "quick-format-unescaped": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.3.tgz", + "integrity": "sha512-MaL/oqh02mhEo5m5J2rwsVL23Iw2PEaGVHgT2vFt8AAsr0lfvQA5dpXo9TPu0rz7tSBdUPgkbam0j/fj5ZM8yg==" + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "readable-stream": { + "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", + "util-deprecate": "^1.0.1" + } + }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true + }, + "release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "dev": true, + "requires": { + "es6-error": "^4.0.1" + } + }, + "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-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "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 + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "rfdc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", + "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==" + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "rotating-file-stream": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/rotating-file-stream/-/rotating-file-stream-2.1.5.tgz", + "integrity": "sha512-wnYazkT8oD5HXTj44WhB030aKo74OyICrPz/QKCUah59QD7Np4OhdoTC0WNZfhMx1ClsZp4lYMlAdof+DIkZ1Q==" + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "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": "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 + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "sinon": { + "version": "11.1.2", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-11.1.2.tgz", + "integrity": "sha512-59237HChms4kg7/sXhiRcUzdSkKuydDeTiamT/jesUVHshBgL8XAmhgFo0GfK6RruMDM/iRSij1EybmMog9cJw==", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.8.3", + "@sinonjs/fake-timers": "^7.1.2", + "@sinonjs/samsam": "^6.0.2", + "diff": "^5.0.0", + "nise": "^5.1.0", + "supports-color": "^7.2.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": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "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 + }, + "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 + } + } + }, + "sonic-boom": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-1.4.1.tgz", + "integrity": "sha512-LRHh/A8tpW7ru89lrlkU4AszXt1dbwSjVWguGrmlxE7tawVmDBlI1PILMkXAxJTwqhgsEeTHzj36D5CmHgQmNg==", + "requires": { + "atomic-sleep": "^1.0.0", + "flatstr": "^1.0.12" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "spawn-wrap": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", + "dev": true, + "requires": { + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "which": "^2.0.1" + } + }, + "split2": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", + "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", + "requires": { + "readable-stream": "^3.0.0" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "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_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.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-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + }, + "table": { + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/table/-/table-6.7.1.tgz", + "integrity": "sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg==", + "dev": true, + "requires": { + "ajv": "^8.0.1", + "lodash.clonedeep": "^4.5.0", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ajv": { + "version": "8.6.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.2.tgz", + "integrity": "sha512-9807RlWAgT564wT+DjeyU5OFMPjmzxVobvDFmNAhY+5zD6A2ly3jDp6sgnfyDtlIQ+7H97oc/DGCzzfu9rjw9w==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "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 + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "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" + } + } + } + }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + } + }, + "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 + }, + "through2": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", + "requires": { + "readable-stream": "3" + } + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, + "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" + } + }, + "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" + } + }, + "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==", + "dev": true + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "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": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, + "v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "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" + } + }, + "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 + }, + "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" + } + }, + "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.1.5", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.5.tgz", + "integrity": "sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw==", + "dev": true + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "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": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "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 + }, + "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 + }, + "string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "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" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "ws": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.3.tgz", + "integrity": "sha512-kQ/dHIzuLrS6Je9+uv81ueZomEwH0qVYstcAQ4/Z93K8zeko9gtAbttJWzoC5ukqXY1PpoouV3+VSOqEAFt5wg==" + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "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 + }, + "string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "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" + } + } + } + }, + "yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true + }, + "yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "requires": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "dependencies": { + "camelcase": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", + "dev": true + } + } + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..c4634f2 --- /dev/null +++ b/package.json @@ -0,0 +1,41 @@ +{ + "name": "ws-reconnect-proxy", + "version": "1.0.0", + "description": "Proxy Server that is between a ws server and a ws client. In case of either server / client disconnects graceful or otherwise - initiates/ supports reconnection .", + "main": "index.js", + "scripts": { + "start": "NODE_ENV=dev node cluster.js", + "start:prod": "NODE_ENV=prod LOG_PATH='./logs/proxy.log' node cluster.js | ./node_modules/.bin/rotate-logs", + "test": "NODE_ENV=test ./node_modules/.bin/nyc ./node_modules/.bin/mocha 'test/**/*.js' --exit", + "format": "./node_modules/.bin/prettier --write .", + "eslint": "./node_modules/.bin/eslint *.js", + "eslint:test": "./node_modules/.bin/eslint test/**/*.js", + "eslint:fix": "./node_modules/.bin/eslint *.js --fix", + "test:eslint:fix": "./node_modules/.bin/eslint test/*.js --fix" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/browserstack/ws-reconnect-proxy.git" + }, + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/browserstack/ws-reconnect-proxy/issues" + }, + "homepage": "https://github.com/browserstack/ws-reconnect-proxy#readme", + "dependencies": { + "@vrbo/pino-rotating-file": "^3.0.0", + "pino": "^6.11.3", + "pino-pretty": "^5.1.2", + "uuid": "^8.3.2", + "ws": "^7.5.0" + }, + "devDependencies": { + "chai": "^4.3.4", + "eslint": "^7.32.0", + "mocha": "^9.0.2", + "nyc": "^15.1.0", + "prettier": "^2.3.2", + "sinon": "^11.1.2" + } +} diff --git a/test/config/constants.test.js b/test/config/constants.test.js new file mode 100644 index 0000000..8efcab9 --- /dev/null +++ b/test/config/constants.test.js @@ -0,0 +1,45 @@ +const { config } = require('../../lib/config/constants'); +const { describe, it } = require('mocha'); +const { expect } = require('chai'); + +describe('ConfigParser', () => { + it('#setRetries', () => { + expect(config.setRetries()).to.be.equal(config); + }); + + it('#setRetryDelay', () => { + expect(config.setRetryDelay()).to.be.equal(config); + }); + + it('#setHooks', () => { + expect(config.setHooks()).to.be.equal(config); + }); + + it('#setWorkers', () => { + expect(config.setWorkers()).to.be.equal(config); + }); + + it('#setPort', () => { + expect(config.setPort()).to.be.equal(config); + }); + + it('#setUpstream', () => { + expect(config.setUpstream()).to.be.equal(config); + }); + + it('#setCloseTimer', () => { + expect(config.setCloseTimer()).to.be.equal(config); + }); + + it('#setInstrumentation', () => { + expect(config.setInstrumentation()).to.be.equal(config); + }); + + it('#setInstrumentationTimer', () => { + expect(config.setInstrumentationTimer()).to.be.equal(config); + }); + + it('#setRootConfig', () => { + expect(config.setRootConfig()).to.be.equal(config); + }); +}); diff --git a/test/core/context.test.js b/test/core/context.test.js new file mode 100644 index 0000000..3552581 --- /dev/null +++ b/test/core/context.test.js @@ -0,0 +1,332 @@ +const Context = require('../../lib/core/Context'); +const { EventEmitter } = require('events'); +const { describe, beforeEach, it, afterEach } = require('mocha'); +const { assert, expect } = require('chai'); +const WebSocket = require('ws'); +const { spy, useFakeTimers } = require('sinon'); + +const { + kDequeueMessage, + kMessageReceived, + kDrainCompleted, + kError, + kQueueMessage, + kSendMessage, + kDrainMessage, + kUpstreamRestart, + kReleaseTap, + kClientClosed, + kAddNewContext, + kConnectionOpened, + kEnableIncomingQueue, + kEnableOutgoingQueue, +} = require('../../lib/config/constants'); + +describe('Context', () => { + let context; + let mockServer; + const upstreamUrl = 'ws://localhost:8999/'; + const connectionId = 'TEST123'; + beforeEach(() => { + this.clock = useFakeTimers(); + context = new Context(connectionId); + mockServer = new WebSocket.Server({ port: 8999 }); + this.socket = { + close: spy(), + terminate: spy(), + on: spy(), + send: spy(), + }; + + this.request = { + url: upstreamUrl, + headers: {}, + }; + context.addNewConnection(this.socket, this.request); + this.incomingSocket = context.incomingSocket; + this.outgoingSocket = context.outgoingSocket; + }); + + afterEach(() => { + mockServer.close(); + this.clock.restore(); + }); + + describe('#addNewConnection', () => { + it('should create new connection', (done) => { + expect(this.incomingSocket).not.to.be.undefined; + done(); + }); + + it('should set socket', (done) => { + const context = new Context('TEST1234'); + context.incomingSocket = new EventEmitter(); + context.incomingSocket.setSocket = spy(); + context.outgoingSocket = this.outgoingSocket; + context.addNewConnection(this.socket, this.request); + assert(context.incomingSocket.setSocket.calledOnce); + done(); + }); + }); + + describe('incomingWebSocket', () => { + it('should emit connection opened', () => { + this.incomingSocket.on(kConnectionOpened, () => { + this.outgoingSocket.on(kDequeueMessage, () => { + this.outgoingSocket.drainQueue = spy(); + assert(this.outgoingSocket.drainQueue.calledOnce); + }); + }); + this.incomingSocket.emit(kConnectionOpened); + }); + + it('should queue messages', (done) => { + this.incomingSocket.on(kMessageReceived, () => { + assert(context.incomingLock); + expect(this.incomingSocket.queue).to.not.be.empty; + }); + this.incomingSocket.emit(kMessageReceived); + done(); + }); + + it('should send message', (done) => { + context.outgoingSocket = new EventEmitter(); + context.incomingLock = false; + this.incomingSocket.on(kMessageReceived, (msg) => { + assert(context.incomingLock === false); + assert(msg === 'message'); + this.outgoingSocket.on(kSendMessage, (msg) => { + const sendSpy = spy(); + context.incomingSocket.send = sendSpy; + assert(sendSpy.calledOnce); + assert(msg === 'message'); + }); + }); + this.incomingSocket.emit(kMessageReceived, 'message'); + done(); + }); + + it('should drain message', (done) => { + context.outgoingSocket = new EventEmitter(); + this.incomingSocket.on(kDrainMessage, (msg) => { + assert(msg === 'message'); + this.outgoingSocket.on(kSendMessage, (msg) => { + const sendSpy = spy(); + context.outgoingSocket.send = sendSpy; + assert(sendSpy.calledOnce); + assert(msg === 'message'); + }); + }); + this.incomingSocket.emit(kDrainMessage, 'message'); + done(); + }); + + it('should set incoming lock and send message proxy locked', (done) => { + this.incomingSocket.on(kEnableOutgoingQueue, () => { + assert(context.outgoingLock); + this.incomingSocket.on(kSendMessage, (msg) => { + const sendSpy = spy(); + context.incomingSocket.send = sendSpy; + assert(sendSpy.calledOnce); + assert(msg === 'PROXY_LOCKED'); + }); + }); + this.incomingSocket.emit(kEnableOutgoingQueue); + done(); + }); + + it('should emit event dequeue message', (done) => { + const dequeueSpy = spy(); + this.incomingSocket.on(kDequeueMessage, dequeueSpy); + this.incomingSocket.emit(kDequeueMessage); + assert(dequeueSpy.calledOnce); + done(); + }); + + it('should send message', (done) => { + const sendSpy = spy(); + this.incomingSocket.send = sendSpy; + this.incomingSocket.on(kSendMessage, () => { + assert(this.incomingSocket.send.calledOnce); + }); + this.incomingSocket.emit(kSendMessage); + done(); + }); + + it('should close client', (done) => { + this.incomingSocket.on(kClientClosed, (code, msg) => { + this.outgoingSocket.on(kQueueMessage, () => { + assert(context.incomingLock); + }); + + const closeSpy = spy(); + this.outgoingSocket.close = closeSpy; + this.clock.tick(15000); + expect(code).to.be.equal(1006); + expect(msg).to.be.equal('CLOSED'); + assert(closeSpy.calledOnce); + }); + + this.incomingSocket.emit(kClientClosed, 1006, 'CLOSED'); + done(); + }); + + it('should log error', () => { + const errorSpy = spy(); + this.incomingSocket.on(kError, errorSpy); + this.incomingSocket.emit(kError); + assert(errorSpy.calledOnce); + }); + }); + + describe('outgoingWebsocket', () => { + it('should release tap', (done) => { + context.outgoingSocket.on(kReleaseTap, () => { + this.incomingSocket.on(kDrainMessage, () => { + const sendSpy = spy(); + this.outgoingSocket.send = sendSpy; + this.outgoingSocket.on(kSendMessage, () => { + assert(this.outgoingSocket.send.calledOnce); + }); + }); + this.outgoingSocket.on(kDrainMessage, () => { + const sendSpy = spy(); + this.incomingSocket.send = sendSpy; + this.incomingSocket.on(kSendMessage, () => { + assert(this.incomingSocket.send.calledOnce); + }); + }); + + expect(context.outgoingLock).to.be.equal(false); + expect(context.incomingLock).to.be.equal(false); + }); + this.outgoingSocket.emit(kReleaseTap); + done(); + }); + + it('should send message', (done) => { + this.outgoingSocket.on(kMessageReceived, () => { + expect(context.outgoingLock).to.be.equal(false); + }); + this.outgoingSocket.emit(kMessageReceived); + done(); + }); + + it('should queue message', (done) => { + this.outgoingSocket.on(kQueueMessage, () => { + assert(context.outgoingLock); + this.outgoingSocket.on(kMessageReceived, () => { + assert(context.outgoingLock); + expect(this.incomingSocket.queue).to.not.be.empty; + }); + this.outgoingSocket.emit(kMessageReceived); + }); + this.outgoingSocket.emit(kQueueMessage); + + done(); + }); + + it('should log error', () => { + const errorSpy = spy(); + this.outgoingSocket.on(kError, errorSpy); + this.outgoingSocket.emit(kError); + assert(errorSpy.calledOnce); + }); + + it('should set outgoing lock', (done) => { + this.outgoingSocket.on(kQueueMessage, () => { + assert(context.outgoingLock); + }); + this.outgoingSocket.emit(kQueueMessage); + done(); + }); + + it('should set incoming lock and send message proxy locked', (done) => { + context.outgoingSocket = new EventEmitter(); + this.outgoingSocket.on(kEnableIncomingQueue, () => { + assert(context.incomingLock); + this.outgoingSocket.on(kSendMessage, (msg) => { + const sendSpy = spy(); + context.outgoingSocket.send = sendSpy; + assert(sendSpy.calledOnce); + assert(msg === 'PROXY_LOCKED'); + }); + }); + this.outgoingSocket.emit(kEnableIncomingQueue); + done(); + }); + + it('should send message', (done) => { + const sendSpy = spy(); + this.outgoingSocket.send = sendSpy; + this.outgoingSocket.on(kSendMessage, () => { + assert(this.outgoingSocket.send.calledOnce); + }); + this.outgoingSocket.emit(kSendMessage); + done(); + }); + + it('should emit event dequeue message', (done) => { + const dequeueSpy = spy(); + this.outgoingSocket.on(kDequeueMessage, dequeueSpy); + this.outgoingSocket.on(kDrainCompleted, () => { + expect(context.outgoingLock).to.be.equal(false); + }); + + this.outgoingSocket.on(kDrainCompleted, () => { + expect(context.outgoingLock).to.be.equal(false); + }); + + const sendSpy = spy(); + this.incomingSocket.send = sendSpy; + this.incomingSocket.on(kSendMessage, () => { + assert(this.incomingSocket.send.calledOnce); + }); + this.outgoingSocket.emit(kQueueMessage); + this.outgoingSocket.emit(kDequeueMessage); + assert(dequeueSpy.calledOnce); + done(); + }); + + it('should emit drain message', (done) => { + this.outgoingSocket.on(kDrainMessage, () => { + this.incomingSocket.on(kSendMessage, (msg) => { + const sendSpy = spy(); + this.incomingSocket.send = sendSpy; + expect(msg).to.be.equal('DRAIN MESSAGE'); + assert(sendSpy.calledOnce); + sendSpy.restore(); + }); + }); + this.outgoingSocket.emit(kDrainMessage, 'DRAIN MESSAGE'); + done(); + }); + + it('should emit upstream restart', (done) => { + this.outgoingSocket.on(kUpstreamRestart, (code, msg) => { + expect(code).to.be.equal(1005); + expect(msg).to.be.equal('Service Restart'); + this.incomingSocket.on(kQueueMessage, () => { + assert(context.incomingLock); + }); + }); + this.outgoingSocket.emit(kUpstreamRestart, 1005, 'Service Restart'); + done(); + }); + + it('should emit upstream restart', (done) => { + this.outgoingSocket.on(kAddNewContext, (connectionId) => { + expect(connectionId).to.be.equal('NEW_CONNECTION_ID'); + }); + this.outgoingSocket.emit(kAddNewContext, 'NEW_CONNECTION_ID'); + done(); + }); + }); + + describe('#setConnectionId', () => { + it('should set connection id', () => { + context.setConnectionId('NEW_CONNECTION_ID'); + expect(context.connectionId).to.be.equal('NEW_CONNECTION_ID'); + }); + }); +}); diff --git a/test/core/incomingWebSocket.test.js b/test/core/incomingWebSocket.test.js new file mode 100644 index 0000000..cda1f71 --- /dev/null +++ b/test/core/incomingWebSocket.test.js @@ -0,0 +1,219 @@ +const WebSocket = require('ws'); +const { expect, assert } = require('chai'); +const { spy } = require('sinon'); +const { describe, beforeEach, before, it, after } = require('mocha'); +const IncomingWebSocket = require('../../lib/core/IncomingWebSocket'); +const Queue = require('../../lib/core/Queue'); +const { + kConnectionOpened, + kMessageReceived, + kError, + kClientClosed, + kDrainMessage, + kDrainCompleted, + kEnableOutgoingQueue, +} = require('../../lib/config/constants'); + +describe('IncomingWebSocket', () => { + let mockSocket, incomingWs, newMockServer, newMockSocket; + + before(() => { + mockSocket = new WebSocket('ws://localhost:6666'); + incomingWs = new IncomingWebSocket(mockSocket, 'requestData'); + }); + + describe('#constructor', () => { + it('should set initial values in constructor', () => { + expect(incomingWs.socket).to.equal(mockSocket); + expect(incomingWs.request).to.equal('requestData'); + expect(incomingWs.queue).to.be.an.instanceof(Queue); + expect(incomingWs.teardown).to.equal(false); + }); + }); + + describe('#registerListeners', () => { + it('should call open handler', () => { + incomingWs.on('open', () => { + const openSpy = spy(); + incomingWs.openHandler = openSpy; + assert(openSpy.calledOnce); + }); + }); + + it('should call message handler', () => { + incomingWs.on('message', () => { + const messageSpy = spy(); + incomingWs.messageHandler = messageSpy; + assert(messageSpy.calledOnce); + }); + }); + + it('should call close handler', () => { + incomingWs.on('close', () => { + const closeSpy = spy(); + incomingWs.closeHandler = closeSpy; + assert(closeSpy.calledOnce); + }); + }); + + it('should call error handler', () => { + incomingWs.on('error', () => { + const errorSpy = spy(); + incomingWs.errorHandler = errorSpy; + assert(errorSpy.calledOnce); + }); + }); + }); + + describe('#setSocket', () => { + newMockServer = new WebSocket.Server({ port: 7777 }); + newMockSocket = new WebSocket('ws://localhost:7777'); + + it('should call registerListeners', () => { + const registerSpy = spy(); + incomingWs.registerListeners = registerSpy; + incomingWs.setSocket(newMockSocket, 'new request'); + assert(registerSpy.calledOnce); + }); + + it('should update the socket with new socket', () => { + expect(incomingWs.socket).to.not.equal(mockSocket); + expect(incomingWs.socket).to.equal(newMockSocket); + }); + + it('should update the request with new request', () => { + expect(incomingWs.request).to.not.equal('requestData'); + expect(incomingWs.request).to.equal('new request'); + }); + }); + + describe('#addToQueue', () => { + it('should increase length of queue by one', () => { + const prevLen = incomingWs.queue.size(); + incomingWs.addToQueue('Some Mesg'); + expect(incomingWs.queue.size()).to.equal(prevLen + 1); + }); + }); + + describe('#send(msg)', () => { + it('should send the message on incoming socket', () => { + const mesgSpy = spy(); + incomingWs.socket.send = mesgSpy; + incomingWs.send('sample mesg'); + assert(mesgSpy.calledOnce); + assert(mesgSpy.calledWith('sample mesg')); + }); + }); + + describe('#drainQueue', () => { + let drainSpy; + beforeEach(() => { + drainSpy = spy(); + incomingWs.emit = drainSpy; + }); + + it('should emit kDrainMessage while queue is not empty', () => { + incomingWs.drainQueue(); + assert(drainSpy.calledWith(kDrainMessage)); + }); + + it('should emit total of (queue length + 1) messages', () => { + incomingWs.queue.enqueue('Second Mesg'); + incomingWs.queue.enqueue('Third Mesg'); + const len = incomingWs.queue.size(); + incomingWs.drainQueue(); + expect(drainSpy.callCount).to.equal(len + 1); + }); + + it('should emit kDrainCompleted once when queue empty', () => { + while (!incomingWs.queue.isEmpty()) { + incomingWs.queue.deque(); + } + incomingWs.drainQueue(); + assert(drainSpy.calledOnce); + assert(drainSpy.calledWith(kDrainCompleted)); + }); + }); + + describe('#close', () => { + let terminateSpy; + before(() => { + terminateSpy = spy(); + incomingWs.socket.terminate = terminateSpy; + incomingWs.close(); + }); + + it('should terminate the websocket', () => { + assert(terminateSpy.calledOnce); + }); + + it('should set teardown to true', () => { + expect(incomingWs.teardown).to.equal(true); + }); + }); + + describe('#errorHandler', () => { + it('should emit kError once', () => { + const emitSpy = spy(); + incomingWs.emit = emitSpy; + incomingWs.errorHandler(); + assert(emitSpy.calledOnce); + assert(emitSpy.calledWith(kError)); + }); + }); + + describe('#messageHandler(msg)', () => { + it('should emit kMessageReceived', () => { + const emitSpy = spy(); + incomingWs.emit = emitSpy; + incomingWs.messageHandler('new mesg'); + assert(emitSpy.calledOnce); + assert(emitSpy.calledWith(kMessageReceived, 'new mesg')); + }); + + it('should emit kEnableOutgoingQueue', () => { + const emitSpy = spy(); + incomingWs.emit = emitSpy; + incomingWs.messageHandler('PROXY_RESTART'); + assert(emitSpy.calledOnce); + assert(emitSpy.calledWith(kEnableOutgoingQueue)); + }); + }); + + describe('#closeHandler(code, msg)', () => { + let emitSpy; + beforeEach(() => { + emitSpy = spy(); + incomingWs.emit = emitSpy; + }); + + it('should emit kClientClosed if teardown is false', () => { + incomingWs.teardown = false; + incomingWs.closeHandler(1001, 'closing'); + assert(emitSpy.calledOnce); + assert(emitSpy.calledWith(kClientClosed, 1001, 'closing')); + }); + + it('should emit not kClientClosed if teardown is true', () => { + incomingWs.teardown = true; + incomingWs.closeHandler(1001, 'closing'); + expect(emitSpy.callCount).to.equal(0); + }); + }); + + describe('#openHandler()', () => { + it('should emit kConnectionOpened once', () => { + const emitSpy = spy(); + incomingWs.emit = emitSpy; + incomingWs.openHandler(); + assert(emitSpy.calledOnce); + assert(emitSpy.calledWith(kConnectionOpened)); + }); + }); + + after(() => { + newMockServer.close(); + mockSocket.close(); + newMockSocket.close(); + }); +}); diff --git a/test/core/outgoingWebSocket.test.js b/test/core/outgoingWebSocket.test.js new file mode 100644 index 0000000..26e8d31 --- /dev/null +++ b/test/core/outgoingWebSocket.test.js @@ -0,0 +1,305 @@ +const { describe, beforeEach, before, it } = require('mocha'); +const { expect, assert } = require('chai'); +const { spy } = require('sinon'); +const Queue = require('../../lib/core/Queue'); +const OutgoingWebSocket = require('../../lib/core/OutgoingWebSocket'); +const { + config, + kConnectionOpened, + kAddNewContext, + kReleaseTap, + kMessageReceived, + kUpstreamRestart, + kUpstreamClosed, + kDrainMessage, + kDrainCompleted, + SERVICE_RESTART, + RECONNECT, + kEnableIncomingQueue, +} = require('../../lib/config/constants'); +const utilFn = require('../../lib/util/util'); + +describe('OutgoingWebSocket', () => { + let outgoingWs, upstreamUrl, headers; + before(() => { + upstreamUrl = 'ws://localhost:7423/'; + headers = {}; + outgoingWs = new OutgoingWebSocket(upstreamUrl, headers); + }); + + describe('#constructor(url, headers)', () => { + it('should set initial values in constructor', () => { + expect(outgoingWs.url).to.equal(upstreamUrl); + expect(outgoingWs.shouldRetry).to.equal(false); + expect(outgoingWs.socket).to.equal(null); + expect(outgoingWs.reconnectInfo).to.equal(null); + expect(outgoingWs.queue).to.be.an.instanceof(Queue); + expect(outgoingWs.retryCount).to.equal(config.retryVal); + }); + }); + + describe('#registerListeners', () => { + it('should call open handler', () => { + outgoingWs.on('open', () => { + const openSpy = spy(); + outgoingWs.openHandler = openSpy; + assert(openSpy.calledOnce); + }); + }); + + it('should call message handler', () => { + outgoingWs.on('message', () => { + const messageSpy = spy(); + outgoingWs.messageHandler = messageSpy; + assert(messageSpy.calledOnce); + }); + }); + + it('should call close handler', () => { + outgoingWs.on('close', () => { + const closeSpy = spy(); + outgoingWs.closeHandler = closeSpy; + assert(closeSpy.calledOnce); + }); + }); + + it('should call error handler', () => { + outgoingWs.on('error', () => { + const errorSpy = spy(); + outgoingWs.errorHandler = errorSpy; + assert(errorSpy.calledOnce); + }); + }); + }); + + describe('#openHandler', () => { + it('should send reconnectInfo if it is not null', () => { + const sendSpy = spy(); + outgoingWs.send = sendSpy; + outgoingWs.reconnectInfo = 'not null'; + outgoingWs.openHandler(); + assert(sendSpy.calledOnce); + assert(sendSpy.calledWith('not null')); + }); + + it('should not send reconnectInfo if null', () => { + const sendSpy = spy(); + outgoingWs.send = sendSpy; + outgoingWs.reconnectInfo = null; + outgoingWs.openHandler(); + expect(sendSpy.callCount).to.equal(0); + }); + + it('should emit kConnectionOpened once', () => { + const emitSpy = spy(); + outgoingWs.emit = emitSpy; + outgoingWs.openHandler(); + assert(emitSpy.calledOnce); + assert(emitSpy.calledWith(kConnectionOpened)); + }); + + it('should set shouldRetry to false', () => { + outgoingWs.shouldRetry = true; + outgoingWs.openHandler(); + expect(outgoingWs.shouldRetry).to.equal(false); + }); + + it('should set retryCount to config.retryVal', () => { + outgoingWs.retryCount = 'not config retry value'; + outgoingWs.openHandler(); + expect(outgoingWs.retryCount).to.equal(config.retryVal); + }); + }); + + describe('#messageHandler', () => { + it('should emit only kMessageReceived once if mesg is null', () => { + const msgSpy = spy(); + outgoingWs.emit = msgSpy; + outgoingWs.messageHandler(null); + assert(msgSpy.calledOnce); + assert(msgSpy.calledWith(kMessageReceived, null)); + }); + + it('should emit only kMessageReceived once if mesg is undefined', () => { + const msgSpy = spy(); + outgoingWs.emit = msgSpy; + outgoingWs.messageHandler(undefined); + assert(msgSpy.calledOnce); + assert(msgSpy.calledWith(kMessageReceived, undefined)); + }); + + it('should emit only kMessageReceived once if message is not RECONNECT', () => { + const msgSpy = spy(); + outgoingWs.emit = msgSpy; + outgoingWs.messageHandler('some message'); + assert(msgSpy.calledOnce); + assert(msgSpy.calledWith(kMessageReceived, 'some message')); + }); + + it('should not update reconnectInfo in case message is not RECONNECT', () => { + outgoingWs.reconnectInfo = 'existing'; + outgoingWs.messageHandler(null); + expect(outgoingWs.reconnectInfo).to.equal('existing'); + }); + + it('should update reconnectInfo in case message is RECONNECT', () => { + outgoingWs.reconnectInfo = 'existing'; + outgoingWs.messageHandler(RECONNECT); + expect(outgoingWs.reconnectInfo).to.equal(RECONNECT); + }); + + it('should emit kAddNewContext, kReleaseTap in case message is RECONNECT', () => { + const msgSpy = spy(); + outgoingWs.emit = msgSpy; + outgoingWs.connectionId = '123'; + outgoingWs.messageHandler(RECONNECT); + assert(msgSpy.calledTwice); + assert(msgSpy.calledWith(kAddNewContext, '123')); + assert(msgSpy.calledWith(kReleaseTap)); + }); + + it('should not emit kMessageReceived in case message is RECONNECT', () => { + const msgSpy = spy(); + outgoingWs.emit = msgSpy; + outgoingWs.connectionId = '123'; + outgoingWs.messageHandler(RECONNECT); + assert(msgSpy.calledTwice); + expect(msgSpy.calledWith(kMessageReceived)).to.equal(false); + }); + + it('should emit kEnableIncomingQueue', () => { + const emitSpy = spy(); + outgoingWs.emit = emitSpy; + outgoingWs.messageHandler('PROXY_RESTART'); + assert(emitSpy.calledOnce); + assert(emitSpy.calledWith(kEnableIncomingQueue)); + }); + }); + + describe('#closeHandler', () => { + const retrySpy = spy(); + const emitSpy = spy(); + beforeEach(() => { + outgoingWs.startRetries = retrySpy; + outgoingWs.emit = emitSpy; + }); + + it('should not emit anything is shouldRetry is true', () => { + outgoingWs.shouldRetry = true; + outgoingWs.closeHandler(1001, 'close message'); + expect(retrySpy.callCount).to.equal(0); + expect(emitSpy.callCount).to.equal(0); + }); + + it('should emit kUpstreamClosed if shouldRetry false and msg is not SERVICE_RESTART', () => { + outgoingWs.shouldRetry = false; + outgoingWs.closeHandler(1001, 'not SERVICE_RESTART'); + assert(emitSpy.calledOnce); + assert(emitSpy.calledWith(kUpstreamClosed, 1001, 'not SERVICE_RESTART')); + }); + + it('should not update shouldRetry if shouldRetry false and msg is not SERVICE_RESTART', () => { + outgoingWs.shouldRetry = false; + outgoingWs.closeHandler(1001, 'not SERVICE_RESTART'); + expect(outgoingWs.shouldRetry).to.equal(false); + }); + + it('should update shouldRetry if shouldRetry false and msg === SERVICE_RESTART', () => { + outgoingWs.shouldRetry = false; + outgoingWs.closeHandler(1001, SERVICE_RESTART); + expect(outgoingWs.shouldRetry).to.equal(true); + }); + + it('should emit kUpstreamRestart if shouldRetry false and msg === SERVICE_RESTART', () => { + const eSpy = spy(); + outgoingWs.emit = eSpy; + outgoingWs.shouldRetry = false; + outgoingWs.closeHandler(1001, SERVICE_RESTART); + assert(eSpy.calledOnce); + assert(eSpy.calledWith(kUpstreamRestart, 1001, SERVICE_RESTART)); + }); + }); + + describe('#errorHandler', () => { + it('should emit kError', () => { + const errSpy = spy(); + outgoingWs.emit = errSpy; + outgoingWs.errorHandler(); + assert(errSpy.calledOnce); + }); + }); + + describe('#addToQueue', () => { + it('should increase length of queue by one', () => { + const prevLen = outgoingWs.queue.size(); + outgoingWs.addToQueue('Some Mesg'); + expect(outgoingWs.queue.size()).to.equal(prevLen + 1); + }); + }); + + describe('#drainQueue', () => { + let drainSpy; + beforeEach(() => { + drainSpy = spy(); + outgoingWs.emit = drainSpy; + }); + + it('should emit kDrainMessage while queue is not empty', () => { + outgoingWs.drainQueue(); + assert(drainSpy.calledWith(kDrainMessage)); + }); + + it('should emit total of (queue length + 1) messages', () => { + outgoingWs.queue.enqueue('Second Mesg'); + outgoingWs.queue.enqueue('Third Mesg'); + const len = outgoingWs.queue.size(); + outgoingWs.drainQueue(); + expect(drainSpy.callCount).to.equal(len + 1); + }); + + it('should emit kDrainCompleted once when queue empty', () => { + while (!outgoingWs.queue.isEmpty()) { + outgoingWs.queue.deque(); + } + outgoingWs.drainQueue(); + assert(drainSpy.calledOnce); + assert(drainSpy.calledWith(kDrainCompleted)); + }); + }); + + describe('#setConnectionId', () => { + it('should call util extractConnectionId method', () => { + const extractIdFun = spy(utilFn, 'extractConnectionId'); + outgoingWs.headers = { + 'x-connection-id': '123_id', + }; + outgoingWs.setConnectionId(); + expect(extractIdFun.calledOnce); + }); + + it('should update connectionId', () => { + outgoingWs.connectionId = 'old_id'; + outgoingWs.headers = { + 'x-connection-id': 'new_id', + }; + outgoingWs.setConnectionId(); + expect(outgoingWs.connectionId).to.eq('new_id'); + }); + }); + + describe('#setHeaders', () => { + it('should remove disallowed headers and set the headers', () => { + const headers = { + host: 'localhost', + connection: 'some-connection', + 'sec-websocket-key': 'some-key-123', + 'sec-websocket-version': 'some-version-1.0.0', + upgrade: 'false', + notdisallowed: 'should remain', + }; + outgoingWs.setHeaders(headers); + expect(outgoingWs.headers).to.be.an.instanceof(Object); + expect(outgoingWs.headers['notdisallowed']).to.equal('should remain'); + }); + }); +}); diff --git a/test/core/proxy.test.js b/test/core/proxy.test.js new file mode 100644 index 0000000..64968fd --- /dev/null +++ b/test/core/proxy.test.js @@ -0,0 +1,88 @@ +const Proxy = require('../../lib/core/Proxy'); +const Context = require('../../lib/core/Context'); +const { describe, it, before, after } = require('mocha'); +const { expect } = require('chai'); +const { spy, stub } = require('sinon'); +const { kAddNewContext } = require('../../lib/config/constants'); +const http = require('http'); + +describe('Proxy', () => { + before(() => { + this.upstreamUrl = 'ws://localhost:8991/'; + this.socket = { + close: spy(), + terminate: spy(), + on: spy(), + send: spy(), + }; + + this.request = { + pipe: spy(), + url: this.upstreamUrl, + headers: { + 'x-connection-id': 'CONNECTION_ID', + }, + }; + + this.response = { + writeHead: spy(), + }; + + this.proxy = new Proxy(); + }); + + after(() => { + this.proxy.httpServer.close(); + this.proxy.server.close(); + }); + + it('should handle request', () => { + const requestStub = stub(http, 'request'); + this.proxy.requestHandler(this.request, this.response); + expect(requestStub.calledOnce).to.be.equal(true); + }); + + it('should set connection id', () => { + this.proxy.connectionHandler(this.socket, this.request); + expect(this.proxy.contexts.has('CONNECTION_ID')).to.be.equal(true); + }); + + it('should add new context', () => { + this.proxy.connectionHandler(this.socket, this.request); + const context = this.proxy.contexts.get('CONNECTION_ID'); + context.on(kAddNewContext, (connectionId) => { + expect(this.proxy.contexts.has(connectionId)).to.be.equal(true); + }); + context.emit(kAddNewContext, 'NEW_CONNECTION_ID'); + }); + + it('should reconnect and add new connection', () => { + const request = { + url: this.upstreamUrl, + headers: { + 'x-reconnect-id': 'DUMMY_CONNECTION_ID', + 'x-connection-id': 'DUMMY_CONNECTION_ID', + }, + }; + const context = new Context(request.headers['x-connection-id']); + this.proxy.contexts.set(request.headers['x-connection-id'], context); + this.proxy.connectionHandler(this.socket, request); + expect( + this.proxy.contexts.has(request.headers['x-reconnect-id']) + ).to.be.equal(true); + }); + + it('should not have connection id', () => { + const request = { + url: this.upstreamUrl, + headers: { + 'x-reconnect-id': 'TEST_CONNECTION_ID', + 'x-connection-id': 'TEST_CONNECTION_ID', + }, + }; + this.proxy.connectionHandler(this.socket, request); + expect( + this.proxy.contexts.has(request.headers['x-reconnect-id']) + ).to.be.equal(false); + }); +}); diff --git a/test/core/queue.test.js b/test/core/queue.test.js new file mode 100644 index 0000000..cc961e7 --- /dev/null +++ b/test/core/queue.test.js @@ -0,0 +1,40 @@ +const Queue = require('../../lib/core/Queue'); +const { describe, beforeEach, it } = require('mocha'); +const { expect } = require('chai'); + +describe('Queue', () => { + let queue; + beforeEach(() => { + queue = new Queue(); + }); + + it('#enqueue', () => { + const data = 'DATA'; + queue.enqueue(data); + expect(queue.size()).to.equal(1); + }); + + it('#size', () => { + const data = 'DATA'; + queue.enqueue(data); + queue.enqueue(data); + expect(queue.size()).to.equal(2); + expect(queue.isEmpty()).to.be.equal(false); + }); + + describe('#dequeue', () => { + it('#deque', () => { + const data = 'DATA'; + queue.enqueue(data); + expect(queue.dequeue(data)).to.be.equal('DATA'); + }); + + it('#deque in empty queue', () => { + expect(queue.dequeue('DATA')).to.be.equal(null); + }); + }); + + it('#isEmpty', () => { + expect(queue.isEmpty()).to.be.equal(true); + }); +}); diff --git a/test/util/instrumentation.test.js b/test/util/instrumentation.test.js new file mode 100644 index 0000000..c9b82ee --- /dev/null +++ b/test/util/instrumentation.test.js @@ -0,0 +1,21 @@ +const Instrumentation = require('../../lib/util/Instrumentation'); +const { describe, it, beforeEach } = require('mocha'); +const sinon = require('sinon'); +const { expect } = require('chai'); +const logger = require('../../lib/util/loggerFactory'); + +describe('typeSanity', () => { + let instrumentation; + beforeEach(() => { + instrumentation = new Instrumentation(); + }); + + describe('#pushMetrics', () => { + it('should log metrics', () => { + const loggerStub = sinon.stub(logger, 'info'); + instrumentation.pushMetrics(); + expect(loggerStub.calledOnce).to.be.equal(true); + loggerStub.restore(); + }); + }); +}); diff --git a/test/util/metrics.test.js b/test/util/metrics.test.js new file mode 100644 index 0000000..22e2cea --- /dev/null +++ b/test/util/metrics.test.js @@ -0,0 +1,67 @@ +const { + incrReconnectionCount, + incrActiveConnectionCount, + incrNewConnect, + incrClosedConnectionCount, + incrErrorConnectionCount, + decrActiveConnectionCount, + getMetrics, + setMetrics, +} = require('../../lib/util/metrics'); +const { describe, it } = require('mocha'); +const { expect } = require('chai'); + +describe('#incrReconnectCount', () => { + it('should increment reconnect connection count', () => { + incrReconnectionCount(); + expect(getMetrics().reconnectionCount).to.be.greaterThanOrEqual(1); + }); +}); + +describe('#incrActiveConnectionCount', () => { + it('should increment active connection count', () => { + incrActiveConnectionCount(); + expect(getMetrics().activeConnectionCount).to.be.greaterThanOrEqual(1); + }); +}); + +describe('#incrNewConnect', () => { + it('should increment new connection count', () => { + incrNewConnect(); + expect(getMetrics().newConnectionsCount).to.be.greaterThanOrEqual(1); + }); +}); + +describe('#incrClosedConnectionCount', () => { + it('should increment closed connection count', () => { + incrClosedConnectionCount(); + expect(getMetrics().closedConnectionCount).to.be.greaterThanOrEqual(1); + }); +}); + +describe('#incrErrorConnectionCount', () => { + it('should increment error connection count', () => { + incrErrorConnectionCount(); + expect(getMetrics().errorConnectionCount).to.be.greaterThanOrEqual(1); + }); +}); + +describe('#decrActiveConnectionCount', () => { + it('should decrement active connection count', () => { + decrActiveConnectionCount(); + expect(getMetrics().activeConnectionCount).to.be.greaterThanOrEqual(0); + }); +}); + +describe('#setMetric', () => { + it('should set metric', () => { + setMetrics(); + expect(getMetrics().newConnectionsCount).to.be.equal(0); + }); +}); + +describe('#getMetric', () => { + it('should get metric', () => { + expect(getMetrics()).not.to.be.undefined; + }); +}); diff --git a/test/util/typeSanity.test.js b/test/util/typeSanity.test.js new file mode 100644 index 0000000..43a27ab --- /dev/null +++ b/test/util/typeSanity.test.js @@ -0,0 +1,96 @@ +const { + isUndefined, + isNotUndefined, + isString, + isNumber, + isNotNumber, + isNotString, +} = require('../../lib/util/typeSanity'); +const { describe, it } = require('mocha'); +const { expect } = require('chai'); + +describe('typeSanity', () => { + describe('#isUndefined', () => { + it('should return true for undefined values', () => { + expect(isUndefined(undefined)).to.be.equal(true); + }); + + it('should return true for null values', () => { + expect(isUndefined(null)).to.be.equal(true); + }); + + it('should return true for empty values', () => { + expect(isUndefined('')).to.be.equal(true); + }); + + it('should return false for valid values', () => { + expect(isUndefined('value')).to.be.equal(false); + }); + }); + + describe('#isNotUndefined', () => { + it('should return false for undefined values', () => { + expect(isNotUndefined(undefined)).to.be.equal(false); + }); + + it('should return false for null values', () => { + expect(isNotUndefined(null)).to.be.equal(false); + }); + + it('should return false for empty values', () => { + expect(isNotUndefined('')).to.be.equal(false); + }); + + it('should return true for valid values', () => { + expect(isNotUndefined('value')).to.be.equal(true); + }); + }); + + describe('#isString', () => { + it('should return false for undefined values', () => { + expect(isString(undefined)).to.be.equal(false); + }); + + it('should return true for valid string values', () => { + expect(isString('value')).to.be.equal(true); + }); + }); + + describe('#isNotString', () => { + it('should return true for undefined values', () => { + expect(isNotString(undefined)).to.be.equal(true); + }); + + it('should return false for valid string values', () => { + expect(isNotString('value')).to.be.equal(false); + }); + }); + + describe('#isNumber', () => { + it('should return false for undefined values', () => { + expect(isNumber(undefined)).to.be.equal(false); + }); + + it('should return false for string values', () => { + expect(isNumber('value')).to.be.equal(false); + }); + + it('should return true for number values', () => { + expect(isNumber(99)).to.be.equal(true); + }); + }); + + describe('#isNotNumber', () => { + it('should return false for undefined values', () => { + expect(isNotNumber(undefined)).to.be.equal(true); + }); + + it('should return true for string values', () => { + expect(isNotNumber('value')).to.be.equal(true); + }); + + it('should return false for number values', () => { + expect(isNotNumber(99)).to.be.equal(false); + }); + }); +}); diff --git a/test/util/util.test.js b/test/util/util.test.js new file mode 100644 index 0000000..0229688 --- /dev/null +++ b/test/util/util.test.js @@ -0,0 +1,56 @@ +const { + createTarget, + extractReconnectId, + extractConnectionId, + isReconnectHeader, +} = require('../../lib/util/util'); +const { describe, it } = require('mocha'); +const { expect } = require('chai'); + +describe('#createTarget', () => { + it('should return url', () => { + expect(createTarget('/somecaps')).to.be.contains('/somecaps'); + }); +}); + +describe('#extractReconnectId', () => { + it('should return reconnect id', () => { + const headers = { + 'x-reconnect-id': 'TEST123', + }; + expect(extractReconnectId(headers)).to.be.equal('TEST123'); + }); + + it('should return undefined if no reconnect id header present', () => { + const headers = {}; + expect(extractReconnectId(headers)).to.be.equal(undefined); + }); +}); + +describe('#extractConnectionId', () => { + it('should return connection id', () => { + const headers = { + 'x-connection-id': 'TEST123', + }; + expect(extractConnectionId(headers)).to.be.equal('TEST123'); + }); + + it('should return undefined if connection id header absent', () => { + const headers = {}; + expect(extractConnectionId(headers)).to.be.equal(undefined); + }); +}); + +describe('#isReconnectHeader', () => { + it('should return true if reconnect header present', () => { + const headers = { + 'x-reconnect-id': 'TEST123', + }; + expect(isReconnectHeader(headers)).to.be.equal(true); + }); + + it('should return false if reconnect header absent', () => { + const headers = {}; + expect(isReconnectHeader(headers)).to.be.equal(false); + }); +}); diff --git a/tmp/restart.txt b/tmp/restart.txt new file mode 100644 index 0000000..e69de29