notes.js 1008 B

12345678910111213141516171819202122232425262728293031
  1. module.exports.name = 'notes'
  2. module.exports.description = 'List all iOS notes'
  3. // Specify this only works for iOS 9+
  4. module.exports.supportedVersions = '>=9.0'
  5. // Specify this reporter requires a backup.
  6. // The second parameter to func() is now a backup instead of the path to one.
  7. module.exports.requiresBackup = true
  8. // Specify this reporter supports the promises API for allowing chaining of reports.
  9. module.exports.usesPromises = true
  10. module.exports.func = function (program, backup, resolve, reject) {
  11. backup.getNotes(program.dump)
  12. .then((items) => {
  13. // Format the output
  14. var result = program.formatter.format(items, {
  15. program: program,
  16. columns: {
  17. 'Modified': el => (el.XFORMATTEDDATESTRING || el.XFORMATTEDDATESTRING1) + '',
  18. 'ID': el => el.Z_PK,
  19. 'Title2': el => (el.ZTITLE2 + '').trim().substring(0, 128),
  20. 'Title1': el => (el.ZTITLE1 + '').trim() || ''
  21. }
  22. })
  23. resolve(result)
  24. })
  25. .catch(reject)
  26. }