Comments (6)
I'm seeing something similar with the TS types. I'm making a users.createOrUpdate
call. The types say it returns a Promise<User>
. But when the promise resolves, I don't have a User
, I have a wrapper object with response
and result
properties. result
is of type User
.
Paste of the method declaration in 5.0.9 from my node_modules
:
/**
* Creates or updates a user.
* @param {object} user - The user details.
* @returns {Promise<User>} The created or updated user's details.
* @async
* @see {@link https://developer.zendesk.com/api-reference/ticketing/users/users/#create-or-update-user}
* @example
* const user = await client.users.createOrUpdate({name: 'John Doe', email: '[email protected]'});
*/
createOrUpdate(user: object): Promise<User>;
And the original JS declaration in the repo:
node-zendesk/src/clients/core/users.js
Lines 190 to 201 in ac07d2c
Paste of the actual resolved value:
{
response: {
json: [Function: json],
status: 201,
headers: { get: [Function: get] },
statusText: 'Created'
},
result: {
id: ...,
... other User properties ...
}
}
from node-zendesk.
I have the same issue with users.show
where it expects to return a Promise<User>
but the actual response value is Promise<{result: User}>
from node-zendesk.
I just contributed to the bounty on this issue.
Each contribution to this bounty has an expiry time and will be auto-refunded to the contributor if the issue is not solved before then.
To make this a public bounty or have a reward split, the maintainer can reply to this comment.
from node-zendesk.
ditto — exactly what @mackstann is seeing returned is also returning for me when using users.update
from node-zendesk.
any update on this?
from node-zendesk.
having the same issue with users.update
.
If I recall correctly also similar thing with organizations.showMany
was happening, where the types expect an array of numbers, while in reality it also seems to correctly accept a single number, not in an array.
from node-zendesk.
Related Issues (20)
- 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 HOT 1
- 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 3
- New sport street racket
- client.tickets.addTags() and tickets.updateTags() pass an empty response body HOT 1
- client.tickets.create return Error: Request processing failed: Raw request failed: FormData is not defined
- Missing locale support for ticket_fields list
- users.create() returns Zendesk Error (422): Unprocessable Entity HOT 3
- Please update the the releases CHANGELOG to say remoteUri -> endpointUri HOT 1
- node-fetch problem
- Endpoint for ticket's custom statuses
- SyntaxError: The requested module 'node-zendesk' does not provide an export named 'createClient'
- The TypeScript version seems to be broken, even the examples don't compile HOT 1
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.