@@ -113,6 +113,46 @@ export type GetActivityInstanceConnectedParticipantsResponse = zInfer<
113113 typeof GetActivityInstanceConnectedParticipantsResponseSchema
114114> ;
115115
116+ // SHARE_INTERACTION
117+ export const ShareInteractionRequestSchema = z . object ( {
118+ command : z . string ( ) ,
119+ content : z . string ( ) . max ( 2000 ) . optional ( ) ,
120+ preview_image : z . object ( { height : z . number ( ) , url : z . string ( ) , width : z . number ( ) } ) . optional ( ) ,
121+ components : z
122+ . array (
123+ z . object ( {
124+ type : z . literal ( 1 ) ,
125+ components : z
126+ . array (
127+ z . object ( {
128+ type : z . literal ( 2 ) ,
129+ style : z . number ( ) . gte ( 1 ) . lte ( 5 ) ,
130+ label : z . string ( ) . max ( 80 ) . optional ( ) ,
131+ custom_id : z
132+ . string ( )
133+ . max ( 100 )
134+ . describe ( 'Developer-defined identifier for the button; max 100 characters' )
135+ . optional ( ) ,
136+ } ) ,
137+ )
138+ . max ( 5 )
139+ . optional ( ) ,
140+ } ) ,
141+ )
142+ . optional ( ) ,
143+ } ) ;
144+ export type ShareInteractionRequest = zInfer < typeof ShareInteractionRequestSchema > ;
145+
146+ // SHARE_LINK
147+ export const ShareLinkRequestSchema = z . object ( {
148+ referrer_id : z . string ( ) . max ( 64 ) . optional ( ) ,
149+ custom_id : z . string ( ) . max ( 64 ) . optional ( ) ,
150+ message : z . string ( ) . max ( 1000 ) ,
151+ } ) ;
152+ export type ShareLinkRequest = zInfer < typeof ShareLinkRequestSchema > ;
153+ export const ShareLinkResponseSchema = z . object ( { success : z . boolean ( ) } ) ;
154+ export type ShareLinkResponse = zInfer < typeof ShareLinkResponseSchema > ;
155+
116156/**
117157 * RPC Commands which support schemas.
118158 */
@@ -121,6 +161,8 @@ export enum Command {
121161 OPEN_SHARE_MOMENT_DIALOG = 'OPEN_SHARE_MOMENT_DIALOG' ,
122162 AUTHENTICATE = 'AUTHENTICATE' ,
123163 GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS = 'GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS' ,
164+ SHARE_INTERACTION = 'SHARE_INTERACTION' ,
165+ SHARE_LINK = 'SHARE_LINK' ,
124166}
125167
126168const emptyResponseSchema = z . object ( { } ) . optional ( ) . nullable ( ) ;
@@ -146,4 +188,12 @@ export const Schemas = {
146188 request : emptyRequestSchema ,
147189 response : GetActivityInstanceConnectedParticipantsResponseSchema ,
148190 } ,
191+ [ Command . SHARE_INTERACTION ] : {
192+ request : ShareInteractionRequestSchema ,
193+ response : emptyResponseSchema ,
194+ } ,
195+ [ Command . SHARE_LINK ] : {
196+ request : ShareLinkRequestSchema ,
197+ response : ShareLinkResponseSchema ,
198+ } ,
149199} as const ;
0 commit comments