Comments (3)
I don't think there is a way to achieve this now. But I believe we can have this feature in the future. (Introduce extra parameter for requestAll
may be helpful)
from node-zendesk.
Hi @blakmatrix ,
I am thinking about the way to support user handle page of their own.
in zendesk's develop site, it is already offered that if we pass 2 parameters per_page
and page
, then list method will return corresponding result. And, I have tried your request
method, calling it like this.request('GET', ['categories'], {per_page: 10, page: 2}, cb)
will return exactly want he expects.
So, I am thinking of the following:
Way 1. We make another option like extraOptions.autoPageHandling: false
, and if that happen, requestAll = request
, then we use ways like Array.prototype.concat.call(['GET', ['categories']], Array.prototype.slice.call(arguments));
to create the arguments this.request('GET', ['categories'], {per_page: 10, page: 2}, cb)
Way 2. We dynamically judge by arguments, if the last 1st or 2nd object is {per_page: ?? , page: ??}, then we call request, otherwise we call requestAll.
However, both way need to change code a lot : (
Any comment?
from node-zendesk.
I for a while have wanted to refactor this library, that being said though, I feel we should expose an option to disable autopaging, If I were to go back, the option would have been reverse, that auto-paging would have been a feature rather than a default.
I almost feel like the most straightforward approach might be to just increment the major form here, enforce options object to be sent (or assumed empty -- unless we expose methods to change default options) and a option to turn auto-paging on with the default being off. I agree, I think anyway we cut it it's going to be a major change, and if that's the case I'd like to also adress some of the other open issues here and considerations on how Zendesks API has been changing as well and refactor accordingly. I wanted to move away from nconf as it is no longer maintained adressing the concerns in #36 .
from node-zendesk.
Related Issues (20)
- errors returned as buffer instead of strings
- qs vulnerable to Prototype Pollution
- Request to migrate library from Offset Based Pagination to Cursor Based Pagination HOT 1
- Migrate request to native fetch / node-fetch / axios? HOT 10
- What changed in version 3.0.0? HOT 2
- Possibly get betamax wiremocks up and running here. HOT 2
- Migrate HC APIS not listed in previous issue to CBP HOT 1
- nconf don't work HOT 1
- Please migrate off of the request library to address tough-cookie CVE HOT 2
- Apps
- jobStatuses.watch probably needs some love
- Release `fetch` changes HOT 5
- Update Documentation
- fetch is not defined HOT 2
- 404 calling createMany for Organization Memberships
- OrganizationMemberships deleteMany does not work as implemented. HOT 1
- TLC Tickets class
- TLC Users.js
- OAuth doesn't work HOT 1
- version 5.0.2 return Zendesk error 401 while 3.0.3 is ok HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-zendesk.