index.js
function listZones() {
    return self.cloudflareClient.findZones({page: 1, per_page: self.perPage})
      .then(function (response) {
        let promises = [Promise.resolve(response)];
        for (let i = 2; i <= response.data['result_info']['total_pages']; i++) {
          promises.push(self.cloudflareClient.findZones({page: i, per_page: self.perPage}));
        }
        return Promise.all(promises);
      })
      .then(function (responses) {
        let rows = [];
        _.each(responses, function (response) {
          _.each(response.data.result, function (item) {
            rows.push(_.extend(
              item,
              {
                planName: item.plan.name,
                accountName: item.account.name
              }
            ));
          })
        });
        return new Result(rows);
      });
  }
function listZones() {
    return self.cloudflareClient.findZones({page: 1, per_page: self.perPage})
      .then(function (response) {
        let promises = [Promise.resolve(response)];
        for (let i = 2; i <= response.data['result_info']['total_pages']; i++) {
          promises.push(self.cloudflareClient.findZones({page: i, per_page: self.perPage}));
        }
        return Promise.all(promises);
      })
      .then(function (responses) {
        let rows = [];
        _.each(responses, function (response) {
          _.each(response.data.result, function (item) {
            rows.push(_.extend(
              item,
              {
                planName: item.plan.name,
                accountName: item.account.name
              }
            ));
          })
        });
        return new Result(rows);
      });
  }
function listZones ( ) { return self . cloudflareClient . findZones ( { page : 1 , per_page : self . perPage } ) . then ( function ( response ) { let promises = [ Promise . resolve ( response ) ] ; for ( let i = 2 ; i <= response . data [ 'result_info' ] [ 'total_pages' ] ; i ++ ) { promises . push ( self . cloudflareClient . findZones ( { page : i , per_page : self . perPage } ) ) ; } return Promise . all ( promises ) ; } ) . then ( function ( responses ) { let rows = [ ] ; _ . each ( responses , function ( response ) { _ . each ( response . data . result , function ( item ) { rows . push ( _ . extend ( item , { planName : item . plan . name , accountName : item . account . name } ) ) ; } ) } ) ; return new Result ( rows ) ; } ) ; }
List zones in the current account
@return {Promise}
List zones in the current account