@gitkraken/provider-apis 0.49.0 → 0.50.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.
@@ -1,6 +1,6 @@
1
1
  import { AzureGetRepoInput, AzureGetReposInput, AzureGraphAccount, AzureOrganization, AzureProject, AzureSetAccountInput, AzureSetIssueInput, AzureSetPullRequestInput, PullRequestAsyncStatus, StatusByWorkItemIdByStatusId, WorkItemType } from '../../types/exportedTypes/azureDevOps';
2
- import { AddInlineCommentInput, CursorPageInput, DeleteCommentInput, EditCommentInput, EnterpriseOptions, GetMergeBaseInput, GetPRForRepoInput, GetPullRequestDescriptionInput, GetRepoErrorData, GetRepoInput, GetReposInput, GitComment, GitMergeStrategy, GitPullRequest, GitPullRequestReview, GitRepository, GitRepositoryPermissions, NumberedPageInput, PageInput, PullRequestDescription, ResolveReviewThreadInput, SetAccountInput, SetLabelInput, SetPullRequestDescriptionInput, SetPullRequestInput } from '../../types/exportedTypes/gitProvider';
3
- import { Issue, SetStatusInput } from '../../types/exportedTypes/issueProvider';
2
+ import { AddInlineCommentInput, CursorPageInput, DeleteCommentInput, EditCommentInput, EnterpriseOptions, GetMergeBaseInput, GetPRForRepoInput, GetPullRequestDescriptionInput, GetRepoErrorData, GetRepoInput, GetReposInput, GitComment, GitMergeStrategy, GitPullRequest, GitPullRequestReview, GitPullRequestState, GitRepository, GitRepositoryPermissions, NumberedPageInput, PageInput, PullRequestDescription, ResolveReviewThreadInput, SetAccountInput, SetLabelInput, SetPullRequestDescriptionInput, SetPullRequestInput } from '../../types/exportedTypes/gitProvider';
3
+ import { GitIssueState, Issue, SetStatusInput } from '../../types/exportedTypes/issueProvider';
4
4
  import { PagedResult, Result } from '../../types/exportedTypes/types';
5
5
  import { GitProvider } from '../gitProvider';
6
6
  import { IssueProvider } from '../issueProvider';
@@ -156,21 +156,30 @@ export declare class AzureDevOps extends EnterpriseProvider implements GitProvid
156
156
  };
157
157
  }[];
158
158
  }>;
159
+ private fetchRemoteInfoByRepoId;
159
160
  private getPullRequestsForRepoBase;
160
161
  getPullRequestsForRepo(input: {
161
162
  repo: GetRepoInput;
162
163
  assigneeLogins?: string[];
163
164
  authorLogin?: string;
165
+ reviewerId?: string;
166
+ states?: GitPullRequestState[];
167
+ includeRemoteInfo?: boolean;
164
168
  } & NumberedPageInput, options?: EnterpriseOptions): Promise<{
165
169
  pageInfo: {
166
170
  hasNextPage: boolean;
167
- nextPage: number;
171
+ nextPage: number | null;
172
+ currentPage: number;
168
173
  };
169
174
  data: GitPullRequest[];
170
175
  }>;
171
176
  getPullRequestsForRepos(input: {
172
177
  assigneeLogins?: string[];
173
178
  authorLogin?: string;
179
+ reviewerId?: string;
180
+ states?: GitPullRequestState[];
181
+ pageSize?: number;
182
+ includeRemoteInfo?: boolean;
174
183
  } & GetReposInput, options?: EnterpriseOptions): Promise<{
175
184
  data: GitPullRequest[];
176
185
  }>;
@@ -180,11 +189,15 @@ export declare class AzureDevOps extends EnterpriseProvider implements GitProvid
180
189
  project: string;
181
190
  assigneeLogins?: string[];
182
191
  authorLogin?: string;
192
+ reviewerId?: string;
193
+ states?: GitPullRequestState[];
183
194
  repo?: GetRepoInput;
195
+ includeRemoteInfo?: boolean;
184
196
  } & NumberedPageInput, options?: EnterpriseOptions): Promise<{
185
197
  pageInfo: {
186
198
  hasNextPage: boolean;
187
- nextPage: number;
199
+ nextPage: number | null;
200
+ currentPage: number;
188
201
  };
189
202
  data: GitPullRequest[];
190
203
  }>;
