Skip to content

feat(generated)!: regenerate from spec (6 changes)#489

Open
workos-sdk-automation[bot] wants to merge 8 commits into
mainfrom
oagen/spec-update-146a9a64fecd6bc4ccf8f0925608292c73b97ae6
Open

feat(generated)!: regenerate from spec (6 changes)#489
workos-sdk-automation[bot] wants to merge 8 commits into
mainfrom
oagen/spec-update-146a9a64fecd6bc4ccf8f0925608292c73b97ae6

Conversation

@workos-sdk-automation
Copy link
Copy Markdown
Contributor

@workos-sdk-automation workos-sdk-automation Bot commented May 20, 2026

Summary

feat(authorization)!: Remove search param from listResources operation

  • Removed optional search parameter from list_resources method
  • This is a breaking change as the parameter is no longer available for resource filtering

feat(authorization): Add filtering parameters to role assignment operations

  • Added resource_id, resource_external_id, resource_type_slug optional parameters to list_role_assignments
  • Added role_slug optional parameter to list_role_assignments_for_resource_by_external_id
  • Added role_slug optional parameter to list_role_assignments_for_resource

feat(organization_membership): Extract organization membership methods to dedicated service

  • Created new OrganizationMembershipService with all organization membership operations
  • Moved list_organization_memberships, create_organization_membership, get_organization_membership, update_organization_membership, delete_organization_membership, deactivate_organization_membership, reactivate_organization_membership from UserManagement to OrganizationMembershipService
  • Moved list_organization_membership_groups from UserManagementOrganizationMembershipGroups to OrganizationMembershipService
  • Updated client to expose organization_membership method instead of user_management_organization_membership_groups

chore(audit_logs): Consolidate audit log action and export models

  • Renamed AuditLogActionJson to AuditLogAction and updated base class
  • Renamed AuditLogExportJson to AuditLogExport and updated base class
  • Renamed AuditLogSchema to AuditLogSchemaDto
  • Updated all references and return types in AuditLogs service
  • Removed _Json suffix variants from type definitions

chore(webhooks): Consolidate webhook endpoint models

  • Renamed WebhookEndpointJson to WebhookEndpoint
  • Updated base class and initialization to use BaseModel.normalize
  • Updated all service method return types and references
  • Removed _Json suffix variant

chore(generated): Regenerate manifest and types with model consolidation

  • Updated .oagen-manifest.json with consolidated model references and new service mappings
  • Removed deprecated _Json suffixed type files
  • Updated service routing for organization membership endpoints
  • Added organization_membership_service to manifest

Triggered by workos/openapi-spec@146a9a6

