@gitkraken/provider-apis 0.13.1 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -163,11 +163,32 @@ export declare class AzureDevOps extends Provider implements GitProvider {
163
163
  expectedSourceSha: string;
164
164
  mergeStrategy?: GitMergeStrategy.MergeCommit | GitMergeStrategy.Rebase | GitMergeStrategy.RebaseThenMergeCommit | GitMergeStrategy.Squash;
165
165
  }, options?: EnterpriseOptions): Promise<void>;
166
+ addPullRequestLabel(input: {
167
+ repo: GetRepoInput;
168
+ pullRequestId: string;
169
+ labelName: string;
170
+ }, options?: EnterpriseOptions): Promise<void>;
171
+ removePullRequestLabel(input: {
172
+ repo: GetRepoInput;
173
+ pullRequestId: string;
174
+ labelNameOrId: string;
175
+ }, options?: EnterpriseOptions): Promise<void>;
166
176
  setPullRequestAsDraft(input: {
167
177
  repo: GetRepoInput;
168
178
  pullRequestId: string;
169
179
  isDraft: boolean;
170
180
  }, options?: EnterpriseOptions): Promise<void>;
181
+ addPullRequestReviewer(input: {
182
+ repo: GetRepoInput;
183
+ pullRequestId: string;
184
+ reviewerId: string;
185
+ isRequired: boolean;
186
+ }, options?: EnterpriseOptions): Promise<void>;
187
+ removePullRequestReviewer(input: {
188
+ repo: GetRepoInput;
189
+ pullRequestId: string;
190
+ reviewerId: string;
191
+ }, options?: EnterpriseOptions): Promise<void>;
171
192
  getIssuesForAzureProject(input: {
172
193
  namespace: string;
173
194
  project: string;
@@ -188,12 +209,25 @@ export declare class AzureDevOps extends Provider implements GitProvider {
188
209
  };
189
210
  data: Issue[];
190
211
  }>;
212
+ private updateIssue;
191
213
  setIssueStatus(input: {
192
214
  namespace: string;
193
215
  project: string;
194
216
  issueId: string;
195
217
  status: string;
196
218
  }, options?: EnterpriseOptions): Promise<void>;
219
+ setIssueAssignee(input: {
220
+ namespace: string;
221
+ project: string;
222
+ issueId: string;
223
+ assigneeNameOrEmail: string | null;
224
+ }, options?: EnterpriseOptions): Promise<void>;
225
+ setIssueLabels(input: {
226
+ namespace: string;
227
+ project: string;
228
+ issueId: string;
229
+ tagNames: string[];
230
+ }, options?: EnterpriseOptions): Promise<void>;
197
231
  getIssueTypesForAzureProject(input: {
198
232
  namespace: string;
199
233
  project: string;
@@ -110,4 +110,9 @@ export declare class Bitbucket extends Provider implements GitProvider {
110
110
  expectedSourceSha: string;
111
111
  mergeStrategy?: GitMergeStrategy.MergeCommit | GitMergeStrategy.FastForward | GitMergeStrategy.Squash;
112
112
  }, options?: Options): Promise<void>;
113
+ setPullRequestReviewers(input: {
114
+ repo: GetRepoInput;
115
+ pullRequestId: string;
116
+ reviewerUsernames: string[];
117
+ }, options?: Options): Promise<void>;
113
118
  }
@@ -1,5 +1,6 @@
1
1
  import { EnterpriseOptions, GetRepoErrorData, GetRepoInput, GitProvider, GitRepository } from '../gitProvider';
2
2
  import { EnterpriseProvider } from '../provider';
3
+ import { BitbucketServerMergeStrategy } from './bitbucketServerTypes';
3
4
  export declare class BitbucketServer extends EnterpriseProvider implements GitProvider {
4
5
  private getBaseUrl;
5
6
  private getRequestHeaders;
@@ -19,4 +20,27 @@ export declare class BitbucketServer extends EnterpriseProvider implements GitPr
19
20
  data: GitRepository[];
20
21
  errors: GetRepoErrorData[];
21
22
  }>;
23
+ closePullRequest(input: {
24
+ repo: GetRepoInput;
25
+ pullRequestId: string;
26
+ version: number;
27
+ }, options: EnterpriseOptions): Promise<void>;
28
+ mergePullRequest(input: {
29
+ repo: GetRepoInput;
30
+ pullRequestId: string;
31
+ mergeStrategyId?: string;
32
+ version: number;
33
+ }, options: EnterpriseOptions): Promise<void>;
34
+ getMergeStrategies(options: EnterpriseOptions): Promise<{
35
+ data: {
36
+ defaultStrategy: BitbucketServerMergeStrategy;
37
+ strategies: BitbucketServerMergeStrategy[];
38
+ };
39
+ }>;
40
+ setPullRequestReviewers(input: {
41
+ repo: GetRepoInput;
42
+ pullRequestId: string;
43
+ reviewerUsernames: string[];
44
+ version: number;
45
+ }, options?: EnterpriseOptions): Promise<void>;
22
46
  }
