@@ -48,6 +48,13 @@ const WhatsAppAckReactionSchema = z
4848 . strict ( )
4949 . optional ( ) ;
5050
51+ const WhatsAppPluginHooksSchema = z
52+ . object ( {
53+ messageReceived : z . boolean ( ) . optional ( ) ,
54+ } )
55+ . strict ( )
56+ . optional ( ) ;
57+
5158function stripDeprecatedWhatsAppNoopKeys ( value : unknown ) : unknown {
5259 if ( ! value || typeof value !== "object" || Array . isArray ( value ) ) {
5360 return value ;
@@ -97,6 +104,7 @@ function buildWhatsAppCommonShape(params: { useDefaults: boolean }) {
97104 replyToMode : ReplyToModeSchema . optional ( ) ,
98105 heartbeat : ChannelHeartbeatVisibilitySchema ,
99106 healthMonitor : ChannelHealthMonitorSchema ,
107+ pluginHooks : WhatsAppPluginHooksSchema ,
100108 } ;
101109}
102110
@@ -150,12 +158,6 @@ const WhatsAppAccountObjectSchema = z
150158 /** Override auth directory for this WhatsApp account (Baileys multi-file auth state). */
151159 authDir : z . string ( ) . optional ( ) ,
152160 mediaMaxMb : z . number ( ) . int ( ) . positive ( ) . optional ( ) ,
153- pluginHooks : z
154- . object ( {
155- messageReceived : z . boolean ( ) . optional ( ) ,
156- } )
157- . strict ( )
158- . optional ( ) ,
159161 } )
160162 . strict ( ) ;
161163
@@ -178,12 +180,6 @@ const WhatsAppConfigObjectSchema = z
178180 } )
179181 . strict ( )
180182 . optional ( ) ,
181- pluginHooks : z
182- . object ( {
183- messageReceived : z . boolean ( ) . optional ( ) ,
184- } )
185- . strict ( )
186- . optional ( ) ,
187183 } )
188184 . strict ( )
189185 . superRefine ( ( value , ctx ) => {
0 commit comments