@@ -195,7 +208,11 @@ export declare class AzureDevOps extends EnterpriseProvider implements GitProvid
195
208
  }[];
196
209
  assigneeLogins?: string[];
197
210
  authorLogin?: string;
211
+ reviewerId?: string;
212
+ states?: GitPullRequestState[];
213
+ pageSize?: number;
198
214
  repo?: GetRepoInput;
215
+ includeRemoteInfo?: boolean;
199
216
  }, options?: EnterpriseOptions): Promise<{
200
217
  data: GitPullRequest[];
201
218
  }>;
@@ -264,16 +281,14 @@ export declare class AzureDevOps extends EnterpriseProvider implements GitProvid
264
281
  mentionLogin?: string;
265
282
  labelNames?: string[];
266
283
  statusByWorkItemIdByStatusId?: StatusByWorkItemIdByStatusId;
284
+ states?: GitIssueState[];
267
285
  } & NumberedPageInput, options?: EnterpriseOptions): Promise<{
268
286
  pageInfo: {
269
287
  hasNextPage: boolean;
270
- nextPage: null;
271
- };
272
- data: never[];
273
- } | {
274
- pageInfo: {
275
- hasNextPage: boolean;
276
- nextPage: number;
288
+ nextPage: number | null;
289
+ currentPage: number;
290
+ totalCount: number;
291
+ totalPages: number;
277
292
  };
278
293
  data: Issue[];
279
294
  }>;
@@ -1,5 +1,6 @@
1
1
  import { RefreshTokenResponse } from '../../types/exportedTypes/bitbucket';
2
- import { Account, CursorPageInput, GetRepoErrorData, GetRepoInput, GetReposInput, GitMergeStrategy, GitPullRequest, GitRepository, GitRepositoryPermissions, NumberedPageInput, Options, SetAccountInput, SetPullRequestInput } from '../../types/exportedTypes/gitProvider';
2
+ import { Account, CursorPageInput, GetRepoErrorData, GetRepoInput, GetReposInput, GitMergeStrategy, GitPullRequest, GitPullRequestState, GitRepository, GitRepositoryPermissions, NumberedPageInput, Options, SetAccountInput, SetPullRequestInput } from '../../types/exportedTypes/gitProvider';
3
+ import { NumberedPageInfo } from '../../types/exportedTypes/types';
3
4
  import { BitbucketRepositoryRole } from '../../types/internalTypes/bitbucket';
4
5
  import { GitProvider } from '../gitProvider';
5
6
  import { Provider } from '../provider';
@@ -152,11 +153,10 @@ export declare class Bitbucket extends Provider implements GitProvider {
152
153
  userId: string;
153
154
  workspaceSlug: string;
154
155
  repos?: GetRepoInput[];
156
+ states?: GitPullRequestState[];
157
+ query?: string;
155
158
  } & NumberedPageInput, options?: Options): Promise<{
156
- pageInfo: {
157
- hasNextPage: boolean;
158
- nextPage: number | null;
159
- };
159
+ pageInfo: NumberedPageInfo;
160
160
  data: GitPullRequest[];
161
161
  }>;
162
162
  private getPullRequestsForRepoBase;
@@ -165,17 +165,19 @@ export declare class Bitbucket extends Provider implements GitProvider {
165
165
  authorLogin?: string;
166
166
  reviewerId?: string;
167
167
  useOrFilter?: boolean;
168
+ states?: GitPullRequestState[];
169
+ query?: string;
168
170
  } & NumberedPageInput, options?: Options): Promise<{
169
- pageInfo: {
170
- hasNextPage: boolean;
171
- nextPage: number | null;
172
- };
171
+ pageInfo: NumberedPageInfo;
173
172
  data: GitPullRequest[];
174
173
  }>;
175
174
  getPullRequestsForRepos(input: {
176
175
  authorLogin?: string;
177
176
  reviewerId?: string;
178
177
  useOrFilter?: boolean;
178
+ states?: GitPullRequestState[];
179
+ query?: string;
180
+ pageSize?: number;
179
181
  } & GetReposInput, options?: Options): Promise<{
180
182
  data: GitPullRequest[];
181
183
  }>;
@@ -1,5 +1,5 @@
1
1
  import { BitbucketServerMergeStrategy } from '../../types/exportedTypes/bitbucket';
