Skip to content

Commit 4149430

Browse files
authored
Add Invitation Resent Event Interfaces (#1433)
## Description - Introduced `InvitationResentEvent` and `InvitationResentEventResponse` interfaces to handle the 'invitation.resent' event. - Updated the `Event` and `EventResponse` types to include the new event interfaces. - Modified the `deserializeEvent` function to support the new event type. ## Documentation Does this require changes to the WorkOS Docs? E.g. the [API Reference](https://workos.com/docs/reference) or code snippets need updates. ``` [ ] Yes ``` If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.
1 parent f7f4896 commit 4149430

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/common/interfaces/event.interface.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,11 @@ export interface InvitationRevokedEvent extends EventBase {
379379
data: InvitationEvent;
380380
}
381381

382+
export interface InvitationResentEvent extends EventBase {
383+
event: 'invitation.resent';
384+
data: InvitationEvent;
385+
}
386+
382387
export interface InvitationAcceptedEventResponse extends EventResponseBase {
383388
event: 'invitation.accepted';
384389
data: InvitationEventResponse;
@@ -394,6 +399,11 @@ export interface InvitationRevokedEventResponse extends EventResponseBase {
394399
data: InvitationEventResponse;
395400
}
396401

402+
export interface InvitationResentEventResponse extends EventResponseBase {
403+
event: 'invitation.resent';
404+
data: InvitationEventResponse;
405+
}
406+
397407
export interface MagicAuthCreatedEvent extends EventBase {
398408
event: 'magic_auth.created';
399409
data: MagicAuthEvent;
@@ -687,6 +697,7 @@ export type Event =
687697
| InvitationAcceptedEvent
688698
| InvitationCreatedEvent
689699
| InvitationRevokedEvent
700+
| InvitationResentEvent
690701
| MagicAuthCreatedEvent
691702
| PasswordResetCreatedEvent
692703
| PasswordResetSucceededEvent
@@ -744,6 +755,7 @@ export type EventResponse =
744755
| InvitationAcceptedEventResponse
745756
| InvitationCreatedEventResponse
746757
| InvitationRevokedEventResponse
758+
| InvitationResentEventResponse
747759
| MagicAuthCreatedEventResponse
748760
| PasswordResetCreatedEventResponse
749761
| PasswordResetSucceededEventResponse

src/common/serializers/event.serializer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ export const deserializeEvent = (event: EventResponse): Event => {
120120
case 'invitation.accepted':
121121
case 'invitation.created':
122122
case 'invitation.revoked':
123+
case 'invitation.resent':
123124
return {
124125
...eventBase,
125126
event: event.event,

0 commit comments

Comments
 (0)