feat: add templateId parameter to management user create#773
Conversation
Management user.create was missing the templateId parameter that invite/inviteBatch already expose. Backend CreateUserRequest accepts templateId (field 29); wire it through both the options-object and positional overloads. Closes descope/etc#17215 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
🐕 Review complete — View session on Shuni Portal 🐾 |
🐕 Suggested ReviewersThe review assignment strategy balances breadth across core implementation and testing files, leveraging contributors with significant overlapping code experience to ensure thorough review of the new
Suggested by Shuni based on git history and PR context. Names are not @-mentioned to avoid notifying anyone — request a review from whoever fits best. |
There was a problem hiding this comment.
🐕 Shuni's Review
Wires templateId into management.user.create for both the options-object and positional-overload forms, matching the existing invite shape.
No issues found — good bones! The implementation mirrors invite exactly: templateId lands after additionalLoginIds in the positional signature, flows through the object spread for the options form, and both call forms are covered by the new tests. Woof!
What
Add the
templateIdparameter tomanagement.user.create, which was missing whileinvite/inviteBatchalready expose it.Wired through both call forms:
create('loginId', { email, templateId })create('loginId', email, ..., templateId)Backend
CreateUserRequestalready acceptstemplateId(proto field 29), so this is purely SDK-side plumbing over an existing wire contract.Why
createwas the only message-capable user function withouttemplateId.update/patchhave no such proto field;createTestUser/createBatchsend no message so it's a no-op there.Closes descope/etc#17215
Tests
Added two
createtests (options form + positional overload). Fulluser.test.tssuite green,tsc --noEmitclean.🤖 Generated with Claude Code