@@ -7,6 +7,7 @@ import type {
77 AzureProject ,
88 AzureSetPullRequestInput ,
99 Bitbucket ,
10+ BitbucketServer ,
1011 BitbucketWorkspaceStub ,
1112 EnterpriseOptions ,
1213 GetRepoInput ,
@@ -18,6 +19,7 @@ import type {
1819 Jira ,
1920 JiraProject ,
2021 JiraResource ,
22+ NumberedPageInput ,
2123 Issue as ProviderApiIssue ,
2224 PullRequestWithUniqueID ,
2325 RequestFunction ,
@@ -82,6 +84,7 @@ const selfHostedIntegrationIds: SelfHostedIntegrationId[] = [
8284 SelfHostedIntegrationId . GitHubEnterprise ,
8385 SelfHostedIntegrationId . CloudGitLabSelfHosted ,
8486 SelfHostedIntegrationId . GitLabSelfHosted ,
87+ SelfHostedIntegrationId . BitbucketServer ,
8588] as const ;
8689
8790export const supportedIntegrationIds : IntegrationId [ ] = [
@@ -108,7 +111,11 @@ export function isHostingIntegrationId(id: IntegrationId): id is HostingIntegrat
108111}
109112
110113export function isCloudSelfHostedIntegrationId ( id : IntegrationId ) : id is CloudSelfHostedIntegrationId {
111- return id === SelfHostedIntegrationId . CloudGitHubEnterprise || id === SelfHostedIntegrationId . CloudGitLabSelfHosted ;
114+ return (
115+ id === SelfHostedIntegrationId . CloudGitHubEnterprise ||
116+ id === SelfHostedIntegrationId . CloudGitLabSelfHosted ||
117+ id === SelfHostedIntegrationId . BitbucketServer
118+ ) ;
112119}
113120
114121export enum PullRequestFilter {
@@ -342,14 +349,24 @@ export type GetBitbucketResourcesForUserFn = (
342349 input : { userId : string } ,
343350 options ?: EnterpriseOptions ,
344351) => Promise < { data : BitbucketWorkspaceStub [ ] } > ;
352+ export type GetBitbucketServerPullRequestsForCurrentUserFn = (
353+ input : NumberedPageInput ,
354+ options ?: EnterpriseOptions ,
355+ ) => Promise < {
356+ pageInfo : {
357+ hasNextPage : boolean ;
358+ nextPage : number | null ;
359+ } ;
360+ data : GitPullRequest [ ] ;
361+ } > ;
345362export type GetIssuesForProjectFn = Jira [ 'getIssuesForProject' ] ;
346363export type GetIssuesForResourceForCurrentUserFn = (
347364 input : { resourceId : string } ,
348365 options ?: EnterpriseOptions ,
349366) => Promise < { data : ProviderIssue [ ] } > ;
350367
351368export interface ProviderInfo extends ProviderMetadata {
352- provider : GitHub | GitLab | Bitbucket | Jira | Trello | AzureDevOps ;
369+ provider : GitHub | GitLab | Bitbucket | BitbucketServer | Jira | Trello | AzureDevOps ;
353370 getPullRequestsForReposFn ?: GetPullRequestsForReposFn ;
354371 getPullRequestsForRepoFn ?: GetPullRequestsForRepoFn ;
355372 getPullRequestsForUserFn ?: GetPullRequestsForUserFn ;
@@ -364,6 +381,7 @@ export interface ProviderInfo extends ProviderMetadata {
364381 getJiraResourcesForCurrentUserFn ?: GetJiraResourcesForCurrentUserFn ;
365382 getAzureResourcesForUserFn ?: GetAzureResourcesForUserFn ;
366383 getBitbucketResourcesForUserFn ?: GetBitbucketResourcesForUserFn ;
384+ getBitbucketServerPullRequestsForCurrentUserFn ?: GetBitbucketServerPullRequestsForCurrentUserFn ;
367385 getJiraProjectsForResourcesFn ?: GetJiraProjectsForResourcesFn ;
368386 getAzureProjectsForResourceFn ?: GetAzureProjectsForResourceFn ;
369387 getIssuesForProjectFn ?: GetIssuesForProjectFn ;
@@ -511,6 +529,15 @@ export const providersMetadata: ProvidersMetadata = {
511529 supportedPullRequestFilters : [ PullRequestFilter . Author ] ,
512530 scopes : [ 'account:read' , 'repository:read' , 'pullrequest:read' , 'issue:read' ] ,
513531 } ,
532+ [ SelfHostedIntegrationId . BitbucketServer ] : {
533+ domain : '' ,
534+ id : SelfHostedIntegrationId . BitbucketServer ,
535+ name : 'Bitbucket Data Center' ,
536+ type : 'hosting' ,
537+ iconKey : SelfHostedIntegrationId . BitbucketServer ,
538+ supportedPullRequestFilters : [ PullRequestFilter . Author , PullRequestFilter . ReviewRequested ] ,
539+ scopes : [ 'Project (Read)' , 'Repository (Write)' ] ,
540+ } ,
514541 [ HostingIntegrationId . AzureDevOps ] : {
515542 domain : 'dev.azure.com' ,
516543 id : HostingIntegrationId . AzureDevOps ,
0 commit comments