committed package-lock.json + logout changes

This commit is contained in:
Adhiraj
2020-08-24 23:23:23 +05:30
parent b4298b772e
commit e2372bf60b
4 changed files with 2656 additions and 15 deletions

3
.gitignore vendored
View File

@@ -1,15 +1,12 @@
node_modules
auth_info.json
output.csv
package-lock.json
*/.DS_Store
.DS_Store
.env
auth_info_browser.json
yarn.lock
browser-messages.json
package-lock.json
package-lock.json
decoded-ws.json
auth_info2.json
lib

2643
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -31,23 +31,23 @@
},
"dependencies": {
"@adiwajshing/keyed-db": "^0.1.2",
"curve25519-js": "0.0.4",
"futoin-hkdf": "1.3.2",
"jimp": "0.14.0",
"curve25519-js": "^0.0.4",
"futoin-hkdf": "^1.3.2",
"jimp": "^0.14.0",
"node-fetch": "^2.6.0",
"protobufjs": "6.10.1",
"protobufjs": "^6.10.1",
"qrcode-terminal": "^0.12.0",
"ws": "^7.3.1"
},
"devDependencies": {
"@types/mocha": "7.0.2",
"@types/node": "^14.0.27",
"@types/mocha": "^7.0.2",
"@types/node": "^14.6.0",
"@types/ws": "^7.2.6",
"assert": "^2.0.0",
"dotenv": "^8.2.0",
"mocha": "^8.1.1",
"ts-node-dev": "^1.0.0-pre.57",
"typedoc": "0.18.0",
"typescript": "3.9.7"
"ts-node-dev": "^1.0.0-pre.60",
"typedoc": "^0.18.0",
"typescript": "^3.9.7"
}
}

View File

@@ -272,10 +272,11 @@ export class WAConnection extends EventEmitter {
* @see close() if you just want to close the connection
*/
async logout () {
if (this.state !== 'open') throw new Error("You're not even connected, you can't log out")
await new Promise(resolve => this.conn.send('goodbye,["admin","Conn","disconnect"]', null, resolve))
this.authInfo = null
if (this.state === 'open') {
//throw new Error("You're not even connected, you can't log out")
await new Promise(resolve => this.conn.send('goodbye,["admin","Conn","disconnect"]', null, resolve))
}
this.close()
}
/** Close the connection to WhatsApp Web */