Skip to content

Commit 93c4745

Browse files
committed
Moves resource descriptor types to models.ts
(#4047, #4119)
1 parent fbba684 commit 93c4745

File tree

2 files changed

+25
-20
lines changed

2 files changed

+25
-20
lines changed

src/plus/integrations/providers/bitbucket.ts

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,17 @@ import type { RepositoryMetadata } from '../../../git/models/repositoryMetadata'
1010
import { getSettledValue } from '../../../system/promise';
1111
import type { IntegrationAuthenticationProviderDescriptor } from '../authentication/integrationAuthenticationProvider';
1212
import type { ProviderAuthenticationSession } from '../authentication/models';
13-
import type { ResourceDescriptor } from '../integration';
1413
import { HostingIntegration } from '../integration';
14+
import type {
15+
BitbucketRemoteRepositoryDescriptor,
16+
BitbucketRepositoryDescriptor,
17+
BitbucketWorkspaceDescriptor,
18+
} from './bitbucket/models';
1519
import { providersMetadata } from './models';
1620

1721
const metadata = providersMetadata[HostingIntegrationId.Bitbucket];
1822
const authProvider = Object.freeze({ id: metadata.id, scopes: metadata.scopes });
1923

20-
interface BitbucketRepositoryDescriptor extends ResourceDescriptor {
21-
owner: string;
22-
name: string;
23-
}
24-
25-
interface BitbucketWorkspaceDescriptor extends ResourceDescriptor {
26-
id: string;
27-
name: string;
28-
slug: string;
29-
}
30-
31-
interface BitbucketRemoteRepositoryDescriptor extends ResourceDescriptor {
32-
resourceId: string;
33-
owner: string;
34-
name: string;
35-
cloneUrlHttps?: string;
36-
cloneUrlSsh?: string;
37-
}
38-
3924
export class BitbucketIntegration extends HostingIntegration<
4025
HostingIntegrationId.Bitbucket,
4126
BitbucketRepositoryDescriptor

src/plus/integrations/providers/bitbucket/models.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,26 @@ import type { IssueOrPullRequestState } from '../../../../git/models/issueOrPull
33
import type { PullRequestMember, PullRequestReviewer } from '../../../../git/models/pullRequest';
44
import { PullRequest, PullRequestReviewDecision, PullRequestReviewState } from '../../../../git/models/pullRequest';
55
import type { Provider } from '../../../../git/models/remoteProvider';
6+
import type { ResourceDescriptor } from '../../integration';
7+
8+
export interface BitbucketRepositoryDescriptor extends ResourceDescriptor {
9+
owner: string;
10+
name: string;
11+
}
12+
13+
export interface BitbucketWorkspaceDescriptor extends ResourceDescriptor {
14+
id: string;
15+
name: string;
16+
slug: string;
17+
}
18+
19+
export interface BitbucketRemoteRepositoryDescriptor extends ResourceDescriptor {
20+
resourceId: string;
21+
owner: string;
22+
name: string;
23+
cloneUrlHttps?: string;
24+
cloneUrlSsh?: string;
25+
}
626

727
export type BitbucketPullRequestState = 'OPEN' | 'DECLINED' | 'MERGED' | 'SUPERSEDED';
828

0 commit comments

Comments
 (0)