feat(generated): Add new classes and fields for directory tokens, profiles, and memberships#475
Conversation
…files, and memberships
Greptile SummaryThis auto-generated PR adds new event classes ( Two type-safety issues stand out: Confidence Score: 3/5Two P1 Sorbet type mismatches need to be addressed before merging to avoid runtime surprises in typed callers. Two independent P1 findings: the ApiKeyCreatedData owner field is a raw Hash at runtime but typed as ApiKeyCreatedDataOwner in the RBI, and the user field on three membership models is typed non-nilable in RBIs despite a nullable implementation. Both can produce runtime errors in Sorbet-checked code. lib/workos/api_keys/api_key_created_data.rb (RBI not updated after owner type change) and rbi/workos/organization_membership.rbi, rbi/workos/user_organization_membership.rbi, rbi/workos/user_organization_membership_base_with_user.rbi (non-nilable user type) Important Files Changed
|
| sig { returns(WorkOS::User) } | ||
| def user; end | ||
|
|
||
| sig { params(value: WorkOS::User).returns(WorkOS::User) } | ||
| def user=(value); end |
There was a problem hiding this comment.
Non-nilable
user type disagrees with nullable implementation
The Ruby implementation initialises @user as hash[:user] ? WorkOS::User.new(hash[:user]) : nil, meaning user can be nil when the field is absent. The RBI declares sig { returns(WorkOS::User) } (non-nilable), so any Sorbet-checked caller that omits a nil guard will silently propagate nil at runtime while the type system promises an object. The same mismatch is present in rbi/workos/user_organization_membership.rbi and rbi/workos/user_organization_membership_base_with_user.rbi.
| sig { returns(WorkOS::User) } | |
| def user; end | |
| sig { params(value: WorkOS::User).returns(WorkOS::User) } | |
| def user=(value); end | |
| sig { returns(T.nilable(WorkOS::User)) } | |
| def user; end | |
| sig { params(value: T.nilable(WorkOS::User)).returns(T.nilable(WorkOS::User)) } | |
| def user=(value); end |
Summary
DsyncTokenCreated,DsyncTokenCreatedData,DsyncTokenDeleted,DsyncTokenDeletedData,UserOrganizationMembershipBaseWithUser, and type aliasesApiKeyValidationResponseApiKey,ApiKeyValidationResponseApiKeyOwnernamefield toDirectoryUser,DirectoryUserWithGroups,DsyncUserUpdatedData, andProfileclassesuserfield toOrganizationMembershipandUserOrganizationMembershipclassesAuthorization.list_memberships_for_resourceandlist_memberships_for_resource_by_external_idto returnUserOrganizationMembershipBaseWithUserinstead ofUserOrganizationMembershipBaseListDataADMIN_PORTALtoEventContextActorSourceand new typeUserOrganizationMembershipBaseWithUserStatususer_organization_membership_base_list_data.rbfromauthorization/togroups/directoryApiKeyCreatedDatato store rawownerhash instead of instantiating object; updatedApiKeyValidationResponseto use newApiKeyValidationResponseApiKeytypeTriggered by workos/openapi-spec@91fc76a