2
- import { Account, EnterpriseOptions, GetRepoErrorData, GetRepoInput, GetReposInput, GitPullRequest, GitRepository, NumberedPageInput, Options, SetPullRequestInput, User } from '../../types/exportedTypes/gitProvider';
2
+ import { Account, EnterpriseOptions, GetRepoErrorData, GetRepoInput, GetReposInput, GitPullRequest, GitPullRequestState, GitRepository, NumberedPageInput, Options, SetPullRequestInput, User } from '../../types/exportedTypes/gitProvider';
3
3
  import { Result } from '../../types/exportedTypes/types';
4
4
  import { BitbucketServerPullRequest } from '../../types/internalTypes/bitbucketServer';
5
5
  import { GitProvider } from '../gitProvider';
@@ -55,22 +55,32 @@ export declare class BitbucketServer extends EnterpriseProvider implements GitPr
55
55
  getPullRequestsForRepo(input: {
56
56
  repo: GetRepoInput;
57
57
  authorLogin?: string;
58
+ reviewerLogin?: string;
59
+ states?: GitPullRequestState[];
58
60
  } & NumberedPageInput, options?: EnterpriseOptions): Promise<{
59
61
  pageInfo: {
60
62
  hasNextPage: boolean;
61
63
  nextPage: number | null;
64
+ currentPage: number | null;
62
65
  };
63
66
  data: GitPullRequest[];
64
67
  }>;
65
68
  getPullRequestsForRepos(input: {
66
69
  authorLogin?: string;
70
+ reviewerLogin?: string;
71
+ states?: GitPullRequestState[];
72
+ pageSize?: number;
67
73
  } & GetReposInput, options?: EnterpriseOptions): Promise<{
68
74
  data: GitPullRequest[];
69
75
  }>;
70
- getPullRequestsForCurrentUser(input: NumberedPageInput, options?: EnterpriseOptions): Promise<{
76
+ getPullRequestsForCurrentUser(input: {
77
+ reviewerLogin?: string;
78
+ states?: GitPullRequestState[];
79
+ } & NumberedPageInput, options?: EnterpriseOptions): Promise<{
71
80
  pageInfo: {
72
81
  hasNextPage: boolean;
73
82
  nextPage: number | null;
83
+ currentPage: number | null;
74
84
  };
75
85
  data: GitPullRequest[];
76
86
  }>;
@@ -1,6 +1,6 @@
1
- import { Account, AddInlineCommentInput, CreateCommitInput, CursorPageInput, DeleteCommentInput, EditCommentInput, EnterpriseOptions, GetMergeBaseInput, GetPullRequestDescriptionInput, GetRepoErrorData, GetRepoInput, GitComment, GitLabel, GitMergeStrategy, GitMilestone, GitPullRequest, GitPullRequestReviewComment, GitPullRequestReviewState, GitRepository, GitTreeItem, NumberedPageInput, Organization, PullRequestDescription, ResolveReviewThreadInput, SetAccountInput, SetLabelInput, SetMilestoneInput, SetPullRequestDescriptionInput, SetPullRequestInput } from '../../types/exportedTypes/gitProvider';
1
+ import { Account, AddInlineCommentInput, CreateCommitInput, CursorPageInput, DeleteCommentInput, EditCommentInput, EnterpriseOptions, GetMergeBaseInput, GetPullRequestDescriptionInput, GetRepoErrorData, GetRepoInput, GitComment, GitLabel, GitMergeStrategy, GitMilestone, GitPullRequest, GitPullRequestReviewComment, GitPullRequestReviewState, GitPullRequestState, GitRepository, GitTreeItem, NumberedPageInput, Organization, PullRequestDescription, ResolveReviewThreadInput, SetAccountInput, SetLabelInput, SetMilestoneInput, SetPullRequestDescriptionInput, SetPullRequestInput } from '../../types/exportedTypes/gitProvider';
2
2
  import { FetchIssuesData, FetchPullRequestsData, GitHubIssueCloseReason } from '../../types/exportedTypes/github';
3
- import { Issue, SetIssueInput } from '../../types/exportedTypes/issueProvider';
3
+ import { GitIssueState, Issue, SetIssueInput } from '../../types/exportedTypes/issueProvider';
4
4
  import { Result } from '../../types/exportedTypes/types';
5
5
  import { GitProvider } from '../gitProvider';
6
6
  import { IssueProvider } from '../issueProvider';
@@ -226,6 +226,7 @@ export declare class GitHub extends EnterpriseProvider implements GitProvider, I
226
226
  isDraft?: boolean;
227
227
  includeFromArchivedRepos?: boolean;
228
228
  maxPageSize?: number;
229
+ states?: GitPullRequestState[];
229
230
  } & CursorPageInput, options?: EnterpriseOptions): Promise<{
230
231
  pageInfo: {
231
232
  hasNextPage: boolean;
@@ -237,6 +238,7 @@ export declare class GitHub extends EnterpriseProvider implements GitProvider, I
237
238
  query: string;
238
239
  includeFromArchivedRepos?: boolean;
239
240
  maxPageSize?: number;
241
+ states?: GitIssueState[];
240
242
  } & CursorPageInput, options?: EnterpriseOptions): Promise<{
241
243
  pageInfo: {
242
244
  hasNextPage: boolean;
@@ -1,4 +1,5 @@
1
- import { Account, EnterpriseOptions, GitComment, GitDiffLineType } from '../../types/exportedTypes/gitProvider';
1
+ import { Account, EnterpriseOptions, GitComment, GitDiffLineType, GitPullRequestState } from '../../types/exportedTypes/gitProvider';
2
+ import { GitIssueState } from '../../types/exportedTypes/issueProvider';
2
3
  import { FieldMap, GraphQLBody, GraphQLError, GraphQLResponse, ProviderConfig } from '../../types/exportedTypes/types';
3
4
  import { GraphQLBot, GraphQLEnterpriseUserAccount, GraphQLUser } from '../../types/internalTypes/github';
4
5
  export declare const minimumFeatureVersions: {
@@ -32,12 +33,29 @@ export declare const getPullRequestFields: (isDraftPullRequestSupported: boolean
32
33
  export declare const getIssueFields: (includeEmail: boolean | undefined, enterpriseVersion: [number, number, number] | null) => string;
33
34
  export declare const GithubSearchSyntaxQualifiers: Record<string, string>;
34
35
  export declare const getProjectGithubSearchSyntax: (search: string) => string[];
36
+ /**
37
+ * Maps the requested pull request states to GitHub search qualifiers. GitHub search combines `is:`
38
+ * qualifiers with AND, so combinations that mix open with a closed/merged state cannot be expressed
39
+ * in a single query; those fall back to no state qualifier and are filtered after normalization.
40
+ * When no states are requested, only open pull requests are returned to preserve previous behavior.
41
+ */
42
+ export declare const getPullRequestStateQualifier: (states?: GitPullRequestState[]) => string;
43
+ /**
44
+ * Maps the requested issue states to GitHub search qualifiers. When no states are requested, only
45
+ * open issues are returned to preserve previous behavior.
46
+ */
47
+ export declare const getIssueStateQualifier: (states?: GitIssueState[]) => string;
35
48
  export declare const makeSearchIssuesOrPRsGraphQLBody: (type: 'issue' | 'pr', query: string, cursor: string | null | undefined, options: {
36
49
  maxPageSize: number;
37
50
  supportsEmail: boolean;
38
51
  supportsDrafts?: boolean;
39
52
  enterpriseVersion?: [number, number, number] | null;
40
53
  includeFromArchivedRepos?: boolean;
54
+ /**
55
+ * The search state qualifier (e.g. `is:open`, `is:merged`) to apply. Defaults to `is:open` to
56
+ * preserve previous behavior. An empty string applies no state qualifier (all states).
57
+ */
58
+ stateQualifier?: string;
41
59
  }) => GraphQLBody;
42
60
  export declare const hasDraftsNotSupportedError: (errors?: GraphQLError[]) => boolean;
43
61
  export declare const getDiffLinesFromDiffHunk: (diffHunk: string, originalLine: number | null, originalStartLine: number | null, startDiffSide: 'LEFT' | 'RIGHT' | null) => {
@@ -1,6 +1,6 @@
1
- import { Account, AddInlineCommentInput, CursorPageInput, DeleteCommentInput, EditCommentInput, EnterpriseOptions, GetMergeBaseInput, GetPullRequestDescriptionInput, GetRepoErrorData, GetRepoInput, GetReposInput, GitComment, GitLabel, GitMergeStrategy, GitPullRequest, GitPullRequestReview, GitRepository, GitTreeItem, NumberedPageInput, PullRequestDescription, ResolveReviewThreadInput, SetAccountInput, SetLabelInput, SetMilestoneInput, SetPullRequestDescriptionInput, SetPullRequestInput } from '../../types/exportedTypes/gitProvider';
1
+ import { Account, AddInlineCommentInput, CursorPageInput, DeleteCommentInput, EditCommentInput, EnterpriseOptions, GetMergeBaseInput, GetPullRequestDescriptionInput, GetRepoErrorData, GetRepoInput, GetReposInput, GitComment, GitLabel, GitMergeStrategy, GitPullRequest, GitPullRequestReview, GitPullRequestState, GitRepository, GitTreeItem, NumberedPageInput, PullRequestDescription, ResolveReviewThreadInput, SetAccountInput, SetLabelInput, SetMilestoneInput, SetPullRequestDescriptionInput, SetPullRequestInput } from '../../types/exportedTypes/gitProvider';
2
2
  import { GitLabGetIssueInput, PullRequestAssociation } from '../../types/exportedTypes/gitlab';
3
- import { Issue, SetIssueInput } from '../../types/exportedTypes/issueProvider';
3
+ import { GitIssueState, Issue, SetIssueInput } from '../../types/exportedTypes/issueProvider';
4
4
  import { NumberedPageInfo, Result } from '../../types/exportedTypes/types';
5
5
  import { GitProvider } from '../gitProvider';
6
6
  import { IssueProvider } from '../issueProvider';
@@ -137,6 +137,8 @@ export declare class GitLab extends EnterpriseProvider implements GitProvider, I
137
137
  includeFromArchivedRepos?: boolean;
138
138
  labelNames?: string[];
139
139
  repo?: GetRepoInput;
140
+ states?: GitPullRequestState[];
141
+ pageSize?: number;
140
142
  } & CursorPageInput, options?: EnterpriseOptions): Promise<{
141
143
  pageInfo: {
142
144
  endCursor: string | null;
@@ -169,6 +171,8 @@ export declare class GitLab extends EnterpriseProvider implements GitProvider, I
169
171
  labelNames?: string[];
170
172
  isDraft?: boolean;
171
173
  reviewRequestedLogin?: string;
174
+ states?: GitPullRequestState[];
175
+ pageSize?: number;
172
176
  } & CursorPageInput, options?: EnterpriseOptions): Promise<{
173
177
  pageInfo: null;
174
178
  data: never[];
@@ -187,6 +191,8 @@ export declare class GitLab extends EnterpriseProvider implements GitProvider, I
187
191
  isDraft?: boolean;
188
192
  reviewRequestedLogin?: string;
189
193
  includeFromArchivedRepos?: boolean;
194
+ states?: GitPullRequestState[];
195
+ pageSize?: number;
190
196
  } & GetReposInput & CursorPageInput, options?: EnterpriseOptions): Promise<{
191
197
  data: GitPullRequest[];
192
198
  }>;
@@ -242,6 +248,8 @@ export declare class GitLab extends EnterpriseProvider implements GitProvider, I
242
248
  updatedBefore?: string;
243
249
  authorLogin?: string;
244
250
  labelNames?: string[];
251
+ states?: GitIssueState[];
252
+ pageSize?: number;
245
253
  } & CursorPageInput, options?: EnterpriseOptions): Promise<{
246
254
  pageInfo: {
247
255
  endCursor: string | null;
@@ -256,6 +264,8 @@ export declare class GitLab extends EnterpriseProvider implements GitProvider, I
256
264
  authorLogin?: string;
257
265
  labelNames?: string[];
258
266
  includeFromArchivedRepos?: boolean;
267
+ states?: GitIssueState[];
268
+ pageSize?: number;
259
269
  } & CursorPageInput, options?: EnterpriseOptions): Promise<{
260
270
  pageInfo: {
261
271
  endCursor: string | null;
@@ -1,5 +1,5 @@
1
1
  import { CursorPageInput, EnterpriseOptions, SetAccountInput, SetLabelInput } from '../../types/exportedTypes/gitProvider';
2
- import { SetIssueInput, SetStatusInput } from '../../types/exportedTypes/issueProvider';
2
+ import { GitIssueState, SetIssueInput, SetStatusInput } from '../../types/exportedTypes/issueProvider';
3
3
  import { JiraGetIssueInput, JiraProject, JiraResource, SetComponentInput } from '../../types/exportedTypes/jira';
4
4
  import { Result } from '../../types/exportedTypes/types';
5
5
  import { IssueProvider } from '../issueProvider';
@@ -72,6 +72,8 @@ export declare class Jira extends Provider implements IssueProvider {
72
72
  authorLogin?: string;
73
73
  mentionLogin?: string;
74
74
  labelNames?: string[];
75
+ states?: GitIssueState[];
76
+ pageSize?: number;
75
77
  } & CursorPageInput, options?: EnterpriseOptions): Promise<{
76
78
  data: import("../../types/exportedTypes/issueProvider").Issue[];
77
79
  pageInfo: {
@@ -86,6 +88,8 @@ export declare class Jira extends Provider implements IssueProvider {
86
88
  authorLogin?: string;
87
89
  mentionLogin?: string;
88
90
  labelNames?: string[];
91
+ states?: GitIssueState[];
92
+ pageSize?: number;
89
93
  } & CursorPageInput, options?: EnterpriseOptions): Promise<{
90
94
  data: import("../../types/exportedTypes/issueProvider").Issue[];
91
95
  pageInfo: {
@@ -1,8 +1,16 @@
1
1
  import { CursorPageInput, EnterpriseOptions, NumberedPageInput, SetLabelInput } from '../../types/exportedTypes/gitProvider';
2
- import { Issue, IssueComponent, IssueTransition, SetIssueInput, SetStatusInput } from '../../types/exportedTypes/issueProvider';
2
+ import { GitIssueState, Issue, IssueComponent, IssueTransition, SetIssueInput, SetStatusInput } from '../../types/exportedTypes/issueProvider';
3
3
  import { JiraComponent, JiraUser, SetComponentInput } from '../../types/exportedTypes/jira';
4
4
  import { ProviderConfig } from '../../types/exportedTypes/types';
5
5
  import { JiraComponentStub, JiraIssueField, JiraIssue, JiraTransition } from '../../types/internalTypes/jira';
6
+ /**
7
+ * Builds the JQL status clause for the requested issue states. Jira has three hard-coded status
8
+ * categories (To Do, In Progress, Done); open issues are those not in the Done category. When both
9
+ * states are requested no status clause is added (all states). When no states are requested, only
10
+ * open issues are returned to preserve previous behavior. Returns `null` when no clause should be
11
+ * added.
12
+ */
13
+ export declare const getJiraStatusCategoryClause: (states?: GitIssueState[]) => string | null;
6
14
  export type JiraIssueFieldNameToId = Record<string, string>;
7
15
  export declare const normalizeIssue: (issue: JiraIssue, fields: JiraIssueFieldNameToId | null, resourceUrl: string | null, resourceId?: string) => Issue;
8
16
  export declare const normalizeTransition: (transition: JiraTransition) => IssueTransition;
@@ -45,6 +53,8 @@ export declare const getIssuesForProject: (config: ProviderConfig, input: {
45
53
  mentionLogin?: string;
46
54
  labelNames?: string[];
47
55
  fields: JiraIssueFieldNameToId | null;
56
+ states?: GitIssueState[];
57
+ pageSize?: number;
48
58
  } & CursorPageInput, resourceUrl: string | null, options?: EnterpriseOptions) => Promise<{
49
59
  data: Issue[];
50
60
  pageInfo: {
@@ -60,6 +70,8 @@ export declare const getIssuesForProjects: (config: ProviderConfig, input: {
60
70
  mentionLogin?: string;
61
71
  labelNames?: string[];
62
72
  fields: JiraIssueFieldNameToId | null;
73
+ states?: GitIssueState[];
74
+ pageSize?: number;
63
75
  } & CursorPageInput, resourceUrl: string | null, options?: EnterpriseOptions) => Promise<{
64
76
  data: Issue[];
65
77
  pageInfo: {
@@ -1,5 +1,5 @@
1
1
  import { CursorPageInput, EnterpriseOptions, SetLabelInput } from '../../types/exportedTypes/gitProvider';
2
- import { SetIssueInput, SetStatusInput } from '../../types/exportedTypes/issueProvider';
2
+ import { GitIssueState, SetIssueInput, SetStatusInput } from '../../types/exportedTypes/issueProvider';
3
3
  import { SetComponentInput } from '../../types/exportedTypes/jira';
4
4
  import { IssueProvider } from '../issueProvider';
5
5
  import { EnterpriseProvider } from '../provider';
@@ -35,6 +35,8 @@ export declare class JiraServer extends EnterpriseProvider implements IssueProvi
35
35
  mentionLogin?: string;
36
36
  labelNames?: string[];
37
37
  resourceUrl?: string;
38
+ states?: GitIssueState[];
39
+ pageSize?: number;
38
40
  } & CursorPageInput, options?: EnterpriseOptions): Promise<{
39
41
  data: import("../../types/exportedTypes/issueProvider").Issue[];
40
42
  pageInfo: {
@@ -49,6 +51,8 @@ export declare class JiraServer extends EnterpriseProvider implements IssueProvi
49
51
  mentionLogin?: string;
50
52
  labelNames?: string[];
51
53
  resourceUrl?: string;
54
+ states?: GitIssueState[];
55
+ pageSize?: number;
52
56
  } & CursorPageInput, options?: EnterpriseOptions): Promise<{
53
57
  data: import("../../types/exportedTypes/issueProvider").Issue[];
54
58
  pageInfo: {
@@ -180,6 +180,7 @@ export interface GitPullRequest {
180
180
  state: GitPullRequestReviewState;
181
181
  }[] | null;
182
182
  reviewDecision: GitPullRequestReviewState | null;
183
+ isCrossRepository: boolean;
183
184
  repository: {
184
185
  id: string;
185
186
  graphQLId?: string;
@@ -199,6 +200,7 @@ export interface GitPullRequest {
199
200
  login: string;
200
201
  };
201
202
  remoteInfo: GitRepositoryRemoteInfo | null;
203
+ isFork?: boolean;
202
204
  } | null;
203
205
  headCommit: {
204
206
  buildStatuses: GitBuildStatus[] | null;
@@ -250,10 +252,12 @@ export interface GetRepoInput {
250
252
  }
251
253
  export interface GetReposInput {
252
254
  repos: GetRepoInput[];
255
+ includeRemoteInfo?: boolean;
253
256
  }
254
257
  export type GetPRForRepoInput = {
255
258
  repo: GetRepoInput;
256
259
  number: number;
260
+ includeRemoteInfo?: boolean;
257
261
  };
258
262
  export type GetPullRequestDescriptionInput = {
259
263
  repo: GetRepoInput;
@@ -346,6 +350,12 @@ export interface CursorPageInput {
346
350
  }
347
351
  export interface NumberedPageInput {
348
352
  page?: number | null;
353
+ /**
354
+ * The number of items to request per page. Honored by all numbered-page providers (Bitbucket,
355
+ * Bitbucket Server, Azure DevOps). When omitted, each provider falls back to its historical fixed
356
+ * page size, preserving previous behavior.
357
+ */
358
+ pageSize?: number | null;
349
359
  }
350
360
  export type PageInput = CursorPageInput | NumberedPageInput;
351
361
  export interface GetRepoErrorData {
@@ -1,4 +1,5 @@
1
- import { GetRepoInput } from './gitProvider';
1
+ import { GetRepoInput, GitPullRequestState } from './gitProvider';
2
+ import { GitIssueState } from './issueProvider';
2
3
  export declare enum GitHubIssueCloseReason {
3
4
  Completed = "COMPLETED",
4
5
  NotPlanned = "NOT_PLANNED"
@@ -12,6 +13,12 @@ export interface FetchPullRequestsData {
12
13
  mentionLogin?: string;
13
14
  labelNames?: string[];
14
15
  reviewRequestedLogin?: string;
16
+ /**
17
+ * The pull request states to include. When omitted or empty, only open pull requests are returned,
18
+ * preserving previous behavior. Providers that cannot express an arbitrary combination in a single
19
+ * query may query broadly and filter the normalized results to the requested states.
20
+ */
21
+ states?: GitPullRequestState[];
15
22
  startQuery?: string;
16
23
  includeFromArchivedRepos?: boolean;
17
24
  /**
@@ -33,6 +40,11 @@ export interface FetchIssuesData {
33
40
  authorLogin?: string;
34
41
  mentionLogin?: string;
35
42
  labelNames?: string[];
43
+ /**
44
+ * The issue states to include. When omitted or empty, only open issues are returned, preserving
45
+ * previous behavior.
46
+ */
47
+ states?: GitIssueState[];
36
48
  startQuery?: string;
37
49
  includeFromArchivedRepos?: boolean;
38
50
  /**
@@ -71,6 +71,22 @@ export interface CursorPageInfo {
71
71
  export interface NumberedPageInfo {
72
72
  hasNextPage: boolean;
73
73
  nextPage: number | null;
74
+ /**
75
+ * The page number that produced this result (1-based). Populated by numbered-page providers
76
+ * (Bitbucket, Bitbucket Server, Azure DevOps). Cursor-based providers (GitHub, GitLab, Jira)
77
+ * cannot express a current page and leave this `undefined`.
78
+ */
79
+ currentPage?: number | null;
80
+ /**
81
+ * Total number of pages, when the provider reports a total item count. Left `undefined` when the
82
+ * provider does not expose totals.
83
+ */
84
+ totalPages?: number | null;
85
+ /**
86
+ * Total number of items across all pages, when the provider reports it. Left `undefined` when the
87
+ * provider does not expose totals.
88
+ */
89
+ totalCount?: number | null;
74
90
  }
75
91
  export type Result<T> = {
76
92
  data: T;
@@ -158,7 +158,7 @@ export interface User extends UserStub {
158
158
  account_status: string;
159
159
  location: string | null;
160
160
  }
161
- export type PullRequestState = 'OPEN' | 'MERGED' | 'DECLINED';
161
+ export type PullRequestState = 'OPEN' | 'MERGED' | 'DECLINED' | 'SUPERSEDED';
162
162
  export type BitbucketPullRequestParticipant = {
163
163
  type: 'participant';
164
164
  user: UserStub;
@@ -218,6 +218,7 @@ export type GraphQLPullRequest = (GraphQLObjectWithDatabaseId | GraphQLObjectWit
218
218
  };
219
219
  sshUrl: string;
220
220
  url: string;
221
+ isFork: boolean;
221
222
  };
222
223
  repository: {
223
224
  id: string;
package/dist/utils.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { GitPullRequest, GitPullRequestState } from './types/exportedTypes/gitProvider';
1
2
  import { CursorPageInfo, FieldMap, NumberedPageInfo } from './types/exportedTypes/types';
2
3
  export declare const getRequestHeaders: (token?: string, basicAuth?: boolean) => Record<string, string>;
3
4
  export declare const toFieldMap: <T, K extends keyof T = keyof T>(fields?: K[] | undefined) => Partial<import("./types/exportedTypes/types").FullFieldMap<T>> | undefined;
@@ -16,5 +17,21 @@ export declare const followCursors: <T>(fn: (cursor?: number | string | null) =>
16
17
  export type MaybePromiseArr<T> = (Promise<T | undefined> | T | undefined)[];
17
18
  export declare function nonnullSettled<T>(arr: MaybePromiseArr<T>): Promise<T[]>;
18
19
  export declare function flatSettled<T>(arr: MaybePromiseArr<(T | undefined)[]>): Promise<T[]>;
20
+ /**
21
+ * Resolves a requested page size against a provider's fallback default and optional maximum.
22
+ * A missing, zero, negative, or NaN pageSize falls back to `fallback`. When `max` is provided, a
23
+ * valid pageSize is clamped to it; when omitted, the pageSize is used as-is (no clamping).
24
+ */
25
+ export declare const resolvePageSize: (pageSize: number | null | undefined, { fallback, max }: {
26
+ fallback: number;
27
+ max?: number | undefined;
28
+ }) => number;
29
+ export declare const filterPullRequestsByStates: (pullRequests: GitPullRequest[], states?: GitPullRequestState[]) => GitPullRequest[];
19
30
  export declare function getSettledValue<T>(promise: PromiseSettledResult<Awaited<T | undefined>>): T | undefined;
20
31
  export declare function getSettledValue<T>(promise: PromiseSettledResult<Awaited<T | undefined>> | undefined, defaultValue: NonNullable<T>): NonNullable<T>;
32
+ /**
33
+ * Runs `fn` over `items` in parallel within fixed-size batches, limiting the
34
+ * number of in-flight promises at any time. This avoids thundering-herd issues
35
+ * when a single page of work fans out to many independent async calls.
36
+ */
37
+ export declare function runInParallelBatches<T>(items: T[], batchSize: number, fn: (item: T) => Promise<unknown>): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitkraken/provider-apis",
3
- "version": "0.49.0",
3
+ "version": "0.50.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",
@@ -67,6 +67,7 @@
67
67
  "jackspeak": "2.1.1",
68
68
  "handlebars": "4.7.9",
69
69
  "serialize-javascript": "7.0.5",
70
- "typedoc/minimatch": "9.0.9"
70
+ "typedoc/minimatch": "9.0.9",
71
+ "js-yaml": "4.2.0"
71
72
  }
72
73
  }