voicemail.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. module.exports.name = 'voicemail'
  2. module.exports.description = 'List all or extract voicemails on device'
  3. // Specify this reporter requires a backup.
  4. // The second parameter to func() is now a backup instead of the path to one.
  5. module.exports.requiresBackup = true
  6. // Specify this reporter supports the promises API for allowing chaining of reports.
  7. module.exports.usesPromises = true
  8. // Specify this only works for iOS 9+
  9. module.exports.supportedVersions = '>=9.0'
  10. module.exports.func = function (program, backup, resolve, reject) {
  11. backup.getVoicemailsList()
  12. .then((items) => {
  13. var result = program.formatter.format(items, {
  14. program: program,
  15. columns: {
  16. 'ID': el => el.ROWID,
  17. 'Date': el => el.XFORMATTEDDATESTRING,
  18. 'Sender': el => el.sender,
  19. 'Token': el => el.token,
  20. 'Duration': el => el.duration,
  21. 'Expiration': el => el.expiration,
  22. 'Trashed': el => el.trashed_date,
  23. 'Flags': el => el.flags
  24. }
  25. })
  26. resolve(result)
  27. })
  28. .catch(reject)
  29. }