@gitkraken/provider-apis 0.36.0 → 0.37.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,4 +1,4 @@
1
- import { Account, AddInlineCommentInput, CreateCommitInput, GetPRForRepoInput, GetRepoErrorData, GetRepoInput, GetReposInput, GitBlame, GitLabel, GitMergeStrategy, GitPullRequest, GitRefWithCommit, GitRepository, Options, PageInput, SetAccountInput, SetLabelInput, SetMilestoneInput, SetPullRequestInput, User } from '../types/exportedTypes/gitProvider';
1
+ import { Account, AddInlineCommentInput, CreateCommitInput, GetPRForRepoInput, GetRepoErrorData, GetRepoInput, GetReposInput, GitBlame, GitComment, GitLabel, GitMergeStrategy, GitPullRequest, GitRefWithCommit, GitRepository, Options, PageInput, SetAccountInput, SetLabelInput, SetMilestoneInput, SetPullRequestInput, User } from '../types/exportedTypes/gitProvider';
2
2
  import { PagedResult, Result } from '../types/exportedTypes/types';
3
3
  export interface GitProvider {
4
4
  getCurrentUser?(input: Record<string, never>, options: Options): Promise<Result<Account>>;
@@ -91,5 +91,9 @@ export interface GitProvider {
91
91
  comment: string;
92
92
  }, options: Options): Promise<void>;
93
93
  addInlineCommentToPullRequest?(input: AddInlineCommentInput, options: Options): Promise<string | undefined>;
94
+ getCommentsForPullRequest?(input: {
95
+ repo: GetRepoInput;
96
+ pullRequestNumber: number;
97
+ } & PageInput, options: Options): Promise<PagedResult<GitComment>>;
94
98
  }
95
99
  export declare const MAX_PAGE_SIZE = 100;
@@ -1,4 +1,4 @@
1
- import { Account, AddInlineCommentInput, CreateCommitInput, CursorPageInput, DeleteInlineCommentInput, EditInlineCommentInput, EnterpriseOptions, GetRepoErrorData, GetRepoInput, GitLabel, GitMergeStrategy, GitMilestone, GitPullRequest, GitPullRequestReviewComment, GitPullRequestReviewState, GitRepository, GitTreeItem, NumberedPageInput, Organization, SetAccountInput, SetLabelInput, SetMilestoneInput, SetPullRequestInput } from '../../types/exportedTypes/gitProvider';
1
+ import { Account, AddInlineCommentInput, CreateCommitInput, CursorPageInput, DeleteInlineCommentInput, EditInlineCommentInput, EnterpriseOptions, GetRepoErrorData, GetRepoInput, GitComment, GitLabel, GitMergeStrategy, GitMilestone, GitPullRequest, GitPullRequestReviewComment, GitPullRequestReviewState, GitRepository, GitTreeItem, NumberedPageInput, Organization, SetAccountInput, SetLabelInput, SetMilestoneInput, SetPullRequestInput } from '../../types/exportedTypes/gitProvider';
2
2
  import { FetchIssuesData, FetchPullRequestsData, GitHubIssueCloseReason } from '../../types/exportedTypes/github';
3
3
  import { Issue, SetIssueInput } from '../../types/exportedTypes/issueProvider';
4
4
  import { GitProvider } from '../gitProvider';
@@ -349,6 +349,16 @@ export declare class GitHub extends EnterpriseProvider implements GitProvider, I
349
349
  url: string;
350
350
  }[];
351
351
  }>;
352
+ getCommentsForPullRequest(input: {
353
+ repo: GetRepoInput;
354
+ pullRequestNumber: number;
355
+ } & CursorPageInput, options?: EnterpriseOptions): Promise<{
356
+ data: GitComment[];
357
+ pageInfo: {
358
+ endCursor: string | null;
359
+ hasNextPage: boolean;
360
+ };
361
+ }>;
352
362
  /**
353
363
  * Returns issues that were created by or are assigned to the user.
354
364
  */
@@ -1,5 +1,6 @@
1
- import { Account, EnterpriseOptions, GitDiffLineType } from '../../types/exportedTypes/gitProvider';
1
+ import { Account, EnterpriseOptions, GitComment, GitDiffLineType } from '../../types/exportedTypes/gitProvider';
2
2
  import { FieldMap, GraphQLBody, GraphQLError, GraphQLResponse, ProviderConfig } from '../../types/exportedTypes/types';
3
+ import { GraphQLBot, GraphQLEnterpriseUserAccount, GraphQLUser } from '../../types/internalTypes/github';
3
4
  export declare const minimumFeatureVersions: {
4
5
  AS_CODE_OWNER: number[];
5
6
  CHECK_RUN: number[];
@@ -13,6 +14,7 @@ export declare const minimumFeatureVersions: {
13
14
  export declare const MAX_PR_PAGE_SIZE = 15;
14
15
  export declare const MAX_ISSUE_PAGE_SIZE = 100;
15
16
  type MinimumFeatureVersions = typeof minimumFeatureVersions;
17
+ export declare const GHOST_AUTHOR: GraphQLUser;
16
18
  export declare const isNotNull: <T>(item: T | null) => item is T;
17
19
  export declare const doesEnterpriseSupportFeature: (enterpriseVersion: [number, number, number], feature: keyof MinimumFeatureVersions) => boolean;
18
20
  export declare const GITHUB_API_URL = "https://api.github.com";
@@ -44,4 +46,15 @@ export declare const getDiffLinesFromDiffHunk: (diffHunk: string, originalLine:
44
46
  newLineNumber: number | null;
45
47
  type: GitDiffLineType;
46
48
  }[];
49
+ interface GraphQLIssueComment {
50
+ id: string;
51
+ databaseId?: number;
52
+ fullDatabaseId?: string;
53
+ author: (GraphQLUser | GraphQLBot | GraphQLEnterpriseUserAccount) | null;
54
+ body: string;
55
+ createdAt?: string;
56
+ publishedAt?: string;
57
+ url: string;
58
+ }
59
+ export declare const normalizeIssueComment: (comment: GraphQLIssueComment) => GitComment;
47
60
  export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * GitHub GraphQL Queries
3
+ *
4
+ * This file contains all GraphQL query strings used by the GitHub provider.
5
+ * Queries are organized alphabetically for easy reference.
6
+ */
7
+ export declare const GET_PULL_REQUEST_COMMENTS: (supportsFullDatabaseId: boolean) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitkraken/provider-apis",
3
- "version": "0.36.0",
3
+ "version": "0.37.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",