@gitkraken/provider-apis 0.35.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.
- package/CHANGELOG.md +8 -0
- package/dist/index.js +162 -103
- package/dist/index.provider-utils.js +1 -1
- package/dist/index.providers.js +157 -98
- package/dist/providers/gitProvider.d.ts +5 -1
- package/dist/providers/github/github.d.ts +12 -1
- package/dist/providers/github/githubHelpers.d.ts +14 -1
- package/dist/providers/github/githubMutations.d.ts +1 -0
- package/dist/providers/github/githubQueries.d.ts +7 -0
- package/dist/types/exportedTypes/gitProvider.d.ts +4 -0
- package/package.json +1 -1
|
@@ -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, 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';
|
|
@@ -293,6 +293,7 @@ export declare class GitHub extends EnterpriseProvider implements GitProvider, I
|
|
|
293
293
|
}, options?: EnterpriseOptions): Promise<void>;
|
|
294
294
|
addInlineCommentToPullRequest(input: AddInlineCommentInput, options?: EnterpriseOptions): Promise<string | undefined>;
|
|
295
295
|
deleteInlineComment(input: DeleteInlineCommentInput, options?: EnterpriseOptions): Promise<void>;
|
|
296
|
+
editInlineComment(input: EditInlineCommentInput, options?: EnterpriseOptions): Promise<void>;
|
|
296
297
|
private addReplyToReviewThread;
|
|
297
298
|
private createReviewThread;
|
|
298
299
|
setPullRequestMilestone(input: {
|
|
@@ -348,6 +349,16 @@ export declare class GitHub extends EnterpriseProvider implements GitProvider, I
|
|
|
348
349
|
url: string;
|
|
349
350
|
}[];
|
|
350
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
|
+
}>;
|
|
351
362
|
/**
|
|
352
363
|
* Returns issues that were created by or are assigned to the user.
|
|
353
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 {};
|
|
@@ -5,3 +5,4 @@
|
|
|
5
5
|
* Mutations are organized alphabetically for easy reference.
|
|
6
6
|
*/
|
|
7
7
|
export declare const DELETE_PULL_REQUEST_REVIEW_COMMENT = "mutation DeletePullRequestReviewComment(\n $pullRequestReviewCommentId: ID!\n) {\n deletePullRequestReviewComment(input: {\n id: $pullRequestReviewCommentId\n }) {\n pullRequestReview {\n id\n }\n }\n}";
|
|
8
|
+
export declare const UPDATE_PULL_REQUEST_REVIEW_COMMENT = "mutation UpdatePullRequestReviewComment(\n $pullRequestReviewCommentId: ID!,\n $body: String!\n) {\n updatePullRequestReviewComment(input: {\n pullRequestReviewCommentId: $pullRequestReviewCommentId,\n body: $body\n }) {\n pullRequestReviewComment {\n id\n body\n }\n }\n}";
|
|
@@ -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;
|
|
@@ -310,6 +310,10 @@ export interface AddInlineCommentInput {
|
|
|
310
310
|
export interface DeleteInlineCommentInput {
|
|
311
311
|
commentId: string;
|
|
312
312
|
}
|
|
313
|
+
export interface EditInlineCommentInput {
|
|
314
|
+
commentId: string;
|
|
315
|
+
body: string;
|
|
316
|
+
}
|
|
313
317
|
export interface CursorPageInput {
|
|
314
318
|
cursor?: string | null;
|
|
315
319
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitkraken/provider-apis",
|
|
3
|
-
"version": "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",
|