@@ -178,8 +178,7 @@ const specialPagesSchema = joi.object().keys({
178178 paymentSkippedWarningPage : paymentSkippedWarningPage . optional ( ) ,
179179} ) ;
180180
181- const listItemSchema = joi . object ( ) . keys ( {
182- text : localisedString ,
181+ const listItemBaseKeys = {
183182 value : joi . alternatives ( ) . try ( joi . number ( ) , joi . string ( ) ) ,
184183 checkpointDisplayValue : joi . alternatives ( ) . try ( joi . number ( ) , joi . string ( ) ) ,
185184 description : localisedString . optional ( ) ,
@@ -196,7 +195,17 @@ const listItemSchema = joi.object().keys({
196195 . allow ( null )
197196 . optional ( ) ,
198197 condition : joi . string ( ) . allow ( null , "" ) . optional ( ) ,
199- } ) ;
198+ } ;
199+
200+ // Either `html` or `text` must be present, but not both — .oxor enforces this.
201+ const listItemSchema = joi
202+ . object ( )
203+ . keys ( {
204+ ...listItemBaseKeys ,
205+ html : localisedString ,
206+ text : localisedString ,
207+ } )
208+ . oxor ( "html" , "text" ) ;
200209
201210const listSchema = joi . object ( ) . keys ( {
202211 name : joi . string ( ) . required ( ) ,
@@ -345,6 +354,60 @@ const addressLookupConfigSchema = msalAuthorizeConfigSchema.concat(
345354 } )
346355) ;
347356
357+ const summaryConfigSchema = joi . object ( ) . keys ( {
358+ submitLabel : joi . string ( ) . optional ( ) ,
359+ declaration : joi
360+ . object ( )
361+ . keys ( {
362+ label : joi . string ( ) . required ( ) ,
363+ errorMessage : joi . string ( ) . optional ( ) ,
364+ hideDeclarationHeading : joi . boolean ( ) . optional ( ) ,
365+ } )
366+ . optional ( ) ,
367+ removeFields : joi . array ( ) . items ( joi . string ( ) ) . optional ( ) ,
368+ mergeFields : joi
369+ . array ( )
370+ . items (
371+ joi . object ( ) . keys ( {
372+ names : joi . array ( ) . items ( joi . string ( ) ) . required ( ) ,
373+ to : joi . string ( ) . required ( ) ,
374+ joiner : joi . string ( ) . required ( ) ,
375+ } )
376+ )
377+ . optional ( ) ,
378+ relabelFields : joi . object ( ) . pattern ( joi . string ( ) , joi . string ( ) ) . optional ( ) ,
379+ valueTransforms : joi
380+ . object ( )
381+ . pattern ( joi . string ( ) , joi . object ( ) . pattern ( joi . string ( ) , joi . string ( ) ) )
382+ . optional ( ) ,
383+ conditionalRows : joi
384+ . array ( )
385+ . items (
386+ joi . object ( ) . keys ( {
387+ when : joi
388+ . object ( )
389+ . keys ( {
390+ field : joi . string ( ) . required ( ) ,
391+ value : joi . string ( ) . optional ( ) ,
392+ isEmpty : joi . boolean ( ) . optional ( ) ,
393+ } )
394+ . or ( "value" , "isEmpty" )
395+ . required ( ) ,
396+ removeFields : joi . array ( ) . items ( joi . string ( ) ) . optional ( ) ,
397+ appendToLastSection : joi
398+ . object ( )
399+ . keys ( {
400+ name : joi . string ( ) . required ( ) ,
401+ label : joi . string ( ) . required ( ) ,
402+ value : joi . string ( ) . required ( ) ,
403+ immutable : joi . boolean ( ) . optional ( ) ,
404+ } )
405+ . optional ( ) ,
406+ } )
407+ )
408+ . optional ( ) ,
409+ } ) ;
410+
348411export const Schema = joi
349412 . object ( )
350413 . required ( )
@@ -392,6 +455,7 @@ export const Schema = joi
392455 secureFormSubmissionConfig : secureFormSubmissionConfig . optional ( ) ,
393456 addressLookupConfig : addressLookupConfigSchema . optional ( ) ,
394457 error500ContactEmail : joi . string ( ) . optional ( ) ,
458+ summaryConfig : summaryConfigSchema . optional ( ) ,
395459 } ) ;
396460
397461/**
0 commit comments