Skip to content
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

chore(backend): Added types to webhook json for waitlist entry #5148

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mackenzienolan
Copy link

Description

Added JSON types for WaitlistEntry for use with WebhookEvent

#5143

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:

Copy link

changeset-bot bot commented Feb 13, 2025

🦋 Changeset detected

Latest commit: d66f110

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-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 Feb 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 15, 2025 2:22pm

Comment on lines 386 to 394
export interface WaitlistEntryJSON extends ClerkResourceJSON {
created_at: number;
email_address: string;
id: string;
invitation: InvitationJSON | null;
object: typeof ObjectType.WaitlistEntry;
status: string;
updated_at: number;
}
Copy link
Member

Choose a reason for hiding this comment

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

Hey @mackenzienolan,
Thank you for the contribution 🤝

We should add also the is_locked: boolean property because we return the same resource as we have in the Backend API ref

Copy link
Author

Choose a reason for hiding this comment

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

Nice catch! Added is_locked. Was checking the webhook catalog and didn't double check the api.

@panteliselef panteliselef changed the title feat: added types to webhook json for waitlist entry chore(backend): Added types to webhook json for waitlist entry Feb 18, 2025
'@clerk/backend': patch
---

Added WaitlistEntryJSON and updated WebhookEvent to include WaitlistEntry
Copy link
Member

@panteliselef panteliselef Feb 18, 2025

Choose a reason for hiding this comment

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

Suggested change
Added WaitlistEntryJSON and updated WebhookEvent to include WaitlistEntry
Add waitlist entry types
- `WaitlistEntryJSON`
- `WaitlistEntryWebhookEvent`
Update `WebhookEvent` to include `WaitlistEntryWebhookEvent`

@@ -52,6 +53,8 @@ export type PermissionWebhookEvent = Webhook<
PermissionJSON
>;

export type WaitlistEntryWebhookEvent = Webhook<'waitlistEntry.created' | 'waitlistEntry.updated', WaitlistEntryJSON>;
Copy link
Member

Choose a reason for hiding this comment

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

Hey @mackenzienolan,
can you include the WaitlistEntryWebhookEvent in the webhooks export we have in packages/backend/src/api/resources/index.ts? :)

export type {
  EmailWebhookEvent,
  OrganizationWebhookEvent,
  OrganizationDomainWebhookEvent,
  OrganizationInvitationWebhookEvent,
  OrganizationMembershipWebhookEvent,
  PermissionWebhookEvent,
  RoleWebhookEvent,
  SessionWebhookEvent,
  SMSWebhookEvent,
  UserWebhookEvent,
  WebhookEvent,
  WebhookEventType,
  WaitlistEntryWebhookEvent,
} from './Webhooks';

Copy link
Member

@panteliselef panteliselef left a comment

Choose a reason for hiding this comment

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

I had to block this one, because the PR got approved. Let's fix the minor issues we commented and it will be good to go.

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.

4 participants