jdalrymple / gitbeaker

🦊🧪 A comprehensive and typed Gitlab SDK for Node.js, Browsers, Deno and CLI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

domharrington opened this issue · comments

Description

  • Node.js version: v18.18.2
  • Gitbeaker version: 39.25.0
  • Gitbeaker release (cli, node, browser, core, requester-utils): node
  • OS & version: macOS 13.5.2 (22G91)

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

forceRandomPassword?: string;

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

  • I have checked that this is not a duplicate issue.
  • I have read the documentation.

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

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

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

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

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

Same one is fine!