-
-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Admin endpoint typing #3575
Comments
I believe it is exported, but the wrapper has no idea if youre an admin user or a non admin user when you make the request so the return types include both the extended and non extended versions of a user object. For now ill return the extended version only, which should solve the typing. |
@jdalrymple thanks for the explanation. are there more of these cases? and is this admin vs non-admin or might even group/project access level affect it? Maybe the GitLab type could take 'isAdmin' as a type parameter to know it's allowed to assume admin interfaces ? I see GitLab already taking a 'C' type parameter which seems to stand for Camelized |
It would probably be much simpler to just do:
But yea, in the example you mentioned, passing a generic would also work:
BUT that would be poor because its not alone, there are other generics on these functions, which would require you to explicitly set both since they dont have selective generic inferences yet in TS. Lastly I could add it as an extra option, like the "showExpanded" option (which is probably what you were suggesting haha):
This would work. Ill write something up and put together a PR. I know there are more than just this endpoint that differ based on admin or that are available without authentication, but it would be a bit of work finding each instance. For now ill focus on this endpoint, and i can always add from there. Good call 🚀 |
🚀 Issue was released in |
🚀 Issue was released in |
Description
I get a TypeScript error when trying to access 'identities'
but it exists in the output
Expected behaviour
No errors
Actual behaviour
Property 'find' does not exist on type '{}'
Possible fixes
Add
identities
to the types as shown here in the examples: https://docs.gitlab.com/ee/api/users.html#for-administrators-1The actual fields id & provider seem to be documented here: https://docs.gitlab.com/ee/api/users.html#delete-authentication-identity-from-user
Checklist
The text was updated successfully, but these errors were encountered: