javascript icon indicating copy to clipboard operation
javascript copied to clipboard

feat(backend): add `orderBy` support to InvitationAPI.getInvitationList

Open mario-jerkovic opened this issue 3 months ago β€’ 3 comments

Description

  • Add orderBy to InvitationAPI.getInvitationList to control sorting direction and field to follow semantics of REST api

Checklist

  • [x] pnpm test runs as expected.
  • [x] pnpm build runs 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.

mario-jerkovic avatar Nov 04 '25 09:11 mario-jerkovic

πŸ¦‹ 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

changeset-bot[bot] avatar Nov 04 '25 09:11 changeset-bot[bot]

@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.

vercel[bot] avatar Nov 04 '25 09:11 vercel[bot]

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 WithSign type usage and consistency with prefix semantics.
  • Verify JSDoc examples match implemented parsing/validation.
  • Ensure omission of orderBy preserves 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.

❀️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Nov 04 '25 09:11 coderabbitai[bot]