@@ -4,3 +4,10 @@ export interface Link {
4
4
  export interface NamedLink<T extends string = string> extends Link {
5
5
  name: T;
6
6
  }
7
+ export interface BitbucketServerMergeStrategy {
8
+ description: string;
9
+ enabled: boolean;
10
+ flag: string;
11
+ id: string;
12
+ name: string;
13
+ }
@@ -24,6 +24,48 @@ export interface Organization {
24
24
  email: string | null;
25
25
  avatarUrl: string;
26
26
  }
27
+ export declare enum GitBuildStatusStage {
28
+ Build = "build",
29
+ Production = "production",
30
+ Staging = "staging",
31
+ Test = "test"
32
+ }
33
+ export declare enum GitHubCheckRunState {
34
+ Completed = "COMPLETED",
35
+ InProgress = "IN_PROGRESS",
36
+ Pending = "PENDING",
37
+ Queued = "QUEUED",
38
+ Requested = "REQUESTED",
39
+ Waiting = "WAITING"
40
+ }
41
+ export declare enum GitHubStatusState {
42
+ Error = "ERROR",
43
+ Expected = "EXPECTED",
44
+ Failure = "FAILURE",
45
+ Pending = "PENDING",
46
+ Success = "SUCCESS"
47
+ }
48
+ export declare enum GitLabCiJobStatus {
49
+ Canceled = "CANCELED",
50
+ Created = "CREATED",
51
+ Failed = "FAILED",
52
+ Manual = "MANUAL",
53
+ Pending = "PENDING",
54
+ Preparing = "PREPARING",
55
+ Running = "RUNNING",
56
+ Scheduled = "SCHEDULED",
57
+ Skipped = "SKIPPED",
58
+ Success = "SUCCESS",
59
+ WaitingForCallback = "WAITING_FOR_CALLBACK",
60
+ WaitingForResource = "WAITING_FOR_RESOURCE"
61
+ }
62
+ export interface GitBuildStatus {
63
+ description: string | null;
64
+ name: string | null;
65
+ state: GitHubCheckRunState | GitHubStatusState | GitLabCiJobStatus | null;
66
+ stage: GitBuildStatusStage | null;
67
+ url: string;
68
+ }
27
69
  export interface GitLabel {
28
70
  color: string | null;
29
71
  description: string | null;
@@ -148,12 +190,7 @@ export interface GitPullRequest {
148
190
  };
149
191
  } | null;
150
192
  headCommit: {
151
- buildStatus: {
152
- context: string;
153
- state: string;
154
- description: string;
155
- targetUrl?: string;
156
- } | null;
193
+ buildStatuses: GitBuildStatus[] | null;
157
194
  } | null;
158
195
  mergeableState: GitPullRequestMergeableState;
159
196
  milestone?: GitMilestone | null;
@@ -204,6 +204,14 @@ export declare class GitHub extends EnterpriseProvider implements GitProvider {
204
204
  pullRequestGraphQLId: string;
205
205
  isDraft: boolean;
206
206
  }, options?: EnterpriseOptions): Promise<void>;
