@@ -311,26 +311,6 @@ const entraApplicationEntitySchema = Joi.object().keys({
311311 displayName : Joi . string ( ) . required ( ) ,
312312} )
313313
314- const entraApplicationFolderPathSchema = Joi . string ( )
315- . custom ( ( value , helpers ) => {
316- if ( typeof value === 'string' ) {
317- if ( ! value . startsWith ( '/' ) ) {
318- return helpers . error ( 'string.startsWithSlash' )
319- }
320- if ( value . endsWith ( '/' ) ) {
321- return helpers . error ( 'string.endsWithSlash' )
322- }
323- }
324-
325- return value
326- } )
327- . messages ( {
328- 'string.startsWithSlash' :
329- '{{#label}} must start with a forward slash ("/")' ,
330- 'string.endsWithSlash' :
331- '{{#label}} must not end with a forward slash ("/")' ,
332- } )
333-
334314export const WorkflowEventSchema = Joi . object ( ) . keys ( {
335315 type : Joi . string ( )
336316 . required ( )
@@ -521,7 +501,25 @@ export const WorkflowEventSchema = Joi.object().keys({
521501 ...entraApplicationKeys ,
522502 sharepointSite : entraApplicationEntitySchema . required ( ) ,
523503 sharepointDrive : entraApplicationEntitySchema . required ( ) ,
524- folderPath : entraApplicationFolderPathSchema ,
504+ folderPath : Joi . string ( )
505+ . custom ( ( value , helpers ) => {
506+ if ( typeof value === 'string' ) {
507+ if ( ! value . startsWith ( '/' ) ) {
508+ return helpers . error ( 'string.startsWithSlash' )
509+ }
510+ if ( value . endsWith ( '/' ) ) {
511+ return helpers . error ( 'string.endsWithSlash' )
512+ }
513+ }
514+
515+ return value
516+ } )
517+ . messages ( {
518+ 'string.startsWithSlash' :
519+ '{{#label}} must start with a forward slash ("/")' ,
520+ 'string.endsWithSlash' :
521+ '{{#label}} must not end with a forward slash ("/")' ,
522+ } ) ,
525523 excludeAttachments : Joi . boolean ( ) . default ( false ) ,
526524 ...pdfSubmissionEventConfiguration ,
527525 } ) ,
@@ -530,9 +528,8 @@ export const WorkflowEventSchema = Joi.object().keys({
530528 is : 'EXCEL_ADD_ROW' ,
531529 then : Joi . object ( ) . keys ( {
532530 ...entraApplicationKeys ,
533- site : entraApplicationFolderPathSchema . required ( ) ,
534- drive : entraApplicationFolderPathSchema . required ( ) ,
535- folderPath : entraApplicationFolderPathSchema . required ( ) ,
531+ site : entraApplicationEntitySchema . required ( ) ,
532+ drive : entraApplicationEntitySchema . required ( ) ,
536533 excelFile : entraApplicationEntitySchema . required ( ) ,
537534 table : entraApplicationEntitySchema . required ( ) ,
538535 mapping : Joi . array ( )
0 commit comments