cloudflare / node-cloudflare

Node.js API for Client API
https://cloudflare.github.io/node-cloudflare/
Other
335 stars 92 forks source link

Pagination #34

Closed spencercharest closed 6 years ago

spencercharest commented 6 years ago

Some methods like .dnsRecords.browse() return paginated results with a property result_info that looks some like this.

{ 
     page: 1,
     per_page: 20,
     total_pages: 2,
     count: 20,
     total_count: 24 
}

Is it possible to paginate or return all results at once?

terinjokes commented 6 years ago

Optional parameters can be provided after the required parameters. In this case, as the second parameter after the zone id:

cf.dnsRecords.browse('023e105f4ecef8ad9ca31a8372d0c353', {
    page: 2,
    per_page: 100
});
AdrieanKhisbe commented 6 years ago

Would be great if there is a clue about it in the readme or tthe generated jsdoc :)

terinjokes commented 6 years ago

@AdrieanKhisbe I ran into a bug that prevented me from adding to the jsdoc, but keep an eye out, and add once it's resolved.