Skip to content

Report v4 Note

Rich Infante edited this page Apr 18, 2018 · 2 revisions

V4 Reporting

As the different available reports have grown in number, it's become apparent that organizing them by name in a single directory will eventuall become impractical. To solve this, a nested structure has been implemented such that we can run an entire group of reports, such as safari.*, but also have the ability to run an individual report about cookies, for example: safari.cookies.

For version 3, the backups are no longer constrained to iOS versions. It is the responsibility of the implementation to properly detect if it can run or not. Typically, this simply involves attempting to open a file, and if it doesn't exist or corrupt, we reject the promise.

Also in version 3, we're removing the direct dependency of the report on calling the user's selected formatter. Now, this is called after the promise is resolved by the ibackuptool core. As a result of this, we can now call individual reports from each other, or externally.

For example, we can include the ibackuptool core in our programs:

const bt = require('ibackuptool')

// Call the backups.list report.
bt.run('backups.list')
  .then(backups => {
    console.log(backups)
  })

For more usage examples, see the Usage docs As a Module and As a CLI Tool

Clone this wiki locally