@gitkraken/provider-apis 0.28.2 → 0.28.4

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.
@@ -96,6 +96,8 @@ export declare class Bitbucket extends Provider implements GitProvider {
96
96
  getPullRequestsForRepo(input: {
97
97
  repo: GetRepoInput;
98
98
  authorLogin?: string;
99
+ reviewerId?: string;
100
+ useOrFilter?: boolean;
99
101
  } & NumberedPageInput, options?: Options): Promise<{
100
102
  pageInfo: {
101
103
  hasNextPage: boolean;
@@ -105,6 +107,8 @@ export declare class Bitbucket extends Provider implements GitProvider {
105
107
  }>;
106
108
  getPullRequestsForRepos(input: {
107
109
  authorLogin?: string;
110
+ reviewerId?: string;
111
+ useOrFilter?: boolean;
108
112
  } & GetReposInput, options?: Options): Promise<{
109
113
  data: GitPullRequest[];
110
114
  }>;
@@ -3,9 +3,12 @@ import { FieldMap, GraphQLBody, GraphQLError, GraphQLResponse, ProviderConfig }
3
3
  export declare const minimumFeatureVersions: {
4
4
  AS_CODE_OWNER: number[];
5
5
  CHECK_RUN: number[];
6
- PR_ISSUE_FULL_DATABASE_ID: number[];
7
6
  LATEST_REVIEWS: number[];
8
7
  VIEWER_CAN_MERGE_AS_ADMIN: number[];
8
+ ISSUE_FULL_DATABASE_ID: number[];
9
+ PR_FULL_DATABASE_ID: number[];
10
+ PR_REVIEW_FULL_DATABASE_ID: number[];
11
+ PR_REVIEW_COMMENT_FULL_DATABASE_ID: number[];
9
12
  };
10
13
  export declare const MAX_PR_PAGE_SIZE = 15;
11
14
  export declare const MAX_ISSUE_PAGE_SIZE = 100;
@@ -148,6 +148,10 @@ export interface GitPullRequestPermissions {
148
148
  canMerge: boolean;
149
149
  canMergeAndBypassProtections: boolean;
150
150
  }
151
+ export interface GitRepositoryRemoteInfo {
152
+ cloneUrlHTTPS: string;
153
+ cloneUrlSSH: string;
154
+ }
151
155
  export interface GitPullRequest {
152
156
  id: string;
153
157
  graphQLId?: string;
@@ -183,10 +187,7 @@ export interface GitPullRequest {
183
187
  owner: {
184
188
  login: string;
185
189
  };
186
- remoteInfo: {
187
- cloneUrlHTTPS: string;
188
- cloneUrlSSH: string;
189
- } | null;
190
+ remoteInfo: GitRepositoryRemoteInfo | null;
190
191
  };
191
192
  headRepository: {
192
193
  id: string;
@@ -196,10 +197,7 @@ export interface GitPullRequest {
196
197
  owner: {
197
198
  login: string;
198
199
  };
199
- remoteInfo: {
200
- cloneUrlHTTPS: string;
201
- cloneUrlSSH: string;
202
- } | null;
200
+ remoteInfo: GitRepositoryRemoteInfo | null;
203
201
  } | null;
204
202
  headCommit: {
205
203
  buildStatuses: GitBuildStatus[] | null;
@@ -63,9 +63,10 @@ export interface Tag extends Ref {
63
63
  };
64
64
  };
65
65
  }
66
- interface RepositoryStub {
66
+ export interface RepositoryStub {
67
67
  links: CommonLinks & {
68
68
  avatar: Link;
69
+ clone?: NamedLink<'https' | 'ssh'>[];
69
70
  };
70
71
  type: 'repository';
71
72
  name: string;
@@ -158,6 +159,14 @@ export interface User extends UserStub {
158
159
  location: string | null;
159
160
  }
160
161
  export type PullRequestState = 'OPEN' | 'MERGED' | 'DECLINED';
162
+ export type BitbucketPullRequestParticipant = {
163
+ type: 'participant';
164
+ user: UserStub;
165
+ role: 'PARTICIPANT' | 'REVIEWER';
166
+ approved: boolean;
167
+ state: null | 'approved' | 'changes_requested';
168
+ participated_on: null | string;
169
+ };
161
170
  export interface BitbucketPullRequest {
162
171
  description: string;
163
172
  links: PullRequestLinks;
@@ -177,6 +186,7 @@ export interface BitbucketPullRequest {
177
186
  author: UserStub;
178
187
  merge_commit: CommitStub | null;
179
188
  closed_by: UserStub | null;
189
+ participants?: BitbucketPullRequestParticipant[];
180
190
  }
181
191
  export interface BitbucketWorkspace {
182
192
  type: 'workspace_membership';
@@ -5,6 +5,14 @@ export declare enum GraphQLViewerPermission {
5
5
  TRIAGE = "TRIAGE",
6
6
  WRITE = "WRITE"
7
7
  }
8
+ export interface GraphQLObjectWithDatabaseId {
9
+ databaseId: number;
10
+ fullDatabaseId: undefined;
11
+ }
12
+ export interface GraphQLObjectWithFullDatabaseId {
13
+ databaseId: undefined;
14
+ fullDatabaseId: string;
15
+ }
8
16
  export interface GraphQLLabel {
9
17
  color: string;
10
18
  description: string | null;
@@ -152,7 +160,7 @@ export interface GraphQLContext {
152
160
  targetUrl: string;
153
161
  }
154
162
  export type GraphQLLatestReviewAuthorType = GraphQLUser | GraphQLEnterpriseUserAccount | Record<string, never> | null;
155
- type GraphQLPullRequestBase = {
163
+ export type GraphQLPullRequest = (GraphQLObjectWithDatabaseId | GraphQLObjectWithFullDatabaseId) & {
156
164
  id: string;
157
165
  title: string;
158
166
  number: number;
@@ -202,7 +210,7 @@ type GraphQLPullRequestBase = {
202
210
  } | null;
203
211
  headRepository: {
204
212
  id: string;
205
- databaseId: string;
213
+ databaseId: number;
206
214
  name: string;
207
215
  owner: {
208
216
  login: string;
@@ -212,7 +220,7 @@ type GraphQLPullRequestBase = {
212
220
  };
213
221
  repository: {
214
222
  id: string;
215
- databaseId: string;
223
+ databaseId: number;
216
224
  name: string;
217
225
  owner: {
218
226
  login: string;
@@ -243,23 +251,14 @@ type GraphQLPullRequestBase = {
243
251
  } | null;
244
252
  viewerCanMergeAsAdmin?: boolean;
245
253
  };
246
- interface GraphQLPullRequestWithDatabaseId extends GraphQLPullRequestBase {
247
- databaseId: number;
248
- fullDatabaseId: undefined;
249
- }
250
- interface GraphQLPullRequestWithFullDatabaseId extends GraphQLPullRequestBase {
251
- databaseId: undefined;
252
- fullDatabaseId: string;
253
- }
254
- export type GraphQLPullRequest = GraphQLPullRequestWithDatabaseId | GraphQLPullRequestWithFullDatabaseId;
255
- type GraphQLIssueBase = {
254
+ export type GraphQLIssue = (GraphQLObjectWithDatabaseId | GraphQLObjectWithFullDatabaseId) & {
256
255
  id: string;
257
256
  number: string;
258
257
  title: string;
259
258
  url: string;
260
259
  state: GithubIssueState;
261
260
  repository: {
262
- databaseId: string;
261
+ databaseId: number;
263
262
  id: string;
264
263
  name: string;
265
264
  owner: {
@@ -284,15 +283,6 @@ type GraphQLIssueBase = {
284
283
  nodes: (GraphQLLabel | null)[] | null;
285
284
  } | null;
286
285
  };
287
- interface GraphQLIssueWithDatabaseId extends GraphQLIssueBase {
288
- databaseId: number;
289
- fullDatabaseId: undefined;
290
- }
291
- interface GraphQLIssueWithFullDatabaseId extends GraphQLIssueBase {
292
- databaseId: undefined;
293
- fullDatabaseId: string;
294
- }
295
- export type GraphQLIssue = GraphQLIssueWithDatabaseId | GraphQLIssueWithFullDatabaseId;
296
286
  export interface GraphQLMilestone {
297
287
  description: string | null;
298
288
  dueOn: string | null;
@@ -312,13 +302,12 @@ export interface GraphQLReviewThread {
312
302
  originalStartLine: number | null;
313
303
  startDiffSide: 'LEFT' | 'RIGHT' | null;
314
304
  }
315
- export interface GraphQLReviewComment {
305
+ export type GraphQLReviewComment = (GraphQLObjectWithDatabaseId | GraphQLObjectWithFullDatabaseId) & {
316
306
  author: {
317
307
  avatarUrl: string;
318
308
  login: string;
319
309
  } | null;
320
310
  body: string;
321
- databaseId: string;
322
311
  diffHunk: string;
323
312
  id: string;
324
313
  path: string;
@@ -327,7 +316,17 @@ export interface GraphQLReviewComment {
327
316
  id: string;
328
317
  } | null;
329
318
  url: string;
330
- }
319
+ };
320
+ export type GraphQLReview = (GraphQLObjectWithDatabaseId | GraphQLObjectWithFullDatabaseId) & {
321
+ author: {
322
+ avatarUrl: string;
323
+ login: string;
324
+ } | null;
325
+ body: string;
326
+ id: string;
327
+ publishedAt: string | null;
328
+ url: string;
329
+ };
331
330
  export interface RESTTreeResponse {
332
331
  sha: string;
333
332
  url: string;
@@ -341,4 +340,3 @@ export interface RESTTreeItem {
341
340
  sha: string;
342
341
  url: string;
343
342
  }
344
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitkraken/provider-apis",
3
- "version": "0.28.2",
3
+ "version": "0.28.4",
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",