1+ import { AllowFromEntrySchema , buildCatchallMultiAccountChannelSchema } from "openclaw/plugin-sdk" ;
12import { MarkdownConfigSchema , ToolPolicySchema } from "openclaw/plugin-sdk/bluebubbles" ;
23import { z } from "zod" ;
34import { buildSecretInputSchema , hasConfiguredSecretInput } from "./secret-input.js" ;
45
5- const allowFromEntry = z . union ( [ z . string ( ) , z . number ( ) ] ) ;
6-
76const bluebubblesActionSchema = z
87 . object ( {
98 reactions : z . boolean ( ) . default ( true ) ,
@@ -34,8 +33,8 @@ const bluebubblesAccountSchema = z
3433 password : buildSecretInputSchema ( ) . optional ( ) ,
3534 webhookPath : z . string ( ) . optional ( ) ,
3635 dmPolicy : z . enum ( [ "pairing" , "allowlist" , "open" , "disabled" ] ) . optional ( ) ,
37- allowFrom : z . array ( allowFromEntry ) . optional ( ) ,
38- groupAllowFrom : z . array ( allowFromEntry ) . optional ( ) ,
36+ allowFrom : z . array ( AllowFromEntrySchema ) . optional ( ) ,
37+ groupAllowFrom : z . array ( AllowFromEntrySchema ) . optional ( ) ,
3938 groupPolicy : z . enum ( [ "open" , "disabled" , "allowlist" ] ) . optional ( ) ,
4039 historyLimit : z . number ( ) . int ( ) . min ( 0 ) . optional ( ) ,
4140 dmHistoryLimit : z . number ( ) . int ( ) . min ( 0 ) . optional ( ) ,
@@ -60,8 +59,8 @@ const bluebubblesAccountSchema = z
6059 }
6160 } ) ;
6261
63- export const BlueBubblesConfigSchema = bluebubblesAccountSchema . extend ( {
64- accounts : z . object ( { } ) . catchall ( bluebubblesAccountSchema ) . optional ( ) ,
65- defaultAccount : z . string ( ) . optional ( ) ,
62+ export const BlueBubblesConfigSchema = buildCatchallMultiAccountChannelSchema (
63+ bluebubblesAccountSchema ,
64+ ) . extend ( {
6665 actions : bluebubblesActionSchema ,
6766} ) ;
0 commit comments