fix(backend): correct `createInvitationBulk` return type to `Promise<…
Description
- Corrects
createInvitationBulkto return an array of Invitation instead of a single Invitation. - Aligns the method’s return type with the bulk REST endpoint semantics and existing bulk invitation patterns.
- This was caught by CodeRabbit in this PR
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
- [x] 🐛 Bug fix
- [ ] 🌟 New feature
- [ ] 🔨 Breaking change
- [ ] 📖 Refactoring / dependency upgrade / documentation
- [ ] other:
🦋 Changeset detected
Latest commit: cb9c320d5a6f4bb2db81e6ad06704ca997340be0
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
The pull request corrects the return type annotation for the createInvitationBulk method in the @clerk/backend package. The method now correctly declares that it returns an array of invitations rather than a single invitation, aligning the type signature with actual behavior.
Changes
| Cohort / File(s) | Summary |
|---|---|
Changeset Release Documentation \.changeset/spotty-terms-heal\.md |
Adds changeset recording a patch-level fix for @clerk/backend: corrects createInvitationBulk return type to Promise<Invitation[]>. |
Invitation API Type Fix packages/backend/src/api/endpoints/InvitationApi\.ts |
Updates createInvitationBulk method's return type annotation from Promise<Invitation> to Promise<Invitation[]> and adjusts the generic parameter in the underlying request call. |
Estimated code review effort
🎯 1 (Trivial) | ⏱️ ~3 minutes
- Type correction is straightforward and localized to method signature
- Changeset documentation is formulaic
- No logic changes or behavioral modifications involved
Poem
🐰 A bulk of invites now return as they should, No longer one, but many—mistype understood! The array bounds this little fix with care, Hop hop, the types align everywhere! 🎉
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 title accurately describes the main change: correcting the return type of createInvitationBulk to Promise-based type, which aligns with the changeset and code modifications. |
✨ Finishing touches
- [ ] 📝 Generate docstrings
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
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.