feat(identity): onboard Identity user management endpoints as Users service#609
Draft
Sarath1018 wants to merge 1 commit into
Draft
feat(identity): onboard Identity user management endpoints as Users service#609Sarath1018 wants to merge 1 commit into
Sarath1018 wants to merge 1 commit into
Conversation
…ervice
Adds a new modular Users service (@uipath/uipath-typescript/users) covering
the whitelisted Identity /api/User endpoints:
- getById(userId) GET /api/User/{userId}
- updateById(userId, opts) PUT /api/User/{userId}
- deleteById(userId) DELETE /api/User/{userId}
- create(users, orgId, opts) POST /api/User/BulkCreate
- invite(users) POST /api/User/InviteUsers
Identity routes at the organization level, so endpoints use a `../identity_`
base to collapse the tenant segment ApiClient inserts (same pattern as the
notification service).
Live-API findings encoded in the SDK (spec is wrong on these):
- `type`/`category` come back as numeric codes, not string enums — mapped to
UserType/UserCategory via value maps
- BulkCreate returns `{ result, users[] }`, not a bare IdentityResult
- invite `redirectUrl` is effectively required and must be a portal
acceptInvite URL
Includes unit tests (service + bound-method model tests), live integration
tests (8/8 passing against alpha), JSDoc on UserServiceModel, and docs
updates (oauth-scopes, mkdocs nav).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| }); | ||
|
|
||
| it('should throw when the user ID is undefined', async () => { | ||
| const user = createUserWithMethods(createBasicUser({ id: undefined as any }), mockService); |
Contributor
There was a problem hiding this comment.
The as any cast is unnecessary. createBasicUser accepts Partial<RawUserGetResponse>, which makes id type string | undefined, so { id: undefined } is valid TypeScript without a cast. Same issue on line 69.
Convention: "No any type — use unknown if truly unknown, then validate."
Suggested change
| const user = createUserWithMethods(createBasicUser({ id: undefined as any }), mockService); | |
| const user = createUserWithMethods(createBasicUser({ id: undefined }), mockService); |
Contributor
Review summaryNew finding posted this run:
Everything else checked out — transform pipeline, endpoint routing, type naming, pagination absence, JSDoc on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new modular Users service (
@uipath/uipath-typescript/users) onboarding the CORS-whitelisted Identity/api/Userendpoints:getById(userId)GET /api/User/{userId}updateById(userId, options)PUT /api/User/{userId}deleteById(userId)DELETE /api/User/{userId}create(users, organizationId, options?)POST /api/User/BulkCreateinvite(users)POST /api/User/InviteUsersgetById()andcreate()return users with bound entity methods (user.update(),user.delete()).Design notes
../identity_base (IDENTITY_ORG_BASE) to collapse the tenant segmentApiClientinserts — same pattern as the notification service.type/categoryare returned as numeric codes, not string enums → mapped toUserType/UserCategoryenums via value mapsBulkCreatereturns{ result, users[] }, not a bareIdentityResultredirectUrlis effectively required and must be a portalacceptInviteURL (validated per user)userNameis required for create (emailalone is rejected)creationTime→createdTime,lastModificationTime→lastModifiedTime,groupIDs→groupIds,errorMsg→errorMessage; internallegacyIddropped.Testing
procodeappsorg) — full CRUD + invite lifecycle with cleanup; validates the org-level URL routing through the realApiClientdist/users/*generated)New integration env vars (optional, documented in
tests/.env.integration.example):UIPATH_ORGANIZATION_ID(org GUID for create/invite),UIPATH_PORTAL_URL(portal host for invite redirect URLs whenUIPATH_BASE_URLis the API gateway).Remaining before marking ready
api/User/{x}covers all five)🤖 Generated with Claude Code