mirror of
https://github.com/openstf/stf
synced 2025-10-04 10:19:30 +02:00
Implement account removal.
This commit is contained in:
parent
a8da19472d
commit
3a3937ec2f
9 changed files with 78 additions and 1 deletions
|
@ -490,6 +490,21 @@ module.exports = syrup.serial()
|
|||
})
|
||||
}
|
||||
|
||||
plugin.removeAccount = function() {
|
||||
return runServiceCommand(
|
||||
apk.wire.MessageType.REMOVE_ACCOUNT
|
||||
, new apk.wire.RemoveAccountRequest()
|
||||
)
|
||||
.timeout(15000)
|
||||
.then(function(data) {
|
||||
var response = apk.wire.RemoveAccountResponse.decode(data)
|
||||
if (response.success) {
|
||||
return true
|
||||
}
|
||||
throw new Error('Unable to remove account')
|
||||
})
|
||||
}
|
||||
|
||||
function runServiceCommand(type, cmd) {
|
||||
var resolver = Promise.defer()
|
||||
var id = Math.floor(Math.random() * 0xFFFFFF)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue