@@ -88,6 +88,19 @@ export const ConfluenceBlock: BlockConfig<ConfluenceResponse> = {
8888 placeholder : 'Select Confluence page' ,
8989 dependsOn : [ 'credential' , 'domain' ] ,
9090 mode : 'basic' ,
91+ required : {
92+ field : 'operation' ,
93+ value : [
94+ 'read' ,
95+ 'update' ,
96+ 'delete' ,
97+ 'create_comment' ,
98+ 'list_comments' ,
99+ 'list_attachments' ,
100+ 'list_labels' ,
101+ 'upload_attachment' ,
102+ ] ,
103+ } ,
91104 } ,
92105 {
93106 id : 'manualPageId' ,
@@ -96,14 +109,26 @@ export const ConfluenceBlock: BlockConfig<ConfluenceResponse> = {
96109 canonicalParamId : 'pageId' ,
97110 placeholder : 'Enter Confluence page ID' ,
98111 mode : 'advanced' ,
112+ required : {
113+ field : 'operation' ,
114+ value : [
115+ 'read' ,
116+ 'update' ,
117+ 'delete' ,
118+ 'create_comment' ,
119+ 'list_comments' ,
120+ 'list_attachments' ,
121+ 'list_labels' ,
122+ 'upload_attachment' ,
123+ ] ,
124+ } ,
99125 } ,
100126 {
101127 id : 'spaceId' ,
102128 title : 'Space ID' ,
103129 type : 'short-input' ,
104130 placeholder : 'Enter Confluence space ID' ,
105- required : true ,
106- condition : { field : 'operation' , value : [ 'create' , 'get_space' ] } ,
131+ required : { field : 'operation' , value : [ 'create' , 'get_space' ] } ,
107132 } ,
108133 {
109134 id : 'title' ,
@@ -267,27 +292,6 @@ export const ConfluenceBlock: BlockConfig<ConfluenceResponse> = {
267292
268293 const effectivePageId = pageId ? String ( pageId ) . trim ( ) : ''
269294
270- const requiresPageId = [
271- 'read' ,
272- 'update' ,
273- 'delete' ,
274- 'create_comment' ,
275- 'list_comments' ,
276- 'list_attachments' ,
277- 'list_labels' ,
278- 'upload_attachment' ,
279- ]
280-
281- const requiresSpaceId = [ 'create' , 'get_space' ]
282-
283- if ( requiresPageId . includes ( operation ) && ! effectivePageId ) {
284- throw new Error ( 'Page ID is required. Please select a page or enter a page ID manually.' )
285- }
286-
287- if ( requiresSpaceId . includes ( operation ) && ! rest . spaceId ) {
288- throw new Error ( 'Space ID is required for this operation.' )
289- }
290-
291295 if ( operation === 'upload_attachment' ) {
292296 return {
293297 credential,
@@ -435,6 +439,19 @@ export const ConfluenceV2Block: BlockConfig<ConfluenceResponse> = {
435439 placeholder : 'Select Confluence page' ,
436440 dependsOn : [ 'credential' , 'domain' ] ,
437441 mode : 'basic' ,
442+ required : {
443+ field : 'operation' ,
444+ value : [
445+ 'read' ,
446+ 'update' ,
447+ 'delete' ,
448+ 'create_comment' ,
449+ 'list_comments' ,
450+ 'list_attachments' ,
451+ 'list_labels' ,
452+ 'upload_attachment' ,
453+ ] ,
454+ } ,
438455 } ,
439456 {
440457 id : 'manualPageId' ,
@@ -443,14 +460,26 @@ export const ConfluenceV2Block: BlockConfig<ConfluenceResponse> = {
443460 canonicalParamId : 'pageId' ,
444461 placeholder : 'Enter Confluence page ID' ,
445462 mode : 'advanced' ,
463+ required : {
464+ field : 'operation' ,
465+ value : [
466+ 'read' ,
467+ 'update' ,
468+ 'delete' ,
469+ 'create_comment' ,
470+ 'list_comments' ,
471+ 'list_attachments' ,
472+ 'list_labels' ,
473+ 'upload_attachment' ,
474+ ] ,
475+ } ,
446476 } ,
447477 {
448478 id : 'spaceId' ,
449479 title : 'Space ID' ,
450480 type : 'short-input' ,
451481 placeholder : 'Enter Confluence space ID' ,
452- required : true ,
453- condition : { field : 'operation' , value : [ 'create' , 'get_space' ] } ,
482+ required : { field : 'operation' , value : [ 'create' , 'get_space' ] } ,
454483 } ,
455484 {
456485 id : 'title' ,
@@ -513,6 +542,7 @@ export const ConfluenceV2Block: BlockConfig<ConfluenceResponse> = {
513542 placeholder : 'Select file to upload' ,
514543 condition : { field : 'operation' , value : 'upload_attachment' } ,
515544 mode : 'basic' ,
545+ required : { field : 'operation' , value : 'upload_attachment' } ,
516546 } ,
517547 {
518548 id : 'attachmentFileReference' ,
@@ -522,6 +552,7 @@ export const ConfluenceV2Block: BlockConfig<ConfluenceResponse> = {
522552 placeholder : 'Reference file from previous blocks' ,
523553 condition : { field : 'operation' , value : 'upload_attachment' } ,
524554 mode : 'advanced' ,
555+ required : { field : 'operation' , value : 'upload_attachment' } ,
525556 } ,
526557 {
527558 id : 'attachmentFileName' ,
@@ -624,27 +655,6 @@ export const ConfluenceV2Block: BlockConfig<ConfluenceResponse> = {
624655
625656 const effectivePageId = pageId ? String ( pageId ) . trim ( ) : ''
626657
627- const requiresPageId = [
628- 'read' ,
629- 'update' ,
630- 'delete' ,
631- 'create_comment' ,
632- 'list_comments' ,
633- 'list_attachments' ,
634- 'list_labels' ,
635- 'upload_attachment' ,
636- ]
637-
638- const requiresSpaceId = [ 'create' , 'get_space' ]
639-
640- if ( requiresPageId . includes ( operation ) && ! effectivePageId ) {
641- throw new Error ( 'Page ID is required. Please select a page or enter a page ID manually.' )
642- }
643-
644- if ( requiresSpaceId . includes ( operation ) && ! rest . spaceId ) {
645- throw new Error ( 'Space ID is required for this operation.' )
646- }
647-
648658 if ( operation === 'upload_attachment' ) {
649659 const normalizedFile = normalizeFileInput ( attachmentFile , { single : true } )
650660 if ( ! normalizedFile ) {
0 commit comments