207
+ setPullRequestReviewers(input: {
208
+ pullRequestGraphQLId: string;
209
+ reviewerGraphQLIds: string[];
210
+ }, options?: EnterpriseOptions): Promise<void>;
211
+ setPullRequestAssignees(input: {
212
+ pullRequestGraphQLId: string;
213
+ assigneeGraphQLIds: string[];
214
+ }, options?: EnterpriseOptions): Promise<void>;
207
215
  /**
208
216
  * Returns issues that were created by or are assigned to the user.
209
217
  */
@@ -216,6 +224,10 @@ export declare class GitHub extends EnterpriseProvider implements GitProvider {
216
224
  };
217
225
  data: Issue[];
218
226
  }>;
227
+ setPullRequestLabels(input: {
228
+ pullRequestGraphQLId: string;
229
+ labelGraphQLIds: string[];
230
+ }, options?: EnterpriseOptions): Promise<void>;
219
231
  getIssuesForRepos(input: FetchIssuesData & CursorPageInput, options?: EnterpriseOptions): Promise<{
220
232
  pageInfo: {
221
233
  hasNextPage: boolean;
@@ -231,10 +243,18 @@ export declare class GitHub extends EnterpriseProvider implements GitProvider {
231
243
  status: 'OPEN' | 'CLOSED';
232
244
  closeReason?: 'COMPLETED' | 'NOT_PLANNED';
233
245
  }, options?: EnterpriseOptions): Promise<void>;
246
+ setIssueLabels(input: {
247
+ issueGraphQLId: string;
248
+ labelGraphQLIds: string[];
249
+ }, options?: EnterpriseOptions): Promise<void>;
234
250
  setIssueMilestone(input: {
235
251
  issueGraphQLId: string;
236
252
  milestoneGraphQLId: string | null;
237
253
  }, options?: EnterpriseOptions): Promise<void>;
254
+ setIssueAssignees(input: {
255
+ issueGraphQLId: string;
256
+ assigneeGraphQLIds: string[];
257
+ }, options?: EnterpriseOptions): Promise<void>;
238
258
  getMilestonesForRepo(input: {
239
259
  repo: GetRepoInput;
240
260
  } & CursorPageInput, options?: EnterpriseOptions): Promise<{
@@ -1,4 +1,4 @@
1
- import { GetRepoInput } from '../gitProvider';
1
+ import { GetRepoInput, GitHubCheckRunState, GitHubStatusState } from '../gitProvider';
2
2
  export declare enum GraphQLViewerPermission {
3
3
  ADMIN = "ADMIN",
4
4
  MAINTAIN = "MAINTAIN",
@@ -66,6 +66,17 @@ export interface GraphQLOrganization {
66
66
  avatarUrl: string;
67
67
  }
68
68
  export type PullRequestState = 'OPEN' | 'CLOSED' | 'MERGED';
69
+ export interface GraphQLCheckRun {
70
+ name: string;
71
+ status: GitHubCheckRunState;
72
+ permalink: string;
73
+ }
74
+ export interface GraphQLContext {
75
+ context: string;
76
+ description: string;
77
+ state: GitHubStatusState;
78
+ targetUrl: string;
79
+ }
69
80
  export interface GraphQLPullRequest {
70
81
  id: string;
71
82
  databaseId: number;
@@ -92,14 +103,12 @@ export interface GraphQLPullRequest {
92
103
  nodes: {
93
104
  commit: {
94
105
  oid: string;
95
- status?: {
96
- contexts?: {
97
- context: string;
98
- state: string;
99
- description: string;
100
- targetUrl?: string | undefined;
101
- }[];
102
- };
106
+ statusCheckRollup: {
107
+ contexts: {
108
+ totalCount: number;
109
+ nodes: (GraphQLCheckRun | GraphQLContext)[] | null;
110
+ };
111
+ } | null;
103
112
  };
104
113
  }[] | null;
105
114
  totalCount: number;
@@ -186,6 +186,21 @@ export declare class GitLab extends EnterpriseProvider implements GitProvider, I
186
186
  pullRequestId: string;
187
187
  isDraft: boolean;
188
188
  }, options?: EnterpriseOptions): Promise<void>;
189
+ setPullRequestReviewers(input: {
190
+ repo: GetRepoInput;
191
+ pullRequestId: string;
192
+ reviewerUsernames: string[];
193
+ }, options?: EnterpriseOptions): Promise<void>;
194
+ setPullRequestAssignees(input: {
195
+ repo: GetRepoInput;
196
+ pullRequestId: string;
197
+ assigneeUsernames: string[];
198
+ }, options?: EnterpriseOptions): Promise<void>;
199
+ setPullRequestLabels(input: {
200
+ repo: GetRepoInput;
201
+ pullRequestId: string;
202
+ labelGraphQLIds: string[];
203
+ }, options?: EnterpriseOptions): Promise<void>;
189
204
  getIssue(input: GetIssueInput, options?: EnterpriseOptions): Promise<{
190
205
  data: Issue;
191
206
  }>;
@@ -219,11 +234,21 @@ export declare class GitLab extends EnterpriseProvider implements GitProvider, I
219
234
  issueId: string;
220
235
  status: 'CLOSE' | 'REOPEN';
221
236
  }, options?: EnterpriseOptions): Promise<void>;
237
+ setIssueLabels(input: {
238
+ repo: GetRepoInput;
239
+ issueId: string;
240
+ labelGraphQLIds: string[];
241
+ }, options?: EnterpriseOptions): Promise<void>;
222
242
  setIssueMilestone(input: {
223
243
  repo: GetRepoInput;
224
244
  issueId: string;
225
245
  milestoneGraphQLId: string | null;
226
246
  }, options?: EnterpriseOptions): Promise<void>;
247
+ setIssueAssignees(input: {
248
+ repo: GetRepoInput;
249
+ issueId: string;
250
+ assigneeUsernames: string[];
251
+ }, options?: EnterpriseOptions): Promise<void>;
227
252
  getMilestonesForRepo(input: {
228
253
  repo: GetRepoInput;
229
254
  } & CursorPageInput, options?: EnterpriseOptions): Promise<{
@@ -17,6 +17,11 @@ export interface IssueTransition {
17
17
  id: string;
18
18
  name: string;
19
19
  }
20
+ export interface IssueComponent {
21
+ description: string | null;
22
+ id: string;
23
+ name: string;
24
+ }
20
25
  export interface Issue {
21
26
  author: Account | null;
22
27
  assignees: Account[];
@@ -38,6 +43,7 @@ export interface Issue {
38
43
  color: string | null;
39
44
  } | null;
40
45
  statusTransitions?: IssueTransition[];
46
+ components?: IssueComponent[];
41
47
  title: string;
42
48
  type: string | null;
43
49
  updatedDate: Date | null;
@@ -2,6 +2,39 @@ import { Result } from '../../types';
2
2
  import { CursorPageInput, EnterpriseOptions } from '../gitProvider';
3
3
  import { Issue } from '../issueProvider';
4
4
  import { Provider } from '../provider';
5
+ interface AvatarUrls {
6
+ '16x16': string;
7
+ '24x24': string;
8
+ '32x32': string;
9
+ '48x48': string;
10
+ }
11
+ interface JiraUser {
12
+ accountId: string;
13
+ accountType: string;
14
+ active: boolean;
15
+ avatarUrls: AvatarUrls;
16
+ displayName: string;
17
+ emailAddress: string;
18
+ self: string;
19
+ timeZone: string;
20
+ }
21
+ interface JiraComponent {
22
+ ari?: string;
23
+ assignee?: JiraUser;
24
+ assigneeType: string;
25
+ description?: string;
26
+ id: string;
27
+ isAssigneeTypeValid: boolean;
28
+ lead?: JiraUser;
29
+ leadUserName?: string;
30
+ metadata?: unknown;
31
+ name: string;
32
+ project: string;
33
+ projectId: string;
34
+ realAssignee?: JiraUser;
35
+ realAssigneeType: string;
36
+ self: string;
37
+ }
5
38
  export interface JiraResource {
6
39
  id: string;
7
40
  name: string;
@@ -62,6 +95,12 @@ export declare class Jira extends Provider {
62
95
  username: string;
63
96
  }[];
64
97
  }>;
98
+ getComponentsForJiraProject(input: {
99
+ resourceId: string;
100
+ projectIdOrKey: string;
101
+ }, options?: EnterpriseOptions): Promise<{
102
+ data: JiraComponent[];
103
+ }>;
65
104
  getIssuesForProject(input: {
66
105
  project: string;
67
106
  resourceId: string;
@@ -76,6 +115,21 @@ export declare class Jira extends Provider {
76
115
  issueId: string;
77
116
  status: string;
78
117
  }, options?: EnterpriseOptions): Promise<void>;
118
+ setIssueAssignee(input: {
119
+ resourceId: string;
120
+ issueId: string;
121
+ assigneeId: string | null;
122
+ }, options?: EnterpriseOptions): Promise<void>;
123
+ setIssueComponents(input: {
124
+ resourceId: string;
125
+ issueId: string;
126
+ componentIds: string[];
127
+ }, options?: EnterpriseOptions): Promise<void>;
128
+ setIssueLabels(input: {
129
+ resourceId: string;
130
+ issueId: string;
131
+ labelNames: string[];
132
+ }, options?: EnterpriseOptions): Promise<void>;
79
133
  getLabelsForResource(input: {
80
134
  resourceId: string;
81
135
  } & CursorPageInput, options?: EnterpriseOptions): Promise<{
@@ -91,3 +145,4 @@ export declare class Jira extends Provider {
91
145
  }[];
92
146
  }>;
93
147
  }
148
+ export {};
@@ -68,11 +68,27 @@ export declare class Trello extends Provider {
68
68
  }, options?: EnterpriseOptions): Promise<{
69
69
  data: Issue[];
70
70
  }>;
71
+ private updateIssue;
71
72
  setIssueStatus(input: {
72
73
  appKey: string;
73
74
  cardId: string;
74
75
  status: string;
75
76
  }, options?: EnterpriseOptions): Promise<void>;
77
+ setIssueAssignees(input: {
78
+ appKey: string;
79
+ cardId: string;
80
+ assigneeIds: string[];
81
+ }, options?: EnterpriseOptions): Promise<void>;
82
+ setIssueLabels(input: {
83
+ appKey: string;
84
+ cardId: string;
85
+ labelIds: string[];
86
+ }, options?: EnterpriseOptions): Promise<void>;
87
+ setIssueArchived(input: {
88
+ appKey: string;
89
+ cardId: string;
90
+ archived: boolean;
91
+ }, options?: EnterpriseOptions): Promise<void>;
76
92
  getLabelsForBoard(input: {
77
93
  appKey: string;
78
94
  boardId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitkraken/provider-apis",
3
- "version": "0.13.1",
3
+ "version": "0.14.0",
4
4
  "description": "An SDK around different third-party APIs that accepts and returns data in a common format.",
5
5
  "author": "Axosoft, LLC dba GitKraken",
6
6
  "license": "SEE LICENSE IN LICENSE",