Skip to content

Organization role and permission events support#1469

Merged
csrbarber merged 1 commit intomainfrom
rbac-api-events-support
Feb 9, 2026
Merged

Organization role and permission events support#1469
csrbarber merged 1 commit intomainfrom
rbac-api-events-support

Conversation

@csrbarber
Copy link
Contributor

Description

Events support for:

  • organization_role.created
  • organization_role.updated
  • organization_role.deleted
  • permission.created
  • permission.updated
  • permission.deleted

Documentation

Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.

[X] Yes

If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.

@csrbarber csrbarber requested a review from a team as a code owner February 9, 2026 14:10
@csrbarber csrbarber requested a review from tribble February 9, 2026 14:10
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 9, 2026

Greptile Overview

Greptile Summary

Added webhook event support for 6 new event types: organization_role.created, organization_role.updated, organization_role.deleted, permission.created, permission.updated, and permission.deleted.

  • Added TypeScript interface definitions for all 6 events and their response types in event.interface.ts
  • Integrated new event types into the Event and EventResponse union types
  • Added deserialization logic in event.serializer.ts using existing deserializeOrganizationRole and deserializePermission functions
  • All changes follow established patterns used for other event types in the codebase
  • Properly imported required types and serializers from the authorization module

Confidence Score: 5/5

  • This PR is safe to merge with no concerns
  • The implementation follows established patterns exactly, reuses existing serializers and types, adds proper TypeScript definitions, and makes no logical changes - purely additive event support
  • No files require special attention

Important Files Changed

Filename Overview
src/common/interfaces/event.interface.ts Added 6 new event interfaces for organization role and permission events (created/updated/deleted), following established patterns
src/common/serializers/event.serializer.ts Added deserialization logic for new organization role and permission events using appropriate serializers

Sequence Diagram

sequenceDiagram
    participant API as WorkOS API
    participant Client as Node SDK Client
    participant Deserializer as Event Serializer
    participant Interface as Event Types
    
    API->>Client: Webhook event (organization_role.created/updated/deleted)
    Client->>Deserializer: deserializeEvent(eventResponse)
    Deserializer->>Deserializer: Switch on event.event type
    alt organization_role events
        Deserializer->>Deserializer: deserializeOrganizationRole(event.data)
        Deserializer-->>Interface: OrganizationRoleCreatedEvent/<br/>UpdatedEvent/DeletedEvent
    else permission events
        Deserializer->>Deserializer: deserializePermission(event.data)
        Deserializer-->>Interface: PermissionCreatedEvent/<br/>UpdatedEvent/DeletedEvent
    end
    Interface-->>Client: Typed Event object
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@csrbarber csrbarber requested a review from mattgd February 9, 2026 14:13
@csrbarber csrbarber force-pushed the rbac-api-events-support branch from 0b83d66 to 34c4c80 Compare February 9, 2026 18:30
@csrbarber csrbarber merged commit 61bab21 into main Feb 9, 2026
8 checks passed
@csrbarber csrbarber deleted the rbac-api-events-support branch February 9, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants