@gitkraken/provider-apis 0.47.1 → 0.49.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.
@@ -209,6 +209,18 @@ export declare class GitHub extends EnterpriseProvider implements GitProvider, I
209
209
  data: Blob;
210
210
  }>;
211
211
  getMergeBase(input: GetMergeBaseInput, options?: EnterpriseOptions): Promise<Result<string>>;
212
+ /**
213
+ * Returns the pull request's changes as a single unified diff string, matching the
214
+ * {@link GitLab.getPullRequestDiff} and {@link AzureDevOps.getPullRequestDiff} contract so the PR viewer can render
215
+ * GitHub PRs the same way.
216
+ *
217
+ * Requests the PR's REST resource with the `application/vnd.github.diff` media type, which makes GitHub return the
218
+ * git-style unified diff directly as the response body. Honors `options.baseUrl` for GitHub Enterprise.
219
+ */
220
+ getPullRequestDiff(input: {
221
+ repo: GetRepoInput;
222
+ pullRequestId: number;
223
+ }, options?: EnterpriseOptions): Promise<string>;
212
224
  searchPullRequests(input: {
213
225
  query: string;
214
226
  isDraft?: boolean;
@@ -291,6 +303,17 @@ export declare class GitHub extends EnterpriseProvider implements GitProvider, I
291
303
  pullRequest: SetPullRequestInput;
292
304
  comment: string;
293
305
  }, options?: EnterpriseOptions): Promise<void>;
306
+ /**
307
+ * Submits a pull request review, mapping the GitHub review event to the appropriate review mutation:
308
+ * `APPROVE` → {@link GitHub.approvePullRequest}, `REQUEST_CHANGES` → {@link GitHub.requestPullRequestChanges},
309
+ * `COMMENT` → {@link GitHub.commentOnPullRequest}. Centralizes the event→method mapping that would otherwise live in
310
+ * each consumer.
311
+ */
312
+ reviewPullRequest(input: {
313
+ pullRequest: SetPullRequestInput;
314
+ reviewEvent: 'APPROVE' | 'REQUEST_CHANGES' | 'COMMENT';
315
+ comment?: string;
316
+ }, options?: EnterpriseOptions): Promise<void>;
294
317
  addCommentToPullRequest(input: {
295
318
  pullRequest: SetPullRequestInput;
296
319
  comment: string;
@@ -1,7 +1,7 @@
1
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';
2
2
  import { GitLabGetIssueInput, PullRequestAssociation } from '../../types/exportedTypes/gitlab';
3
3
  import { Issue, SetIssueInput } from '../../types/exportedTypes/issueProvider';
4
- import { Result } from '../../types/exportedTypes/types';
4
+ import { NumberedPageInfo, Result } from '../../types/exportedTypes/types';
5
5
  import { GitProvider } from '../gitProvider';
6
6
  import { IssueProvider } from '../issueProvider';
7
7
  import { EnterpriseProvider } from '../provider';
@@ -54,14 +54,29 @@ export declare class GitLab extends EnterpriseProvider implements GitProvider, I
54
54
  };
55
55
  data: GitRepository[];
56
56
  }>;
57
+ /**
58
+ * Lists the groups (namespaces) the current user is a member of.
59
+ *
60
+ * @param input.topLevelOnly When `true` (the default), only top-level groups are returned. Set to `false` to
61
+ * include subgroups as their own entries.
62
+ */
63
+ getGroupsForCurrentUser(input?: {
64
+ topLevelOnly?: boolean;
65
+ } & NumberedPageInput, options?: EnterpriseOptions): Promise<{
66
+ pageInfo: NumberedPageInfo;
67
+ data: {
68
+ id: string;
69
+ path: string;
70
+ fullPath: string;
71
+ name: string;
72
+ webUrl: string;
73
+ }[];
74
+ }>;
57
75
  private getRefs;
58
76
  getBranches(input: {
59
77
  repo: GetRepoInput;
60
78
  } & NumberedPageInput, options?: EnterpriseOptions): Promise<{
61
- pageInfo: {
62
- hasNextPage: boolean;
63
- nextPage: number | null;
64
- };
79
+ pageInfo: NumberedPageInfo;
65
80
  data: {
66
81
  name: string;
67
82
  commit: {
@@ -74,10 +89,7 @@ export declare class GitLab extends EnterpriseProvider implements GitProvider, I
74
89
  getTags(input: {
75
90
  repo: GetRepoInput;
76
91
  } & NumberedPageInput, options?: EnterpriseOptions): Promise<{
77
- pageInfo: {
78
- hasNextPage: boolean;
79
- nextPage: number | null;
80
- };
92
+ pageInfo: NumberedPageInfo;
81
93
  data: {
82
94
  name: string;
83
95
  commit: {
@@ -5,3 +5,15 @@ export interface GitLabGetIssueInput {
5
5
  name: string;
6
6
  number: string;
7
7
  }
8
+ export interface GitLabGroup {
9
+ id: string;
10
+ path: string;
11
+ /**
12
+ * The full path of the group, including any parent groups (e.g. `parent/subgroup`).
13
+ * This is what a consumer needs to replicate GitLab's subgroup-prefix matching when
14
+ * filtering repos by group.
15
+ */
16
+ fullPath: string;
17
+ name: string;
18
+ webUrl: string;
19
+ }
@@ -59,3 +59,10 @@ export interface RESTTreeItem {
59
59
  path: string;
60
60
  mode: string;
61
61
  }
62
+ export interface RESTGroup {
63
+ id: number;
64
+ name: string;
65
+ path: string;
66
+ full_path: string;
67
+ web_url: string;
68
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitkraken/provider-apis",
3
- "version": "0.47.1",
3
+ "version": "0.49.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",