BEGIN_COMMIT_OVERRIDE
feat(authorization)!: Remove search param from listResources operation (#489)
feat(authorization): Add filtering parameters to role assignment operations (#489)
feat(organization_membership): Extract organization membership methods to dedicated service (#489)
chore(audit_logs): Consolidate audit log action and export models (#489)
chore(webhooks): Consolidate webhook endpoint models (#489)
chore(generated): Regenerate manifest and types with model consolidation (#489)
END_COMMIT_OVERRIDE

@workos-sdk-automation workos-sdk-automation Bot requested a review from a team as a code owner May 20, 2026 20:29
@workos-sdk-automation workos-sdk-automation Bot added the autogenerated Autogenerated code or content label May 20, 2026
@workos-sdk-automation workos-sdk-automation Bot requested a review from a team as a code owner May 20, 2026 20:29
@workos-sdk-automation workos-sdk-automation Bot added the autogenerated Autogenerated code or content label May 20, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 20, 2026

Greptile Summary

This auto-generated PR consolidates audit log and webhook models (dropping _Json suffix variants), extracts organization membership operations into a dedicated OrganizationMembershipService, and adds new filtering parameters to authorization role-assignment endpoints.

  • Model consolidation: AuditLogActionJson, AuditLogExportJson, WebhookEndpointJson, and AuditLogsRetentionJson are replaced by their non-suffixed counterparts; AuditLogSchema is renamed AuditLogSchemaDto. All now extend BaseModel and use self.class.normalize.
  • New service: OrganizationMembershipService absorbs all org-membership methods (including group listing) previously spread across UserManagement and UserManagementOrganizationMembershipGroups; the client exposes it as organization_membership.
  • Authorization changes: list_resources loses the search param (breaking); list_role_assignments and its resource-scoped siblings gain new filter params.

Confidence Score: 4/5

Safe to merge with one fix: the wrong schema class reference in AuditLogAction must be corrected before this reaches production.

The org-membership extraction and model consolidations are clean. The one concrete defect is in AuditLogAction#initialize: after AuditLogSchema was renamed to AuditLogSchemaDto, the generator wired the schema field to AuditLogSchemaJson, a different unrelated class, so every AuditLogAction instance returned from list_actions will expose a schema object of the wrong type.

lib/workos/audit_logs/audit_log_action.rb — the schema field instantiates the wrong class.

Important Files Changed

Filename Overview
lib/workos/audit_logs/audit_log_action.rb Migrated to BaseModel, but schema field now instantiates AuditLogSchemaJson instead of the correctly-renamed AuditLogSchemaDto.
lib/workos/organization_membership_service.rb New service extracting all organization membership operations from UserManagement; logic and method signatures look correct.
lib/workos/client.rb Replaced user_management_organization_membership_groups accessor with organization_membership backed by the new service; straightforward swap.
lib/workos/authorization.rb Added resource_id, resource_external_id, resource_type_slug filter params to list_role_assignments and role_slug to the two resource-scoped variants; removed search from list_resources.
lib/workos/audit_logs/audit_log_schema_dto.rb Rename of AuditLogSchema to AuditLogSchemaDto; content is unchanged.
lib/workos/webhooks/webhook_endpoint.rb Consolidated WebhookEndpointJson to WebhookEndpoint; base class and normalize call updated correctly.
lib/workos/audit_logs.rb Return type annotations and model instantiations updated to use consolidated class names.
test/workos/test_organization_membership_service.rb New test file covering all OrganizationMembershipService endpoints including auth-error cases; coverage looks complete.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    Client["WorkOS::Client"]
    Client -->|".user_management"| UM["UserManagement"]
    Client -->|".organization_membership NEW"| OMS["OrganizationMembershipService"]
    Client -->|".audit_logs"| AL["AuditLogs"]
    Client -->|".authorization"| AZ["Authorization"]
    Client -->|".webhooks"| WH["Webhooks"]
    OMS --> LOM["list_organization_memberships"]
    OMS --> COM["create_organization_membership"]
    OMS --> GOM["get_organization_membership"]
    OMS --> UOM["update_organization_membership"]
    OMS --> DOM["delete_organization_membership"]
    OMS --> DEOM["deactivate_organization_membership"]
    OMS --> REOM["reactivate_organization_membership"]
    OMS --> LOG["list_organization_membership_groups"]
    AL -->|"returns"| ALA["AuditLogAction (was AuditLogActionJson)"]
    ALA -->|"schema BUG: AuditLogSchemaJson instead of AuditLogSchemaDto"| ALSD["AuditLogSchemaDto"]
    WH -->|"returns"| WE["WebhookEndpoint (was WebhookEndpointJson)"]
Loading

Reviews (2): Last reviewed commit: "this is up top now" | Re-trigger Greptile

Comment thread lib/workos/webhooks.rb
Comment on lines 5 to 9
require "json"
require "openssl"

module WorkOS
class Webhooks
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 The auto-generator added require "openssl" at the top of the file, but the hand-maintained @oagen-ignore-start block at line 133 already contains an identical require "openssl". Ruby's require is idempotent so this is harmless, but the top-level declaration is redundant and could be removed to keep the generated/manual boundary clean.

Suggested change
require "json"
require "openssl"
module WorkOS
class Webhooks
require "json"
module WorkOS
class Webhooks

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@object = hash[:object]
@name = hash[:name]
@schema = hash[:schema] ? WorkOS::AuditLogSchema.new(hash[:schema]) : nil
@schema = hash[:schema] ? WorkOS::AuditLogSchemaJson.new(hash[:schema]) : nil
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Wrong schema class after rename

The old code referenced WorkOS::AuditLogSchema, which was renamed to WorkOS::AuditLogSchemaDto in this PR. The updated code should use WorkOS::AuditLogSchemaDto, but instead it now references WorkOS::AuditLogSchemaJson — a separate, pre-existing class with a different field set (object, version, actor, targets, metadata, created_at) vs. what AuditLogSchemaDto exposes (actor, targets, metadata). Any caller reading AuditLogAction#schema will receive the wrong object type, and typed code relying on the .rbi annotation will break at runtime.

Suggested change
@schema = hash[:schema] ? WorkOS::AuditLogSchemaJson.new(hash[:schema]) : nil
@schema = hash[:schema] ? WorkOS::AuditLogSchemaDto.new(hash[:schema]) : nil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autogenerated Autogenerated code or content

Development

Successfully merging this pull request may close these issues.

1 participant