calls.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. module.exports.name = 'calls'
  2. module.exports.description = 'List all call records contained in the backup.'
  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 only works for iOS 10+
  7. module.exports.supportedVersions = '>=10.0'
  8. module.exports.func = function (program, backup) {
  9. backup.getCallsList()
  10. .then((items) => {
  11. // Use the configured formatter to print the rows.
  12. program.formatter.format(items, {
  13. // Color formatting?
  14. color: program.color,
  15. // Columns to be displayed in human-readable printouts.
  16. // Some formatters, like raw or CSV, ignore these.
  17. columns: {
  18. 'ID': el => el.Z_PK,
  19. 'Date': el => el.XFORMATTEDDATESTRING,
  20. 'Answered': el => el.ZANSWERED + '',
  21. 'Originated': el => el.ZORIGINATED + '',
  22. 'Call Type': el => el.ZCALLTYPE + '',
  23. 'Duration': el => el.ZDURATION + '',
  24. 'Location': el => el.ZLOCATION + '',
  25. 'Country': el => el.ZISO_COUNTRY_CODE + '',
  26. 'Service': el => el.ZSERVICE_PROVIDER + '',
  27. 'Address': el => (el.ZADDRESS || '').toString()
  28. }
  29. })
  30. })
  31. .catch((e) => {
  32. console.log('[!] Encountered an Error:', e)
  33. })
  34. }