Skip to content

Conversation

@tmilewski
Copy link
Member

@tmilewski tmilewski commented Aug 20, 2025

Description

Mirrors changes in the Backend API

USER-2628

Checklist

  • pnpm test runs as expected.
  • 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
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Summary by CodeRabbit

  • New Features

    • OAuth Applications list now supports an optional orderBy parameter to sort results by name or creation date. Sorting can be ascending or descending using a prefix indicator (+/-).
  • Chores

    • Added a changeset documenting a patch release for @clerk/backend, noting the new sorting capability on the OAuth Applications list endpoint.

@tmilewski tmilewski self-assigned this Aug 20, 2025
@changeset-bot
Copy link

changeset-bot bot commented Aug 20, 2025

🦋 Changeset detected

Latest commit: 70f421c

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

@vercel
Copy link

vercel bot commented Aug 20, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
clerk-js-sandbox Ready Ready Preview Comment Aug 20, 2025 7:31pm

@tmilewski tmilewski changed the title feat: Add orderBy to OAuthApplicationsApi feat(backend): Add orderBy to OAuthApplicationsApi Aug 20, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 20, 2025

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@6593

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@6593

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@6593

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@6593

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@6593

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@6593

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@6593

@clerk/clerk-expo

npm i https://pkg.pr.new/@clerk/clerk-expo@6593

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@6593

@clerk/express

npm i https://pkg.pr.new/@clerk/express@6593

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@6593

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@6593

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@6593

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@6593

@clerk/clerk-react

npm i https://pkg.pr.new/@clerk/clerk-react@6593

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@6593

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@6593

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@6593

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@6593

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@6593

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@6593

@clerk/types

npm i https://pkg.pr.new/@clerk/types@6593

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@6593

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@6593

commit: 70f421c

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 20, 2025

📝 Walkthrough

Walkthrough

  • Adds a changeset file documenting a patch release mentioning a new orderBy parameter for listing OAuth Applications.
  • In OAuthApplicationsApi.ts, introduces GetOAuthApplicationListParams type extending ClerkPaginationRequest with optional orderBy: WithSign<'name' | 'created_at'>.
  • Imports WithSign from util-types.
  • Updates OAuthApplicationsApi.list signature to accept GetOAuthApplicationListParams; passes params to queryParams unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Assessment against linked issues

Objective Addressed Explanation
Add new query param for ordering OAuth Applications (USER-2628) Typing adds orderBy, but it’s unclear if it maps to order_by in the request or is serialized correctly.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Add patch changeset entry noting orderBy (/.changeset/long-clowns-open.md) Release note metadata; not a functional code change tied to the objective itself.

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
.changeset/long-clowns-open.md (1)

5-6: Fix stray character and improve release note phrasing

There’s an unexpected “6” on Line 6 and the sentence can be slightly clearer.

Apply this diff:

-Add `orderBy` parameter to OAuth Applications list request
-6
+Add support for the `orderBy` parameter to the OAuth Applications list endpoint.
packages/backend/src/api/endpoints/OAuthApplicationsApi.ts (2)

49-49: Add explicit return type to public API method

Our guidelines ask for explicit return types on public APIs. Please annotate the return type.

Apply this diff:

-  public async list(params: GetOAuthApplicationListParams = {}) {
+  public async list(params: GetOAuthApplicationListParams = {}): Promise<PaginatedResourceResponse<OAuthApplication[]>> {

49-54: Document the new orderBy parameter on the list method and verify query encoding

  • Add a brief JSDoc on list so consumers discover orderBy without diving into types.
  • Confirm that “+” and “-” prefixes are URL-encoded by the request layer; unencoded “+” may be interpreted as space in query strings.

Here’s a JSDoc snippet you can place above the method:

/**
 * List OAuth applications.
 *
 * @param params Optional pagination and sorting parameters.
 *  - orderBy: Sort by 'name' or 'created_at'. Prefix with '+' for ASC or '-' for DESC.
 *    Examples: '+name', '-created_at'
 * @returns A paginated list of OAuth applications.
 */

If helpful, I can add a minimal test to assert the request includes an order_by query param mirroring orderBy and preserves the +/- prefix. Do you want me to draft that?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled
  • 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 0ef92cf and 70f421c.

📒 Files selected for processing (2)
  • .changeset/long-clowns-open.md (1 hunks)
  • packages/backend/src/api/endpoints/OAuthApplicationsApi.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (8)
.changeset/**

📄 CodeRabbit Inference Engine (.cursor/rules/monorepo.mdc)

Automated releases must use Changesets.

Files:

  • .changeset/long-clowns-open.md
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels

Files:

  • packages/backend/src/api/endpoints/OAuthApplicationsApi.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/backend/src/api/endpoints/OAuthApplicationsApi.ts
packages/**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/backend/src/api/endpoints/OAuthApplicationsApi.ts
packages/**/*.{ts,tsx,d.ts}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

Packages should export TypeScript types alongside runtime code

Files:

  • packages/backend/src/api/endpoints/OAuthApplicationsApi.ts
**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Prefer readonly for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Use const assertions for literal types: as const
Use satisfies operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports: import type { ... } from ...
No any types without justification
Proper error handling with typed errors
Consistent use of readonly for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)

Files:

  • packages/backend/src/api/endpoints/OAuthApplicationsApi.ts
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit Inference Engine (.cursor/rules/monorepo.mdc)

Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.

Files:

  • packages/backend/src/api/endpoints/OAuthApplicationsApi.ts
**/*

⚙️ CodeRabbit Configuration File

If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes.

Files:

  • packages/backend/src/api/endpoints/OAuthApplicationsApi.ts
🪛 LanguageTool
.changeset/long-clowns-open.md

[grammar] ~5-~5: There might be a mistake here.
Context: ...nd': patch --- Add orderBy parameter to OAuth Applications list request

(QB_NEW_EN)

⏰ 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). (6)
  • GitHub Check: Build Packages
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep/ci
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (3)
.changeset/long-clowns-open.md (1)

1-3: Changeset frontmatter looks correct for a patch bump

Package name and bump type are valid. No issues with the header.

packages/backend/src/api/endpoints/OAuthApplicationsApi.ts (2)

8-8: Good: type-only import for utility type

Using import type keeps the runtime bundle clean and matches our TypeScript guidelines.


40-46: Type-safe orderBy with WithSign is solid; query params are snake_cased and “+” is encoded

The backend’s request layer (packages/backend/src/api/request.ts) uses snakecase-keys to convert all queryParam keys—so your orderByorder_by automatically—and then appends values via URLSearchParams, which percent-encodes the “+” or “–” prefix (e.g. +name%2Bname). Everything aligns with other endpoints using WithSign, so no further action is needed.

@tmilewski tmilewski enabled auto-merge (squash) August 20, 2025 19:46
@tmilewski tmilewski merged commit 7bb644a into main Aug 20, 2025
65 of 67 checks passed
@tmilewski tmilewski deleted the tm/user-2628-oauth-applications-params branch August 20, 2025 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants