Skip to content

ENT-4372-review#1482

Merged
swaroopAkkineniWorkos merged 3 commits intoENT-4372-list-memberships-for-resourcefrom
ENT-4372-review
Feb 13, 2026
Merged

ENT-4372-review#1482
swaroopAkkineniWorkos merged 3 commits intoENT-4372-list-memberships-for-resourcefrom
ENT-4372-review

Conversation

@swaroopAkkineniWorkos
Copy link
Contributor

@swaroopAkkineniWorkos swaroopAkkineniWorkos commented Feb 13, 2026

No description provided.

@linear
Copy link

linear bot commented Feb 13, 2026

ENT-4372 SDK Updates

@swaroopAkkineniWorkos swaroopAkkineniWorkos marked this pull request as ready for review February 13, 2026 14:15
@swaroopAkkineniWorkos swaroopAkkineniWorkos requested a review from a team as a code owner February 13, 2026 14:15
@swaroopAkkineniWorkos swaroopAkkineniWorkos requested review from mthadley and removed request for a team February 13, 2026 14:15
@swaroopAkkineniWorkos swaroopAkkineniWorkos merged commit 98a8d3c into ENT-4372-list-memberships-for-resource Feb 13, 2026
8 checks passed
@swaroopAkkineniWorkos swaroopAkkineniWorkos deleted the ENT-4372-review branch February 13, 2026 14:15
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 13, 2026

Greptile Overview

Greptile Summary

This PR refactors organization membership types to separate authorization and user-management concerns. It extracts base interfaces (BaseOrganizationMembership and BaseOrganizationMembershipResponse) and creates authorization-specific types that extend them with optional organizationName. The authorization module now uses its own deserializer instead of depending on the user-management serializer.

Key changes:

  • Split OrganizationMembership interface into base and extended versions
  • Created authorization-specific AuthorizationOrganizationMembership types with optional organizationName
  • Added dedicated deserializer for authorization membership responses
  • Updated authorization methods to use new types and deserializer

Breaking change concern: OrganizationMembership in user-management now requires organizationName and role fields (previously optional), which may affect existing code.

Confidence Score: 3/5

  • This PR has a potential breaking change that should be verified before merging
  • The refactoring is well-structured and improves type separation, but making organizationName and role required fields in the user-management OrganizationMembership interface could break existing code that expects these to be optional
  • Pay close attention to src/user-management/interfaces/organization-membership.interface.ts - verify that all code using OrganizationMembership can handle the now-required fields

Important Files Changed

Filename Overview
src/user-management/interfaces/organization-membership.interface.ts Split interface into base and extended versions to support different response shapes; organizationName, role, and roles are now required in OrganizationMembership but optional in base
src/authorization/interfaces/organization-membership-list.interface.ts Created authorization-specific membership types that extend base types with optional organizationName field
src/authorization/serializers/authorization-organization-membership.serializer.ts Added dedicated deserializer for authorization membership responses with organizationName handling

Sequence Diagram

sequenceDiagram
    participant Client
    participant Authorization
    participant API as WorkOS API
    participant Deserializer as AuthorizationOrganizationMembership<br/>Deserializer

    Client->>Authorization: listMembershipsForResource(options)
    Authorization->>API: GET /authorization/resources/{id}/organization_memberships
    API-->>Authorization: AuthorizationOrganizationMembershipListResponse
    Authorization->>Deserializer: deserializeAuthorizationOrganizationMembership()
    Deserializer-->>Authorization: AuthorizationOrganizationMembership[]
    Authorization-->>Client: AuthorizationOrganizationMembershipList

    Note over Deserializer: Maps API response fields:<br/>organization_name -> organizationName<br/>user_id -> userId<br/>organization_id -> organizationId
Loading

Last reviewed commit: d607e0a

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.

5 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +16 to +20
export interface OrganizationMembership extends BaseOrganizationMembership {
organizationName: string;
role: RoleResponse;
roles?: RoleResponse[];
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Making organizationName and role required (non-optional) is a breaking change. Existing code that uses OrganizationMembership may not expect these fields to always be present. Check that all usages of this type handle these fields as required, or consider keeping them optional for backward compatibility.

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.

1 participant