@@ -12,14 +12,15 @@ export class OrganizationInvitation extends BaseResource implements Organization
1212 id ! : string ;
1313 emailAddress ! : string ;
1414 organizationId ! : string ;
15+ publicMetadata : Record < string , unknown > = { } ;
1516 status ! : OrganizationInvitationStatus ;
1617 role ! : MembershipRole ;
1718 createdAt ! : Date ;
1819 updatedAt ! : Date ;
1920
2021 static async create (
2122 organizationId : string ,
22- { emailAddress, role, redirectUrl } : CreateOrganizationInvitationParams ,
23+ { emailAddress, role, redirectUrl, publicMetadata } : CreateOrganizationInvitationParams ,
2324 ) : Promise < OrganizationInvitationResource > {
2425 const json = (
2526 await BaseResource . _fetch < OrganizationInvitationJSON > ( {
@@ -29,6 +30,7 @@ export class OrganizationInvitation extends BaseResource implements Organization
2930 email_address : emailAddress ,
3031 role,
3132 redirect_url : redirectUrl ,
33+ public_metadata : JSON . stringify ( publicMetadata ) ,
3234 } as any ,
3335 } )
3436 ) ?. response as unknown as OrganizationInvitationJSON ;
@@ -55,6 +57,7 @@ export class OrganizationInvitation extends BaseResource implements Organization
5557 this . id = data . id ;
5658 this . emailAddress = data . email_address ;
5759 this . organizationId = data . organization_id ;
60+ this . publicMetadata = data . public_metadata ;
5861 this . role = data . role ;
5962 this . status = data . status ;
6063 this . createdAt = unixEpochToDate ( data . created_at ) ;
@@ -67,4 +70,5 @@ export type CreateOrganizationInvitationParams = {
6770 emailAddress : string ;
6871 role : MembershipRole ;
6972 redirectUrl ?: string ;
73+ publicMetadata ?: Record < string , unknown > ;
7074} ;
0 commit comments