feat: Add Waitlists methods to User Management - #1670
Draft
aksman-dev wants to merge 1 commit into
Draft
Conversation
Adds SDK support for the waitlists REST API: listing waitlists, retrieving a waitlist (including the 'default' alias), listing waitlist users with state/email filters, creating waitlist users (idempotent per email, optional notify), and approving, denying, or deleting a waitlist user.
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 SDK support for the waitlists REST API on
workos.userManagement:listWaitlists()—GET /user_management/waitlistsgetWaitlist(waitlistId)—GET /user_management/waitlists/:id(accepts thedefaultalias)listWaitlistUsers(waitlistId, options?)—GET /user_management/waitlists/:id/entries, withstateand exact-emailfilters plus standard cursor pagination viaAutoPaginatablecreateWaitlistUser(waitlistId, payload)—POST /user_management/waitlists/:id/entrieswithemail, optionaladditionalFields(sent asadditional_fields), and optionalnotify(defaults tofalse). Idempotent per email;422 user_already_existswhen a user with that email already exists. Thedefaultalias lazily creates the default waitlist on this write path.approveWaitlistUser(waitlistUserId)—POST /user_management/waitlist_entries/:id/approvedenyWaitlistUser(waitlistUserId)—POST /user_management/waitlist_entries/:id/deny422 invalid_statefor approve/deny on an entry in the wrong state,422 invitation_email_not_sentwhen the approval invitation email cannot be sentdeleteWaitlistUser(waitlistUserId)—DELETE /user_management/waitlist_entries/:id(204)Response objects are
waitlistandwaitlist_user(matching the existingwaitlist_user.*webhook events), deserialized to camelCaseWaitlist/WaitlistUsertypes.waitlist_idcan be absent or null on legacy entries and is normalized towaitlistId: null.The new methods are wrapped in
@oagen-ignoremarkers since the API endpoints are excluded from the public OpenAPI spec while incubating.Warning
Do not merge/release until the
waitlist-apifeature flag reaches GA (AUTH-6723). The API returns 404 for these routes on teams without the flag, so shipping this early would expose broken methods.Test plan
defaultalias, legacy nullwaitlist_id, and 422 error paths (user_already_exists,invalid_state).npm test(917 passed, 12 skipped),npm run lint,npm run prettier, andnpm run typecheckall pass.https://linear.app/workos/issue/AUTH-6719