@@ -7,6 +7,7 @@ import type {
77 AzureProject ,
88 AzureSetPullRequestInput ,
99 Bitbucket ,
10+ BitbucketServer ,
1011 BitbucketWorkspaceStub ,
1112 EnterpriseOptions ,
1213 GetRepoInput ,
@@ -83,6 +84,7 @@ const selfHostedIntegrationIds: SelfHostedIntegrationId[] = [
8384 SelfHostedIntegrationId . GitHubEnterprise ,
8485 SelfHostedIntegrationId . CloudGitLabSelfHosted ,
8586 SelfHostedIntegrationId . GitLabSelfHosted ,
87+ SelfHostedIntegrationId . BitbucketServer ,
8688] as const ;
8789
8890export const supportedIntegrationIds : IntegrationId [ ] = [
@@ -109,7 +111,11 @@ export function isHostingIntegrationId(id: IntegrationId): id is HostingIntegrat
109111}
110112
111113export function isCloudSelfHostedIntegrationId ( id : IntegrationId ) : id is CloudSelfHostedIntegrationId {
112- return id === SelfHostedIntegrationId . CloudGitHubEnterprise || id === SelfHostedIntegrationId . CloudGitLabSelfHosted ;
114+ return (
115+ id === SelfHostedIntegrationId . CloudGitHubEnterprise ||
116+ id === SelfHostedIntegrationId . CloudGitLabSelfHosted ||
117+ id === SelfHostedIntegrationId . BitbucketServer
118+ ) ;
113119}
114120
115121export const enum PullRequestFilter {
@@ -357,14 +363,24 @@ export type GetBitbucketPullRequestsAuthoredByUserForWorkspaceFn = (
357363 } ;
358364 data : GitPullRequest [ ] ;
359365} > ;
366+ export type GetBitbucketServerPullRequestsForCurrentUserFn = (
367+ input : NumberedPageInput ,
368+ options ?: EnterpriseOptions ,
369+ ) => Promise < {
370+ pageInfo : {
371+ hasNextPage : boolean ;
372+ nextPage : number | null ;
373+ } ;
374+ data : GitPullRequest [ ] ;
375+ } > ;
360376export type GetIssuesForProjectFn = Jira [ 'getIssuesForProject' ] ;
361377export type GetIssuesForResourceForCurrentUserFn = (
362378 input : { resourceId : string } ,
363379 options ?: EnterpriseOptions ,
364380) => Promise < { data : ProviderIssue [ ] } > ;
365381
366382export interface ProviderInfo extends ProviderMetadata {
367- provider : GitHub | GitLab | Bitbucket | Jira | Trello | AzureDevOps ;
383+ provider : GitHub | GitLab | Bitbucket | BitbucketServer | Jira | Trello | AzureDevOps ;
368384 getPullRequestsForReposFn ?: GetPullRequestsForReposFn ;
369385 getPullRequestsForRepoFn ?: GetPullRequestsForRepoFn ;
370386 getPullRequestsForUserFn ?: GetPullRequestsForUserFn ;
@@ -380,6 +396,7 @@ export interface ProviderInfo extends ProviderMetadata {
380396 getAzureResourcesForUserFn ?: GetAzureResourcesForUserFn ;
381397 getBitbucketResourcesForUserFn ?: GetBitbucketResourcesForUserFn ;
382398 getBitbucketPullRequestsAuthoredByUserForWorkspaceFn ?: GetBitbucketPullRequestsAuthoredByUserForWorkspaceFn ;
399+ getBitbucketServerPullRequestsForCurrentUserFn ?: GetBitbucketServerPullRequestsForCurrentUserFn ;
383400 getJiraProjectsForResourcesFn ?: GetJiraProjectsForResourcesFn ;
384401 getAzureProjectsForResourceFn ?: GetAzureProjectsForResourceFn ;
385402 getIssuesForProjectFn ?: GetIssuesForProjectFn ;
@@ -527,6 +544,15 @@ export const providersMetadata: ProvidersMetadata = {
527544 supportedPullRequestFilters : [ PullRequestFilter . Author ] ,
528545 scopes : [ 'account:read' , 'repository:read' , 'pullrequest:read' , 'issue:read' ] ,
529546 } ,
547+ [ SelfHostedIntegrationId . BitbucketServer ] : {
548+ domain : '' ,
549+ id : SelfHostedIntegrationId . BitbucketServer ,
550+ name : 'Bitbucket Data Center' ,
551+ type : 'hosting' ,
552+ iconKey : SelfHostedIntegrationId . BitbucketServer ,
553+ supportedPullRequestFilters : [ PullRequestFilter . Author , PullRequestFilter . ReviewRequested ] ,
554+ scopes : [ 'Project (Read)' , 'Repository (Write)' ] ,
555+ } ,
530556 [ HostingIntegrationId . AzureDevOps ] : {
531557 domain : 'dev.azure.com' ,
532558 id : HostingIntegrationId . AzureDevOps ,
0 commit comments