jdalrymple / gitbeaker

🦊🧪 A comprehensive and typed Gitlab SDK for Node.js, Browsers, Deno and CLI
Other
1.55k stars 295 forks source link

Type is wrong for `forceRandomPassword` in `Users.create()` #3481

Closed domharrington closed 10 months ago

domharrington commented 10 months ago

Description

The type for forceRandomPassword in CreateUserOptions is incorrect, it should be a boolean:

https://github.com/jdalrymple/gitbeaker/blob/fd19ac3b3aaebdea71adee99661565d3836a7ac2/packages/core/src/resources/Users.ts#L154

API Docs: https://docs.gitlab.com/ee/api/users.html#user-creation

force_random_password Set user password to a random value - true or false (default)

Steps to reproduce

Try to pass a boolean to forceRandomPassword:

image

Expected behaviour

Should work

Actual behaviour

Type error

Possible fixes

Update type to boolean

Checklist

Happy to put in a PR if you want me to, but hopefully should be a one line fix!

jdalrymple commented 10 months ago

Its definitely a one line fix! Feel free to through up a PR, I can have it merged today.

domharrington commented 10 months ago

Thanks for the fast reply! I also just noticed that I think PersonalAccessTokenSchema.token should be required instead of optional?

https://github.com/jdalrymple/gitbeaker/blob/fd19ac3b3aaebdea71adee99661565d3836a7ac2/packages/core/src/resources/PersonalAccessTokens.ts#L21

Afaict the token is always going to be returned from this API?

Do you want this in the same PR or a different one?

jdalrymple commented 10 months ago

Same one is fine!