-
Notifications
You must be signed in to change notification settings - Fork 419
feat(backend): Add orderBy to OAuthApplicationsApi
#6593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 70f421c The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
orderBy to OAuthApplicationsApiorderBy to OAuthApplicationsApi
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/elements
@clerk/clerk-expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/clerk-react
@clerk/react-router
@clerk/remix
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/themes
@clerk/types
@clerk/upgrade
@clerk/vue
commit: |
📝 WalkthroughWalkthrough
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 phrasingThere’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 methodOur 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
listso consumers discoverorderBywithout 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_byquery param mirroringorderByand 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.
📒 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
Avoidanytype - preferunknownwhen type is uncertain, then narrow with type guards
Useinterfacefor object shapes that might be extended
Usetypefor unions, primitives, and computed types
Preferreadonlyproperties for immutable data structures
Useprivatefor internal implementation details
Useprotectedfor inheritance hierarchies
Usepublicexplicitly for clarity in public APIs
Preferreadonlyfor 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
Useconst assertionsfor literal types:as const
Usesatisfiesoperator 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 ...
Noanytypes without justification
Proper error handling with typed errors
Consistent use ofreadonlyfor 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 bumpPackage 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 typeUsing
import typekeeps 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 encodedThe backend’s request layer (packages/backend/src/api/request.ts) uses snakecase-keys to convert all queryParam keys—so your
orderBy→order_byautomatically—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.
Description
Mirrors changes in the Backend API
USER-2628
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
New Features
Chores