Skip to content

fix(backend): Fix clerk.samlConnections.getSamlConnectionList return type #6332

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

Merged

Conversation

jaredpiedt
Copy link
Contributor

@jaredpiedt jaredpiedt commented Jul 16, 2025

Description

This updates the clerk.samlConnections.getSamlConnectionList to return the proper PaginatedResourceResonse type. This also exports the SamlConnection type from the package.

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

    • The SAML connections list now supports pagination, allowing for easier browsing of large datasets.
    • Additional filtering and sorting options are available when retrieving SAML connections.
  • Improvements

    • The SAML connection type is now available for external use, enhancing integration capabilities.

Copy link

changeset-bot bot commented Jul 16, 2025

🦋 Changeset detected

Latest commit: c96e3ce

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

Copy link

vercel bot commented Jul 16, 2025

@jaredpiedt is attempting to deploy a commit to the Clerk Production Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

coderabbitai bot commented Jul 16, 2025

📝 Walkthrough

Walkthrough

This change updates the @clerk/backend package by modifying the clerk.samlConnections.getSamlConnectionList() method to return paginated results instead of a simple array. The method's parameter type, SamlConnectionListParams, is expanded to support additional filtering, sorting, and pagination options. The return type is changed to a paginated response wrapper. The SamlConnection type is now exported for external use. Corresponding test files are updated to reflect the new paginated response structure, and the main index file is updated to export the SamlConnection type.


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 88fca72 and c96e3ce.

📒 Files selected for processing (1)
  • .changeset/young-steaks-chew.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/young-steaks-chew.md
⏰ 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). (1)
  • 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
🪧 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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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: 2

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 86a52c4 and 88fca72.

📒 Files selected for processing (4)
  • .changeset/young-steaks-chew.md (1 hunks)
  • packages/backend/src/api/__tests__/SamlConnectionApi.test.ts (3 hunks)
  • packages/backend/src/api/endpoints/SamlConnectionApi.ts (2 hunks)
  • packages/backend/src/index.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (10)
**/*.{js,jsx,ts,tsx}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/development.mdc
packages/**/*.ts

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/development.mdc
**/{__tests__,**/__tests__}/**/*.{js,jsx,ts,tsx}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/development.mdc
packages/**/*.{ts,tsx,d.ts}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/development.mdc
**/*.{ts,tsx}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/development.mdc
  • .cursor/rules/typescript.mdc
**/*.{test,spec}.{js,ts,tsx}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/monorepo.mdc
**/__tests__/**/*.{ts,tsx}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/typescript.mdc
**/*

Instructions used from:

Sources:
⚙️ CodeRabbit Configuration File

packages/**/index.{js,ts}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/development.mdc
**/index.ts

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/react.mdc
  • .cursor/rules/typescript.mdc
🧠 Learnings (4)
📓 Common learnings
Learnt from: dstaley
PR: clerk/javascript#6116
File: .changeset/tangy-garlics-say.md:1-2
Timestamp: 2025-06-13T16:09:53.061Z
Learning: In the Clerk JavaScript repository, contributors create intentionally empty changeset files (containing only the YAML delimiters) when a PR touches only non-published parts of the codebase (e.g., sandbox assets). This signals that no package release is required, so such changesets should not be flagged as missing content.
Learnt from: panteliselef
PR: clerk/javascript#6285
File: packages/types/src/commerce.ts:1305-1305
Timestamp: 2025-07-11T18:08:14.697Z
Learning: In the Clerk JavaScript repository, when there's a conflict between naming consistency (camelCase) and avoiding breaking changes, the team prioritizes maintaining backward compatibility over enforcing naming conventions, even for experimental APIs.
packages/backend/src/api/__tests__/SamlConnectionApi.test.ts (3)
Learnt from: CR
PR: clerk/javascript#0
File: .cursor/rules/typescript.mdc:0-0
Timestamp: 2025-06-30T10:33:45.961Z
Learning: Applies to **/__tests__/**/*.{ts,tsx} : Implement proper mock types that match interfaces in tests
Learnt from: CR
PR: clerk/javascript#0
File: .cursor/rules/react.mdc:0-0
Timestamp: 2025-06-30T10:32:37.848Z
Learning: Applies to **/*.test.{jsx,tsx} : Implement proper test assertions
Learnt from: CR
PR: clerk/javascript#0
File: .cursor/rules/development.mdc:0-0
Timestamp: 2025-06-30T10:29:42.997Z
Learning: React Testing Library for component testing
.changeset/young-steaks-chew.md (1)
Learnt from: wobsoriano
PR: clerk/javascript#6163
File: packages/backend/src/api/endpoints/APIKeysApi.ts:60-70
Timestamp: 2025-06-20T17:44:17.570Z
Learning: The Clerk codebase uses POST method for API key update operations instead of the typical PATCH method, as clarified by the maintainer wobsoriano.
packages/backend/src/index.ts (2)
Learnt from: CR
PR: clerk/javascript#0
File: .cursor/rules/development.mdc:0-0
Timestamp: 2025-06-30T10:29:42.997Z
Learning: Applies to packages/**/*.{ts,tsx,d.ts} : Packages should export TypeScript types alongside runtime code
Learnt from: CR
PR: clerk/javascript#0
File: .cursor/rules/typescript.mdc:0-0
Timestamp: 2025-06-30T10:33:45.961Z
Learning: Applies to **/*.{ts,tsx} : Use `public` explicitly for clarity in public APIs
🧬 Code Graph Analysis (1)
packages/backend/src/api/endpoints/SamlConnectionApi.ts (3)
packages/types/src/pagination.ts (1)
  • ClerkPaginationRequest (4-13)
packages/backend/src/api/resources/Deserializer.ts (1)
  • PaginatedResourceResponse (59-64)
packages/backend/src/api/resources/SamlConnection.ts (1)
  • SamlConnection (6-118)
🔇 Additional comments (5)
packages/backend/src/index.ts (1)

134-134: LGTM! Clean export addition.

The SamlConnection type export is correctly placed alphabetically and follows the established pattern for resource type exports.

packages/backend/src/api/__tests__/SamlConnectionApi.test.ts (2)

15-44: LGTM! Test mock properly updated for paginated response.

The mock response structure correctly reflects the new paginated format with data array and total_count field.


69-73: LGTM! Test assertions correctly updated for paginated response.

The assertions properly access the paginated response properties (response.data and response.totalCount).

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

1-1: LGTM! Correct imports added for pagination support.

The necessary imports for ClerkPaginationRequest and PaginatedResourceResponse are properly added.

Also applies to: 5-5


73-73: LGTM! Return type correctly updated for pagination.

The method now properly returns PaginatedResourceResponse<SamlConnection[]> instead of a simple array.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Member

@nikosdouvlis nikosdouvlis left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution @jaredpiedt, this looks good to go :)

Copy link

pkg-pr-new bot commented Jul 17, 2025

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/elements

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

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

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

@clerk/types

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

@clerk/upgrade

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

@clerk/vue

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

commit: c96e3ce

@nikosdouvlis nikosdouvlis merged commit df49349 into clerk:main Jul 17, 2025
15 of 33 checks passed
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.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy