@@ -16,6 +16,9 @@ const PAGE_FIELD = ['pageId', 'manualPageId'] as const
1616 */
1717const SPACE_FIELD = [ 'spaceSelector' , 'spaceId' ] as const
1818
19+ /** Canonical basic/advanced pair for V1 operations that require a space key. */
20+ const SPACE_KEY_FIELD = [ 'spaceKeySelector' , 'manualSpaceKey' ] as const
21+
1922/** Canonical upload/reference pair for an attachment's file. V2 only. */
2023const ATTACHMENT_FILE_FIELD = [ 'attachmentFileUpload' , 'attachmentFileReference' ] as const
2124
@@ -485,7 +488,7 @@ export const ConfluenceV2Block: BlockConfig<ConfluenceResponse> = {
485488 { text : ', up to' , field : 'limit' , after : 'results' } ,
486489 ] ,
487490 search_in_space : [
488- { text : 'Search' , field : SPACE_FIELD , core : true } ,
491+ { text : 'Search' , field : SPACE_KEY_FIELD , core : true } ,
489492 { text : 'for' , field : 'query' } ,
490493 ] ,
491494 list_blogposts : [ 'List blog posts' , { text : ', up to' , field : 'limit' , after : 'results' } ] ,
@@ -834,7 +837,6 @@ export const ConfluenceV2Block: BlockConfig<ConfluenceResponse> = {
834837 'update_space' ,
835838 'delete_space' ,
836839 'list_pages_in_space' ,
837- 'search_in_space' ,
838840 'create_blogpost' ,
839841 'list_blogposts_in_space' ,
840842 'list_space_labels' ,
@@ -861,7 +863,6 @@ export const ConfluenceV2Block: BlockConfig<ConfluenceResponse> = {
861863 'update_space' ,
862864 'delete_space' ,
863865 'list_pages_in_space' ,
864- 'search_in_space' ,
865866 'create_blogpost' ,
866867 'list_blogposts_in_space' ,
867868 'list_space_labels' ,
@@ -872,6 +873,29 @@ export const ConfluenceV2Block: BlockConfig<ConfluenceResponse> = {
872873 ] ,
873874 } ,
874875 } ,
876+ {
877+ id : 'spaceKeySelector' ,
878+ title : 'Space' ,
879+ type : 'project-selector' ,
880+ canonicalParamId : 'selectedSpaceKey' ,
881+ serviceId : 'confluence' ,
882+ selectorKey : 'confluence.spaces' ,
883+ placeholder : 'Select Confluence space' ,
884+ dependsOn : [ 'credential' , 'domain' ] ,
885+ mode : 'basic' ,
886+ required : true ,
887+ condition : { field : 'operation' , value : 'search_in_space' } ,
888+ } ,
889+ {
890+ id : 'manualSpaceKey' ,
891+ title : 'Space Key' ,
892+ type : 'short-input' ,
893+ canonicalParamId : 'selectedSpaceKey' ,
894+ placeholder : 'Enter Confluence space key' ,
895+ mode : 'advanced' ,
896+ required : true ,
897+ condition : { field : 'operation' , value : 'search_in_space' } ,
898+ } ,
875899 {
876900 id : 'blogPostId' ,
877901 title : 'Blog Post ID' ,
@@ -1461,6 +1485,7 @@ export const ConfluenceV2Block: BlockConfig<ConfluenceResponse> = {
14611485 taskAssignedTo,
14621486 spaceName,
14631487 spaceKey,
1488+ selectedSpaceKey,
14641489 spaceDescription,
14651490 spacePropertyKey,
14661491 spacePropertyValue,
@@ -1626,6 +1651,15 @@ export const ConfluenceV2Block: BlockConfig<ConfluenceResponse> = {
16261651 }
16271652 }
16281653
1654+ if ( operation === 'search_in_space' ) {
1655+ return {
1656+ credential : oauthCredential ,
1657+ operation,
1658+ spaceKey : selectedSpaceKey ,
1659+ ...rest ,
1660+ }
1661+ }
1662+
16291663 if ( operation === 'update_space' ) {
16301664 return {
16311665 credential : oauthCredential ,
@@ -1730,6 +1764,7 @@ export const ConfluenceV2Block: BlockConfig<ConfluenceResponse> = {
17301764 oauthCredential : { type : 'string' , description : 'Confluence access token' } ,
17311765 pageId : { type : 'string' , description : 'Page identifier' } ,
17321766 spaceId : { type : 'string' , description : 'Space identifier' } ,
1767+ selectedSpaceKey : { type : 'string' , description : 'Selected space key' } ,
17331768 blogPostId : { type : 'string' , description : 'Blog post identifier' } ,
17341769 versionNumber : { type : 'number' , description : 'Page version number' } ,
17351770 accountId : { type : 'string' , description : 'Atlassian account ID' } ,
@@ -1758,7 +1793,7 @@ export const ConfluenceV2Block: BlockConfig<ConfluenceResponse> = {
17581793 taskStatus : { type : 'string' , description : 'Task status (complete or incomplete)' } ,
17591794 taskAssignedTo : { type : 'string' , description : 'Filter tasks by assignee account ID' } ,
17601795 spaceName : { type : 'string' , description : 'Space name for create/update' } ,
1761- spaceKey : { type : 'string' , description : 'Space key for create' } ,
1796+ spaceKey : { type : 'string' , description : 'Space key for create or scoped search ' } ,
17621797 spaceDescription : { type : 'string' , description : 'Space description' } ,
17631798 spacePropertyKey : { type : 'string' , description : 'Space property key' } ,
17641799 spacePropertyValue : { type : 'json' , description : 'Space property value' } ,
0 commit comments