pushstore.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. module.exports.name = 'pushstore'
  2. module.exports.description = 'List pushstore files'
  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 up to iOS 10
  9. module.exports.supportedVersions = '<11.0'
  10. // You can also provide an array of functions instead of using `module.exports.func`.
  11. // These functions *should* be independent ranges to ensure reliable execution
  12. module.exports.functions = {
  13. '>=10.0': function (program, backup, resolve, reject) {
  14. // This function would be called for iOS 10+
  15. backup.getPushstore()
  16. .then((items) => {
  17. var result = program.formatter.format(items, {
  18. program: program,
  19. columns: {
  20. 'AppNotificationCreationDate': el => el.AppNotificationCreationDate,
  21. 'AppNotificationTitle': el => el.AppNotificationTitle,
  22. 'AppNotificationMessage': el => el.AppNotificationMessage,
  23. 'RequestedDate': el => el.RequestedDate,
  24. 'TriggerDate': el => el.TriggerDate
  25. }
  26. })
  27. resolve(result)
  28. })
  29. .catch(reject)
  30. },
  31. '>=5.0,<10.0': function (program, backup, resolve, reject) {
  32. // This function would be called for all iOS 5 up to iOS 9.x.
  33. backup.getOldPushstore()
  34. .then((items) => {
  35. var result = program.formatter.format(items, {
  36. program: program,
  37. columns: {
  38. 'AppNotificationCreationDate': el => el.AppNotificationCreationDate,
  39. 'AppNotificationTitle': el => el.AppNotificationTitle,
  40. 'AppNotificationMessage': el => el.AppNotificationMessage,
  41. 'RequestedDate': el => el.RequestedDate,
  42. 'TriggerDate': el => el.TriggerDate
  43. }
  44. })
  45. resolve(result)
  46. })
  47. .catch(reject)
  48. }
  49. }