Comments (5)
I've taken the form as shown here https://github.com/blakmatrix/node-zendesk/blob/master/lib/client/attachments.js#L15
a bit more complex is https://github.com/blakmatrix/node-zendesk/blob/master/lib/client/useridentities.js#L31 - except with that one the format is the optional bit
When I worked at nodejitsu back in the day I used the form of this (https://github.com/nodejitsu/jitsu/blob/master/lib/jitsu/commands/env.js#L37-L46) for optionals note: we used the flatiron framework, utile was a utility library and simply utilize these mechanisms https://github.com/flatiron/utile/blob/master/lib/args.js
I personally prefer simplicity, utilization of an options
object that can be passed allong as {}
or {locale: 'fr'}
but is explicit in requirement.
from node-zendesk.
Also regarding simplicity, for GET /api/v2/help_center/{locale}/sections/{id}.json
We could also create a method named createBySectionWithLocale
but I feel as if that is almost overly verbose and I'd personally use the option format over that.
from node-zendesk.
Using an options
object would break the backward compatibility.
Since in both end points we need to use sectionID
to specify where the article belongs to, the prepositional phrase bySection
could be omitted. I finally choose createWithLocale
for this new end point.
I am also thinking we can apply the same rule to name an end point: Methods like listByUser
is where user need to pass userID
to identify results, so they use preposition By
. While WithLocale
means the result is not only identified by Locale
but also requires other information like sectionID
in this example.
from node-zendesk.
Since the locale is mandatory when creating something new in the help center, I'm of the opinion that we just utilize the option object. Seems straightforward and included already in the post body.
Plus the documentation reads:
You must specify an article title and locale. The locale can be omitted if it's specified in the URL.
@nnabuuu if this is the case and we choose to go this route, then we should disregard the create endpoints that have the locale defined and only use ones like POST /api/v2/help_center/sections/{id}/articles.json.
Meanwhile, listing and updating should go unchanged and still have the byLocale
methods.
EDIT: Saw that you made that PR to update the help center endpoints. I'm cool with the changes since it's been done, but it would be nice to just have a simple set of CRUD methods instead of all the variance.
from node-zendesk.
OK, let's do this: I will make 2 methods byLocale
and withLocale
, but I would add a warning message in byLocale
, we wouldn't delete the byLocale
method until a major version upgrade.
from node-zendesk.
Related Issues (20)
- 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
- OAuth doesn't work HOT 2
- how to set the request rate, meet 204 code when enable throttle in createClient option
- Mismatched types HOT 3
- Explore replacing this with a (mostly) autogenerated client based off the OpenAPI spec
- Update Many Users like describe in example doesn't work
- Include type definition or more extensive docs for the response of `client.search.query`
- All links on API documentation Readme are broken HOT 1
- socket hang up error on attachments 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.