From 6c000ab09391acd94d43464da9e911784ad736c7 Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Mon, 12 Oct 2020 20:32:32 +0530 Subject: [PATCH] Added logger, handled checksum fail --- Example/example.ts | 3 +- package.json | 3 + src/Tests/Tests.Connect.ts | 28 ++++ src/WAConnection/0.Base.ts | 20 +-- src/WAConnection/1.Validation.ts | 13 +- src/WAConnection/3.Connect.ts | 121 ++++++++-------- src/WAConnection/4.Events.ts | 4 +- src/WAConnection/6.MessagesSend.ts | 6 +- src/WAConnection/8.Groups.ts | 6 +- src/WAConnection/Constants.ts | 6 - src/WAConnection/Utils.ts | 18 ++- yarn.lock | 215 ++++++++++++++++++++++++++++- 12 files changed, 342 insertions(+), 101 deletions(-) diff --git a/Example/example.ts b/Example/example.ts index f16024d..26b1c98 100644 --- a/Example/example.ts +++ b/Example/example.ts @@ -5,7 +5,6 @@ import { MessageOptions, Mimetype, WALocationMessage, - MessageLogLevel, WA_MESSAGE_STUB_TYPES, ReconnectMode, ProxyAgent, @@ -16,7 +15,7 @@ import * as fs from 'fs' async function example() { const conn = new WAConnection() // instantiate conn.autoReconnect = ReconnectMode.onConnectionLost // only automatically reconnect when the connection breaks - conn.logLevel = MessageLogLevel.info // set to unhandled to see what kind of stuff you can implement + conn.logger.level = 'debug' // set to 'debug' to see what kind of stuff you can implement // attempt to reconnect at most 10 times in a row conn.connectOptions.maxRetries = 10 conn.chatOrderingKey = waChatKey(true) // order chats such that pinned chats are on top diff --git a/package.json b/package.json index f01ecaa..8af3096 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,8 @@ "https-proxy-agent": "^5.0.0", "jimp": "^0.16.1", "node-fetch": "^2.6.0", + "pino": "^6.7.0", + "pino-pretty": "^4.3.0", "protobufjs": "^6.10.1", "qrcode-terminal": "^0.12.0", "ws": "^7.3.1" @@ -50,6 +52,7 @@ "devDependencies": { "@types/mocha": "^7.0.2", "@types/node": "^14.6.2", + "@types/pino": "^6.3.2", "@types/ws": "^7.2.6", "assert": "^2.0.0", "dotenv": "^8.2.0", diff --git a/src/Tests/Tests.Connect.ts b/src/Tests/Tests.Connect.ts index cad1c8b..1608959 100644 --- a/src/Tests/Tests.Connect.ts +++ b/src/Tests/Tests.Connect.ts @@ -108,6 +108,34 @@ describe ('Reconnects', () => { conn.close () } + it('should dispose correctly on bad_session', async () => { + const conn = new WAConnection() + conn.autoReconnect = ReconnectMode.onAllErrors + conn.loadAuthInfo ('./auth_info.json') + + let gotClose0 = false + let gotClose1 = false + + conn.on ('intermediate-close', ({ reason }) => { + gotClose0 = true + }) + conn.on ('close', ({ reason }) => { + if (reason === DisconnectReason.badSession) gotClose1 = true + }) + setTimeout (() => conn['conn'].emit ('message', Buffer.from('some-tag,sdjjij1jo2ejo1je')), 1500) + await conn.connect () + + setTimeout (() => conn['conn'].emit ('message', Buffer.from('some-tag,sdjjij1jo2ejo1je')), 1500) + + await new Promise (resolve => { + conn.on ('open', resolve) + }) + + assert.ok (gotClose0, 'did not receive bad_session close initially') + assert.ok (gotClose1, 'did not receive bad_session close') + + conn.close () + }) /** * the idea is to test closing the connection at multiple points in the connection * and see if the library cleans up resources correctly diff --git a/src/WAConnection/0.Base.ts b/src/WAConnection/0.Base.ts index 0561470..90c4885 100644 --- a/src/WAConnection/0.Base.ts +++ b/src/WAConnection/0.Base.ts @@ -9,7 +9,6 @@ import { WAUser, WANode, WATag, - MessageLogLevel, BaileysError, WAMetric, WAFlag, @@ -27,6 +26,9 @@ import { import { EventEmitter } from 'events' import KeyedDB from '@adiwajshing/keyed-db' import { STATUS_CODES, Agent } from 'http' +import pino from 'pino' + +const logger = pino({ prettyPrint: { levelFirst: true, ignore: 'hostname', translateTime: true }, prettifier: require('pino-pretty') }) export class WAConnection extends EventEmitter { /** The version of WhatsApp Web we're telling the servers we are */ @@ -35,8 +37,6 @@ export class WAConnection extends EventEmitter { browserDescription: [string, string, string] = Utils.Browsers.baileys ('Chrome') /** Metadata like WhatsApp id, name set on WhatsApp etc. */ user: WAUser - /** What level of messages to log to the console */ - logLevel: MessageLogLevel = MessageLogLevel.info /** Should requests be queued when the connection breaks in between; if 0, then an error will be thrown */ pendingRequestTimeoutMs: number = null /** The connection state */ @@ -57,6 +57,8 @@ export class WAConnection extends EventEmitter { /** key to use to order chats */ chatOrderingKey = Utils.waChatKey(false) + logger = logger.child ({ class: 'Baileys' }) + /** log messages */ shouldLogMessages = false messageLog: { tag: string, json: string, fromMe: boolean, binaryTags?: any[] }[] = [] @@ -141,7 +143,7 @@ export class WAConnection extends EventEmitter { if (!authInfo) throw new Error('given authInfo is null') if (typeof authInfo === 'string') { - this.log(`loading authentication credentials from ${authInfo}`, MessageLogLevel.info) + this.logger.info(`loading authentication credentials from ${authInfo}`) const file = fs.readFileSync(authInfo, { encoding: 'utf-8' }) // load a closed session back if it exists authInfo = JSON.parse(file) as AnyAuthenticationCredentials } @@ -205,7 +207,7 @@ export class WAConnection extends EventEmitter { delete this.callbacks[func][key][key2] return } - this.log('WARNING: could not find ' + JSON.stringify(parameters) + ' to deregister', MessageLogLevel.info) + this.logger.warn('Could not find ' + JSON.stringify(parameters) + ' to deregister') } /** * Wait for a message with a certain tag to be received @@ -330,7 +332,7 @@ export class WAConnection extends EventEmitter { this.closeInternal (DisconnectReason.intentional) } protected closeInternal (reason?: DisconnectReason, isReconnecting: boolean=false) { - this.log (`closed connection, reason ${reason}${isReconnecting ? ', reconnecting in a few seconds...' : ''}`, MessageLogLevel.info) + this.logger.info (`closed connection, reason ${reason}${isReconnecting ? ', reconnecting in a few seconds...' : ''}`) this.qrTimeout && clearTimeout (this.qrTimeout) this.debounceTimeout && clearTimeout (this.debounceTimeout) @@ -368,7 +370,7 @@ export class WAConnection extends EventEmitter { Object.keys(this.callbacks).forEach(key => { if (!key.startsWith('function:')) { - this.log (`cancelling message wait: ${key}`, MessageLogLevel.info) + this.logger.trace (`cancelling message wait: ${key}`) this.callbacks[key].errCallback(new Error('close')) delete this.callbacks[key] } @@ -389,7 +391,7 @@ export class WAConnection extends EventEmitter { const seconds = Utils.unixTimestampSeconds(this.referenceDate) return `${longTag ? seconds : (seconds%1000)}.--${this.msgCount}` } - protected log(text, level: MessageLogLevel) { + /*protected log(text, level: MessageLogLevel) { (this.logLevel >= level) && console.log(`[Baileys][${new Date().toLocaleString()}] ${text}`) - } + }*/ } diff --git a/src/WAConnection/1.Validation.ts b/src/WAConnection/1.Validation.ts index b5beca6..b227b48 100644 --- a/src/WAConnection/1.Validation.ts +++ b/src/WAConnection/1.Validation.ts @@ -1,7 +1,7 @@ import * as Curve from 'curve25519-js' import * as Utils from './Utils' import {WAConnection as Base} from './0.Base' -import { MessageLogLevel, WAMetric, WAFlag, BaileysError, Presence, WAUser, DisconnectReason } from './Constants' +import { WAMetric, WAFlag, BaileysError, Presence, WAUser } from './Constants' export class WAConnection extends Base { @@ -62,14 +62,14 @@ export class WAConnection extends Base { const validationJSON = (await Promise.all (initQueries)).slice(-1)[0] // get the last result this.user = await this.validateNewConnection(validationJSON[1]) // validate the connection - this.log('validated connection successfully', MessageLogLevel.info) + this.logger.info('validated connection successfully') const response = await this.query({ json: ['query', 'ProfilePicThumb', this.user.jid], waitForOpen: false, expect200: false }) this.user.imgUrl = response?.eurl || '' this.sendPostConnectQueries () - this.log('sent init queries', MessageLogLevel.info) + this.logger.debug('sent init queries') } /** * Send the same queries WA Web sends after connect @@ -176,7 +176,8 @@ export class WAConnection extends Base { const bytes = Buffer.from(challenge, 'base64') // decode the base64 encoded challenge string const signed = Utils.hmacSign(bytes, this.authInfo.macKey).toString('base64') // sign the challenge string with our macKey const json = ['admin', 'challenge', signed, this.authInfo.serverToken, this.authInfo.clientID] // prepare to send this signed string with the serverToken & clientID - this.log('resolving login challenge', MessageLogLevel.info) + + this.logger.info('resolving login challenge') return this.query({json, expect200: true, waitForOpen: false}) } /** When starting a new session, generate a QR code by generating a private/public key pair & the keys the server sends */ @@ -193,14 +194,14 @@ export class WAConnection extends Base { this.qrTimeout = setTimeout (() => { if (this.state === 'open') return - this.log ('regenerated QR', MessageLogLevel.info) + this.logger.debug ('regenerated QR') this.generateNewQRCodeRef () .then (newRef => ref = newRef) .then (emitQR) .then (regenQR) .catch (err => { - this.log (`error in QR gen: ${err}`, MessageLogLevel.info) + this.logger.error (`error in QR gen: `, err) if (err.status === 429) { // too many QR requests this.endConnection () } diff --git a/src/WAConnection/3.Connect.ts b/src/WAConnection/3.Connect.ts index b193a5a..36c951d 100644 --- a/src/WAConnection/3.Connect.ts +++ b/src/WAConnection/3.Connect.ts @@ -1,5 +1,5 @@ import * as Utils from './Utils' -import { WAMessage, WAChat, MessageLogLevel, WANode, KEEP_ALIVE_INTERVAL_MS, BaileysError, WAConnectOptions, DisconnectReason, UNAUTHORIZED_CODES, WAContact, TimedOutError, CancelledError, WAOpenResult, DEFAULT_ORIGIN, WS_URL } from './Constants' +import { WAMessage, WAChat, WANode, KEEP_ALIVE_INTERVAL_MS, BaileysError, WAConnectOptions, DisconnectReason, UNAUTHORIZED_CODES, WAContact, TimedOutError, CancelledError, WAOpenResult, DEFAULT_ORIGIN, WS_URL } from './Constants' import {WAConnection as Base} from './1.Validation' import Decoder from '../Binary/Decoder' import WS from 'ws' @@ -37,7 +37,7 @@ export class WAConnection extends Base { const willReconnect = !loggedOut && (tries <= (options?.maxRetries || 5)) && this.state === 'connecting' const reason = loggedOut ? DisconnectReason.invalidSession : error.message - this.log (`connect attempt ${tries} failed: ${error}${ willReconnect ? ', retrying...' : ''}`, MessageLogLevel.info) + this.logger.warn (`connect attempt ${tries} failed${ willReconnect ? ', retrying...' : ''}`, error) if ((this.state as string) !== 'close' && !willReconnect) { this.closeInternal (reason) @@ -53,7 +53,7 @@ export class WAConnection extends Base { this.releasePendingRequests () - this.log ('opened connection to WhatsApp Web', MessageLogLevel.info) + this.logger.info ('opened connection to WhatsApp Web') this.conn.on ('close', () => this.unexpectedDisconnect (DisconnectReason.close)) @@ -82,7 +82,7 @@ export class WAConnection extends Base { this.conn.removeEventListener ('message', checkIdleTime) } - const reconnectID = shouldUseReconnect ? this.user.jid.replace ('@s.whatsapp.net', '@c.us') : null + const reconnectID = shouldUseReconnect && this.user.jid.replace ('@s.whatsapp.net', '@c.us') this.conn = new WS(WS_URL, null, { origin: DEFAULT_ORIGIN, @@ -100,7 +100,7 @@ export class WAConnection extends Base { this.conn.addEventListener('message', ({data}) => this.onMessageRecieved(data as any)) this.conn.on ('open', async () => { - this.log(`connected to WhatsApp Web server, authenticating via ${reconnectID ? 'reconnect' : 'takeover'}`, MessageLogLevel.info) + this.logger.info(`connected to WhatsApp Web server, authenticating via ${reconnectID ? 'reconnect' : 'takeover'}`) let waitForChats: Promise<{[k: string]: Partial}> // add wait for chats promise if required if (typeof options?.waitForChats === 'undefined' ? true : options?.waitForChats) { @@ -228,7 +228,7 @@ export class WAConnection extends Base { json[2] .forEach(([item, chat]: [any, WAChat]) => { if (!chat) { - this.log (`unexpectedly got null chat: ${item}, ${chat}`, MessageLogLevel.info) + this.logger.warn (`unexpectedly got null chat: ${item}`, chat) return } @@ -241,7 +241,7 @@ export class WAConnection extends Base { !chats.get (chat.jid) && chats.insert (chat) }) - this.log (`received ${json[2].length} chats`, MessageLogLevel.info) + this.logger.info (`received ${json[2].length} chats`) if (json[2].length === 0) { receivedMessages = true checkForResolution () @@ -254,12 +254,12 @@ export class WAConnection extends Base { receivedContacts = true json[2].forEach(([type, contact]: ['user', WAContact]) => { - if (!contact) return this.log (`unexpectedly got null contact: ${type}, ${contact}`, MessageLogLevel.info) + if (!contact) return this.logger.info (`unexpectedly got null contact: ${type}`, contact) contact.jid = Utils.whatsappID (contact.jid) contacts[contact.jid] = contact }) - this.log (`received ${json[2].length} contacts`, MessageLogLevel.info) + this.logger.info (`received ${json[2].length} contacts`) checkForResolution () }) @@ -310,64 +310,71 @@ export class WAConnection extends Base { this.lastSeen = new Date(parseInt(timestamp)) this.emit ('received-pong') } else { - const [messageTag, json] = Utils.decryptWA (message, this.authInfo?.macKey, this.authInfo?.encKey, new Decoder()) - if (this.shouldLogMessages) this.messageLog.push ({ tag: messageTag, json: JSON.stringify(json), fromMe: false }) - - if (!json) {return} + try { + const [messageTag, json] = Utils.decryptWA (message, this.authInfo?.macKey, this.authInfo?.encKey, new Decoder()) + if (this.shouldLogMessages) this.messageLog.push ({ tag: messageTag, json: JSON.stringify(json), fromMe: false }) + + if (!json) { return } - if (this.logLevel === MessageLogLevel.all) { - this.log(messageTag + ', ' + JSON.stringify(json), MessageLogLevel.all) - } - if (!this.phoneConnected && this.state === 'open') { - this.phoneConnected = true - this.emit ('connection-phone-change', { connected: true }) - } - /* - Check if this is a response to a message we sent - */ - if (this.callbacks[messageTag]) { - const q = this.callbacks[messageTag] - q.callback(json) - delete this.callbacks[messageTag] - return - } - /* - Check if this is a response to a message we are expecting - */ - if (this.callbacks['function:' + json[0]]) { - const callbacks = this.callbacks['function:' + json[0]] - let callbacks2 - let callback - for (const key in json[1] || {}) { - callbacks2 = callbacks[key + ':' + json[1][key]] - if (callbacks2) { - break - } + if (this.logger.level === 'trace') { + this.logger.trace(messageTag + ', ' + JSON.stringify(json)) } - if (!callbacks2) { + if (!this.phoneConnected && this.state === 'open') { + this.phoneConnected = true + this.emit ('connection-phone-change', { connected: true }) + } + /* + Check if this is a response to a message we sent + */ + if (this.callbacks[messageTag]) { + const q = this.callbacks[messageTag] + q.callback(json) + delete this.callbacks[messageTag] + return + } + /* + Check if this is a response to a message we are expecting + */ + if (this.callbacks['function:' + json[0]]) { + const callbacks = this.callbacks['function:' + json[0]] + let callbacks2 + let callback for (const key in json[1] || {}) { - callbacks2 = callbacks[key] + callbacks2 = callbacks[key + ':' + json[1][key]] if (callbacks2) { break } } - } - if (!callbacks2) { - callbacks2 = callbacks[''] - } - if (callbacks2) { - callback = callbacks2[json[2] && json[2][0][0]] - if (!callback) { - callback = callbacks2[''] + if (!callbacks2) { + for (const key in json[1] || {}) { + callbacks2 = callbacks[key] + if (callbacks2) { + break + } + } + } + if (!callbacks2) { + callbacks2 = callbacks[''] + } + if (callbacks2) { + callback = callbacks2[json[2] && json[2][0][0]] + if (!callback) { + callback = callbacks2[''] + } + } + if (callback) { + callback(json) + return } } - if (callback) { - callback(json) - return + if (this.logger.level === 'debug') { + this.logger.debug({ unhandled: true }, messageTag + ', ' + JSON.stringify(json)) } - } - if (this.logLevel === MessageLogLevel.unhandled) { - this.log('[Unhandled] ' + messageTag + ', ' + JSON.stringify(json), MessageLogLevel.unhandled) + } catch (error) { + this.logger.error (`encountered error in decrypting message, closing`, error) + + if (this.state === 'open') this.unexpectedDisconnect (DisconnectReason.badSession) + else this.endConnection () } } } diff --git a/src/WAConnection/4.Events.ts b/src/WAConnection/4.Events.ts index 2948e0a..7b71319 100644 --- a/src/WAConnection/4.Events.ts +++ b/src/WAConnection/4.Events.ts @@ -1,6 +1,6 @@ import * as QR from 'qrcode-terminal' import { WAConnection as Base } from './3.Connect' -import { WAMessageStatusUpdate, WAMessage, WAContact, WAChat, WAMessageProto, WA_MESSAGE_STUB_TYPE, WA_MESSAGE_STATUS_TYPE, MessageLogLevel, PresenceUpdate, BaileysEvent, DisconnectReason, WANode, WAOpenResult, Presence, AuthenticationCredentials } from './Constants' +import { WAMessageStatusUpdate, WAMessage, WAContact, WAChat, WAMessageProto, WA_MESSAGE_STUB_TYPE, WA_MESSAGE_STATUS_TYPE, PresenceUpdate, BaileysEvent, DisconnectReason, WANode, WAOpenResult, Presence, AuthenticationCredentials } from './Constants' import { whatsappID, unixTimestampSeconds, isGroupID, toNumber, GET_MESSAGE_ID, WA_MESSAGE_ID, waMessageKey } from './Utils' import KeyedDB from '@adiwajshing/keyed-db' import { Mutex } from './Mutex' @@ -236,7 +236,7 @@ export class WAConnection extends Base { case WAMessageProto.ProtocolMessage.PROTOCOL_MESSAGE_TYPE.REVOKE: const found = chat.messages.get (GET_MESSAGE_ID(protocolMessage.key)) if (found?.message) { - this.log ('deleting message: ' + protocolMessage.key.id + ' in chat: ' + protocolMessage.key.remoteJid, MessageLogLevel.info) + this.logger.info ('deleting message: ' + protocolMessage.key.id + ' in chat: ' + protocolMessage.key.remoteJid) found.messageStubType = WA_MESSAGE_STUB_TYPE.REVOKE delete found.message diff --git a/src/WAConnection/6.MessagesSend.ts b/src/WAConnection/6.MessagesSend.ts index 449e869..770674b 100644 --- a/src/WAConnection/6.MessagesSend.ts +++ b/src/WAConnection/6.MessagesSend.ts @@ -9,7 +9,7 @@ import { WALocationMessage, WAContactMessage, WATextMessage, - WAMessageContent, WAMetric, WAFlag, WAMessage, BaileysError, MessageLogLevel, WA_MESSAGE_STATUS_TYPE, WAMessageProto, MediaConnInfo, MessageTypeProto, URL_REGEX, WAUrlInfo + WAMessageContent, WAMetric, WAFlag, WAMessage, BaileysError, WA_MESSAGE_STATUS_TYPE, WAMessageProto, MediaConnInfo, MessageTypeProto, URL_REGEX, WAUrlInfo } from './Constants' import { generateMessageID, sha256, hmacSign, aesEncrypWithIV, randomBytes, generateThumbnail, getMediaKeys, decodeMediaMessageBuffer, extensionForMediaMessage, whatsappID, unixTimestampSeconds } from './Utils' import { Mutex } from './Mutex' @@ -138,7 +138,7 @@ export class WAConnection extends Base { } } catch (error) { const isLast = host.hostname === json.hosts[json.hosts.length-1].hostname - this.log (`Error in uploading to ${host.hostname}${isLast ? '' : ', retrying...'}`, MessageLogLevel.info) + this.logger.error (`Error in uploading to ${host.hostname}${isLast ? '' : ', retrying...'}`) } } if (!mediaUrl) throw new Error('Media upload failed on all hosts') @@ -241,7 +241,7 @@ export class WAConnection extends Base { return buff } catch (error) { if (error instanceof BaileysError && error.status === 404) { // media needs to be updated - this.log (`updating media of message: ${message.key.id}`, MessageLogLevel.info) + this.logger.info (`updating media of message: ${message.key.id}`) await this.updateMediaMessage (message) const buff = await decodeMediaMessageBuffer (message.message, this.fetchRequest) return buff diff --git a/src/WAConnection/8.Groups.ts b/src/WAConnection/8.Groups.ts index 4c49902..a56ac9c 100644 --- a/src/WAConnection/8.Groups.ts +++ b/src/WAConnection/8.Groups.ts @@ -1,5 +1,5 @@ import {WAConnection as Base} from './7.MessagesExtra' -import { WAMetric, WAFlag, WANode, WAGroupMetadata, WAGroupCreateResponse, WAGroupModification, MessageLogLevel } from '../WAConnection/Constants' +import { WAMetric, WAFlag, WANode, WAGroupMetadata, WAGroupCreateResponse, WAGroupModification } from '../WAConnection/Constants' import { GroupSettingChange } from './Constants' import { generateMessageID } from '../WAConnection/Utils' @@ -52,13 +52,13 @@ export class WAConnection extends Base { try { await this.groupMetadata (gid) } catch (error) { - this.log (`error in group creation: ${error}, switching gid & checking`, MessageLogLevel.info) + this.logger.warn (`error in group creation: ${error}, switching gid & checking`) // if metadata is not available const comps = gid.replace ('@g.us', '').split ('-') response.gid = `${comps[0]}-${+comps[1] + 1}@g.us` await this.groupMetadata (gid) - this.log (`group ID switched from ${gid} to ${response.gid}`, MessageLogLevel.info) + this.logger.warn (`group ID switched from ${gid} to ${response.gid}`) } await this.chatAdd (response.gid, title) return response diff --git a/src/WAConnection/Constants.ts b/src/WAConnection/Constants.ts index 0bf9600..368e8bf 100644 --- a/src/WAConnection/Constants.ts +++ b/src/WAConnection/Constants.ts @@ -114,12 +114,6 @@ export enum DisconnectReason { /** Well, the connection timed out */ timedOut = 'timed out' } -export enum MessageLogLevel { - none=0, - info=1, - unhandled=2, - all=3 -} export interface MediaConnInfo { auth: string ttl: number diff --git a/src/WAConnection/Utils.ts b/src/WAConnection/Utils.ts index aee9fb2..3ffb60e 100644 --- a/src/WAConnection/Utils.ts +++ b/src/WAConnection/Utils.ts @@ -152,8 +152,7 @@ export function decryptWA (message: string | Buffer, macKey: Buffer, encKey: Buf json = JSON.parse(data) // parse the JSON } else { if (!macKey || !encKey) { - console.warn ('recieved encrypted buffer when auth creds unavailable: ' + message) - return + throw new Error ('recieved encrypted buffer when auth creds unavailable: ' + message) } /* If the data recieved was not a JSON, then it must be an encrypted message. @@ -173,14 +172,13 @@ export function decryptWA (message: string | Buffer, macKey: Buffer, encKey: Buf const decrypted = aesDecrypt(data, encKey) // decrypt using AES json = decoder.read(decrypted) // decode the binary message into a JSON array } else { - console.error (` - Checksums don't match: - og: ${checksum.toString('hex')} - computed: ${computedChecksum.toString('hex')} - data: ${data.slice(0, 80).toString()} - tag: ${messageTag} - message: ${message.slice(0, 80).toString()} - `) + throw new BaileysError ('checksum failed', { + received: checksum.toString('hex'), + computed: computedChecksum.toString('hex'), + data: data.slice(0, 80).toString(), + tag: messageTag, + message: message.slice(0, 80).toString() + }) } } } diff --git a/yarn.lock b/yarn.lock index 74c41e0..7acc862 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14,6 +14,11 @@ dependencies: regenerator-runtime "^0.13.4" +"@hapi/bourne@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@hapi/bourne/-/bourne-2.0.0.tgz#5bb2193eb685c0007540ca61d166d4e1edaf918d" + integrity sha512-WEezM1FWztfbzqIUbsDzFRVMxSoLy3HugVcux6KDDtTqzPsLE8NDRHfXvev66aH1i2oOKKar3/XDjbvh/OUBdg== + "@jimp/bmp@^0.16.1": version "0.16.1" resolved "https://registry.yarnpkg.com/@jimp/bmp/-/bmp-0.16.1.tgz#6e2da655b2ba22e721df0795423f34e92ef13768" @@ -382,6 +387,29 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.21.tgz#e48d3c2e266253405cf404c8654d1bcf0d333e5c" integrity sha512-tlFWakSzBITITJSxHV4hg4KvrhR/7h3xbJdSFbYJBVzKubrASbnnIFuSgolUh7qKGo/ZeJPKUfbZ0WS6Jp14DQ== +"@types/pino-std-serializers@*": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@types/pino-std-serializers/-/pino-std-serializers-2.4.1.tgz#f8bd52a209c8b3c97d1533b1ba27f57c816382bf" + integrity sha512-17XcksO47M24IVTVKPeAByWUd3Oez7EbIjXpSbzMPhXVzgjGtrOa49gKBwxH9hb8dKv58OelsWQ+A1G1l9S3wQ== + dependencies: + "@types/node" "*" + +"@types/pino@^6.3.2": + version "6.3.2" + resolved "https://registry.yarnpkg.com/@types/pino/-/pino-6.3.2.tgz#3c18fca7a11e7ce4c5c67768cd1cd1f8d1ff541d" + integrity sha512-dLKNzFY35feTD92DLFtFY1YPEngQxlfjczK2iEzwtGhh/M2AlTNyxshcYsbstBA6yc8wpTKYNrmjw+NcppE2YQ== + dependencies: + "@types/node" "*" + "@types/pino-std-serializers" "*" + "@types/sonic-boom" "*" + +"@types/sonic-boom@*": + version "0.7.0" + resolved "https://registry.yarnpkg.com/@types/sonic-boom/-/sonic-boom-0.7.0.tgz#38337036293992a1df65dd3161abddf8fb9b7176" + integrity sha512-AfqR0fZMoUXUNwusgXKxcE9DPlHNDHQp6nKYUd4PSRpLobF5CCevSpyTEBcVZreqaWKCnGBr9KI1fHMTttoB7A== + dependencies: + "@types/node" "*" + "@types/strip-bom@^3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/strip-bom/-/strip-bom-3.0.0.tgz#14a8ec3956c2e81edb7520790aecf21c290aebd2" @@ -421,7 +449,7 @@ ansi-regex@^4.1.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== -ansi-styles@^3.2.0: +ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== @@ -461,6 +489,16 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" +args@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/args/-/args-5.0.1.tgz#4bf298df90a4799a09521362c579278cc2fdd761" + integrity sha512-1kqmFCFsPffavQFGt8OxJdIcETti99kySRUPMpOhaGjL6mRJn8HFU1OxKY5bMqfZKUwTQc1mZkAjmGYaVOHFtQ== + dependencies: + camelcase "5.0.0" + chalk "2.4.2" + leven "2.1.0" + mri "1.1.4" + array-filter@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-1.0.0.tgz#baf79e62e6ef4c2a4c0b831232daffec251f9d83" @@ -496,6 +534,11 @@ at-least-node@^1.0.0: resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== +atomic-sleep@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/atomic-sleep/-/atomic-sleep-1.0.0.tgz#eb85b77a601fc932cfe432c5acd364a9e2c9075b" + integrity sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ== + available-typed-arrays@^1.0.0, available-typed-arrays@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz#6b098ca9d8039079ee3f77f7b783c4480ba513f5" @@ -569,6 +612,11 @@ camelcase-keys@^2.0.0: camelcase "^2.0.0" map-obj "^1.0.0" +camelcase@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.0.0.tgz#03295527d58bd3cd4aa75363f35b2e8d97be2f42" + integrity sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA== + camelcase@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" @@ -579,6 +627,15 @@ camelcase@^5.0.0, camelcase@^5.3.1: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== +chalk@2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + chalk@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" @@ -652,6 +709,11 @@ curve25519-js@^0.0.4: resolved "https://registry.yarnpkg.com/curve25519-js/-/curve25519-js-0.0.4.tgz#e6ad967e8cd284590d657bbfc90d8b50e49ba060" integrity sha512-axn2UMEnkhyDUPWOwVKBMVIzSQy2ejH2xRGy1wq81dqRwApXfIzfbE3hIX0ZRFBIihf/KDqK158DLwESu4AK1w== +dateformat@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" + integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== + dateformat@~1.0.4-1.2.3: version "1.0.12" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-1.0.12.tgz#9f124b67594c937ff706932e4a642cca8dbbfee9" @@ -713,6 +775,13 @@ emoji-regex@^7.0.1: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== +end-of-stream@^1.1.0: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + dependencies: + once "^1.4.0" + error-ex@^1.2.0: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -792,6 +861,11 @@ escape-string-regexp@4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" @@ -802,6 +876,16 @@ exif-parser@^0.1.12: resolved "https://registry.yarnpkg.com/exif-parser/-/exif-parser-0.1.12.tgz#58a9d2d72c02c1f6f02a0ef4a9166272b7760922" integrity sha1-WKnS1ywCwfbwKg70qRZicrd2CSI= +fast-redact@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/fast-redact/-/fast-redact-3.0.0.tgz#ac2f9e36c9f4976f5db9fb18c6ffbaf308cf316d" + integrity sha512-a/S/Hp6aoIjx7EmugtzLqXmcNsyFszqbt6qQ99BdG61QjBZF6shNis0BYR6TsZOQ1twYc0FN2Xdhwwbv6+KD0w== + +fast-safe-stringify@^2.0.7: + version "2.0.7" + resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz#124aa885899261f68aedb42a7c080de9da608743" + integrity sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA== + file-type@^9.0.0: version "9.0.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-9.0.0.tgz#a68d5ad07f486414dfb2c8866f73161946714a18" @@ -844,6 +928,11 @@ flat@^4.1.0: dependencies: is-buffer "~2.0.3" +flatstr@^1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/flatstr/-/flatstr-1.0.12.tgz#c2ba6a08173edbb6c9640e3055b95e287ceb5931" + integrity sha512-4zPxDyhCyiN2wIAtSLI6gc82/EjqZc1onI4Mz/l0pWrAlsSfYH/2ZIcU+e3oA2wDwbzIWNKwa23F8rh6+DRWkw== + foreach@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" @@ -946,6 +1035,11 @@ handlebars@^4.7.6: optionalDependencies: uglify-js "^3.1.4" +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + has-flag@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" @@ -1185,6 +1279,16 @@ jimp@^0.16.1: "@jimp/types" "^0.16.1" regenerator-runtime "^0.13.3" +jmespath@^0.15.0: + version "0.15.0" + resolved "https://registry.yarnpkg.com/jmespath/-/jmespath-0.15.0.tgz#a3f222a9aae9f966f5d27c796510e28091764217" + integrity sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc= + +joycon@^2.2.5: + version "2.2.5" + resolved "https://registry.yarnpkg.com/joycon/-/joycon-2.2.5.tgz#8d4cf4cbb2544d7b7583c216fcdfec19f6be1615" + integrity sha512-YqvUxoOcVPnCp0VU1/56f+iKSdvIRJYPznH22BdXV3xMk75SFXhWeJkZ8C9XxUWt1b5x2X1SxuFygW1U0FmkEQ== + jpeg-js@0.4.2: version "0.4.2" resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.4.2.tgz#8b345b1ae4abde64c2da2fe67ea216a114ac279d" @@ -1207,6 +1311,11 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" +leven@2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + integrity sha1-wuep93IJTe6dNCAq6KzORoeHVYA= + load-bmfont@^1.3.1, load-bmfont@^1.4.0: version "1.4.1" resolved "https://registry.yarnpkg.com/load-bmfont/-/load-bmfont-1.4.1.tgz#c0f5f4711a1e2ccff725a7b6078087ccfcddd3e9" @@ -1375,6 +1484,11 @@ mocha@^8.1.3: yargs-parser "13.1.2" yargs-unparser "1.6.1" +mri@1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/mri/-/mri-1.1.4.tgz#7cb1dd1b9b40905f1fac053abe25b6720f44744a" + integrity sha512-6y7IjGPm8AzlvoUrwAaw1tLnUBudaS3752vcd8JtrpGGQn+rXIe63LFVHm/YMwtqAuh+LJPCFdlLYPWM1nYn6w== + ms@2.1.2, ms@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" @@ -1453,7 +1567,7 @@ omggif@^1.0.10, omggif@^1.0.9: resolved "https://registry.yarnpkg.com/omggif/-/omggif-1.0.10.tgz#ddaaf90d4a42f532e9e7cb3a95ecdd47f17c7b19" integrity sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw== -once@^1.3.0: +once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= @@ -1591,6 +1705,40 @@ pinkie@^2.0.0: resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= +pino-pretty@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/pino-pretty/-/pino-pretty-4.3.0.tgz#18695606fd4f1e21cd1585d18999cd84d429e1d8" + integrity sha512-uEc9SUCCGVEs0goZvyznKXBHtI1PNjGgqHviJHxOCEFEWZN6Z/IQKv5pO9gSdm/b+WfX+/dfheWhtZUyScqjlQ== + dependencies: + "@hapi/bourne" "^2.0.0" + args "^5.0.1" + chalk "^4.0.0" + dateformat "^3.0.3" + fast-safe-stringify "^2.0.7" + jmespath "^0.15.0" + joycon "^2.2.5" + pump "^3.0.0" + readable-stream "^3.6.0" + split2 "^3.1.1" + strip-json-comments "^3.1.1" + +pino-std-serializers@^2.4.2: + version "2.5.0" + resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-2.5.0.tgz#40ead781c65a0ce7ecd9c1c33f409d31fe712315" + integrity sha512-wXqbqSrIhE58TdrxxlfLwU9eDhrzppQDvGhBEr1gYbzzM4KKo3Y63gSjiDXRKLVS2UOXdPNR2v+KnQgNrs+xUg== + +pino@^6.7.0: + version "6.7.0" + resolved "https://registry.yarnpkg.com/pino/-/pino-6.7.0.tgz#d5d96b7004fed78816b5694fda3eab02b5ca6d23" + integrity sha512-vPXJ4P9rWCwzlTJt+f0Ni4THc3DWyt8iDDCO4edQ8narTu6hnpzdXu8FqeSJCGndl1W6lfbYQUQihUO54y66Lw== + dependencies: + fast-redact "^3.0.0" + fast-safe-stringify "^2.0.7" + flatstr "^1.0.12" + pino-std-serializers "^2.4.2" + quick-format-unescaped "^4.0.1" + sonic-boom "^1.0.2" + pixelmatch@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/pixelmatch/-/pixelmatch-4.0.2.tgz#8f47dcec5011b477b67db03c243bc1f3085e8854" @@ -1643,11 +1791,24 @@ protobufjs@^6.10.1: "@types/node" "^13.7.0" long "^4.0.0" +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + qrcode-terminal@^0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz#bb5b699ef7f9f0505092a3748be4464fe71b5819" integrity sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ== +quick-format-unescaped@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/quick-format-unescaped/-/quick-format-unescaped-4.0.1.tgz#437a5ea1a0b61deb7605f8ab6a8fd3858dbeb701" + integrity sha512-RyYpQ6Q5/drsJyOhrWHYMWTedvjTIat+FTwv0K4yoUxzvekw2aRHMQJLlnvt8UantkZg2++bEzD9EdxXqkWf4A== + randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -1672,6 +1833,15 @@ read-pkg@^1.0.0: normalize-package-data "^2.3.2" path-type "^1.0.0" +readable-stream@^3.0.0, readable-stream@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" + integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + readdirp@~3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.4.0.tgz#9fdccdf9e9155805449221ac645e8303ab5b9ada" @@ -1730,7 +1900,7 @@ rimraf@^2.6.1: dependencies: glob "^7.1.3" -safe-buffer@^5.1.0, safe-buffer@^5.1.2: +safe-buffer@^5.1.0, safe-buffer@^5.1.2, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -1771,6 +1941,14 @@ signal-exit@^3.0.0: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== +sonic-boom@^1.0.2: + version "1.3.0" + resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-1.3.0.tgz#5c77c846ce6c395dddf2eb8e8e65f9cc576f2e76" + integrity sha512-4nX6OYvOYr6R76xfQKi6cZpTO3YSWe/vd+QdIfoH0lBy0MnPkeAbb2rRWgmgADkXUeCKPwO1FZAKlAVWAadELw== + dependencies: + atomic-sleep "^1.0.0" + flatstr "^1.0.12" + source-map-support@^0.5.12, source-map-support@^0.5.17: version "0.5.19" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" @@ -1810,6 +1988,13 @@ spdx-license-ids@^3.0.0: resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz#c80757383c28abf7296744998cbc106ae8b854ce" integrity sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw== +split2@^3.1.1: + version "3.2.2" + resolved "https://registry.yarnpkg.com/split2/-/split2-3.2.2.tgz#bf2cf2a37d838312c249c89206fd7a17dd12365f" + integrity sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg== + dependencies: + readable-stream "^3.0.0" + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -1848,6 +2033,13 @@ string.prototype.trimstart@^1.0.1: define-properties "^1.1.3" es-abstract "^1.17.5" +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + strip-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" @@ -1891,6 +2083,11 @@ strip-json-comments@^2.0.0: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= +strip-json-comments@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + supports-color@7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1" @@ -1898,6 +2095,13 @@ supports-color@7.1.0: dependencies: has-flag "^4.0.0" +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" @@ -2015,6 +2219,11 @@ utif@^2.0.1: dependencies: pako "^1.0.5" +util-deprecate@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + util@^0.12.0: version "0.12.3" resolved "https://registry.yarnpkg.com/util/-/util-0.12.3.tgz#971bb0292d2cc0c892dab7c6a5d37c2bec707888"