feat(backend): add `orderBy` support to InvitationAPI.getInvitationList
Description
- Add
orderByto InvitationAPI.getInvitationList to control sorting direction and field to follow semantics of REST api
Checklist
- [x]
pnpm testruns as expected. - [x]
pnpm buildruns as expected. - [ ] (If applicable) JSDoc comments have been added or updated for any package exports
- [ ] (If applicable) Documentation has been updated
Type of change
- [ ] π Bug fix
- [x] π New feature
- [ ] π¨ Breaking change
- [ ] π Refactoring / dependency upgrade / documentation
- [ ] other:
Summary by CodeRabbit
-
New Features
- Invitation listings can now be sorted by creation date, email address, or expiration date. Use a leading '+' (or no sign) for ascending and '-' for descending.
-
Chores
- Patch-level update recorded for the backend invitation API.
π¦ Changeset detected
Latest commit: 3831714ff2811f3573f698f641770d766f2a1655
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 11 packages
| Name | Type |
|---|---|
| @clerk/backend | Patch |
| @clerk/agent-toolkit | Patch |
| @clerk/astro | Patch |
| @clerk/express | Patch |
| @clerk/fastify | Patch |
| @clerk/nextjs | Patch |
| @clerk/nuxt | Patch |
| @clerk/react-router | Patch |
| @clerk/remix | Patch |
| @clerk/tanstack-react-start | Patch |
| @clerk/testing | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
@mario-jerkovic is attempting to deploy a commit to the Clerk Production Team on Vercel.
A member of the Team first needs to authorize it.
Walkthrough
A patch-level update adds an optional orderBy parameter to GetInvitationListParams, allowing sorting by created_at, email_address, or expires_at with ascending/descending control via leading + or -. Also includes a changeset entry and updated JSDoc.
Changes
| Cohort / File(s) | Summary |
|---|---|
Changeset documentation .changeset/nasty-insects-follow.md |
Patch-level changeset entry noting getInvitationList now accepts an orderBy argument with +/- prefix support for sort direction. |
Invitation API update packages/backend/src/api/endpoints/InvitationApi.ts |
Imported WithSign type and added optional orderBy to GetInvitationListParams with JSDoc listing supported fields (created_at, email_address, expires_at), examples, and prefix semantics (- descending, +/no sign ascending). |
Sequence Diagram(s)
Estimated code review effort
π― 2 (Simple) | β±οΈ ~10 minutes
- Check
WithSigntype usage and consistency with prefix semantics. - Verify JSDoc examples match implemented parsing/validation.
- Ensure omission of
orderBypreserves existing default sort behavior.
Poem
π° I hopped through lines of code today,
Added a sort to make invites play,
Plus or minus sets the way,
Neat lists marchβhip hip hooray! π₯
Pre-merge checks and finishing touches
β Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | β Passed | Check skipped - CodeRabbitβs high-level summary is enabled. |
| Title check | β Passed | The PR title accurately describes the main change: adding orderBy support to InvitationAPI.getInvitationList, which is directly confirmed by the raw summary showing the new optional orderBy parameter addition. |
β¨ Finishing touches
- [ ] π Generate docstrings
π§ͺ Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
π Recent review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
π₯ Commits
Reviewing files that changed from the base of the PR and between 36336524b3e47086354fcba32e569769c775f3aa and 3831714ff2811f3573f698f641770d766f2a1655.
π Files selected for processing (1)
-
packages/backend/src/api/endpoints/InvitationApi.ts(2 hunks)
π§ Files skipped from review as they are similar to previous changes (1)
- packages/backend/src/api/endpoints/InvitationApi.ts
β° Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: semgrep-cloud-platform/scan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.