@gitkraken/provider-apis 0.31.0 → 0.33.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 +10 -0
- package/dist/index.js +188 -131
- package/dist/index.provider-utils.js +1 -1
- package/dist/index.providers.js +226 -169
- package/dist/providers/gitProvider.d.ts +6 -1
- package/dist/providers/github/github.d.ts +8 -1
- package/dist/types/exportedTypes/gitProvider.d.ts +12 -0
- package/dist/types/internalTypes/github.d.ts +4 -0
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Account, 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, 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>>;
|
|
@@ -86,5 +86,10 @@ export interface GitProvider {
|
|
|
86
86
|
pullRequest: SetPullRequestInput;
|
|
87
87
|
comment: string;
|
|
88
88
|
}, options: Options): Promise<void>;
|
|
89
|
+
addCommentToPullRequest?(input: {
|
|
90
|
+
pullRequest: SetPullRequestInput;
|
|
91
|
+
comment: string;
|
|
92
|
+
}, options: Options): Promise<void>;
|
|
93
|
+
addInlineCommentToPullRequest?(input: AddInlineCommentInput, options: Options): Promise<string | undefined>;
|
|
89
94
|
}
|
|
90
95
|
export declare const MAX_PAGE_SIZE = 100;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Account, CreateCommitInput, CursorPageInput, 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, EnterpriseOptions, GetRepoErrorData, GetRepoInput, 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';
|
|
@@ -287,6 +287,13 @@ export declare class GitHub extends EnterpriseProvider implements GitProvider, I
|
|
|
287
287
|
pullRequest: SetPullRequestInput;
|
|
288
288
|
comment: string;
|
|
289
289
|
}, options?: EnterpriseOptions): Promise<void>;
|
|
290
|
+
addCommentToPullRequest(input: {
|
|
291
|
+
pullRequest: SetPullRequestInput;
|
|
292
|
+
comment: string;
|
|
293
|
+
}, options?: EnterpriseOptions): Promise<void>;
|
|
294
|
+
addInlineCommentToPullRequest(input: AddInlineCommentInput, options?: EnterpriseOptions): Promise<string | undefined>;
|
|
295
|
+
private addReplyToReviewThread;
|
|
296
|
+
private createReviewThread;
|
|
290
297
|
setPullRequestMilestone(input: {
|
|
291
298
|
pullRequest: SetPullRequestInput;
|
|
292
299
|
milestone: SetMilestoneInput | null;
|
|
@@ -157,6 +157,7 @@ export interface GitPullRequest {
|
|
|
157
157
|
graphQLId?: string;
|
|
158
158
|
number: number;
|
|
159
159
|
title: string;
|
|
160
|
+
description: string | null;
|
|
160
161
|
url: string | null;
|
|
161
162
|
state: GitPullRequestState;
|
|
162
163
|
isDraft: boolean;
|
|
@@ -233,6 +234,9 @@ export interface GitPullRequestReviewComment extends GitComment {
|
|
|
233
234
|
replies: GitComment[];
|
|
234
235
|
isOutdated: boolean;
|
|
235
236
|
isResolved: boolean;
|
|
237
|
+
line: number | null;
|
|
238
|
+
startLine: number | null;
|
|
239
|
+
side: 'LEFT' | 'RIGHT' | null;
|
|
236
240
|
}
|
|
237
241
|
export interface GitPullRequestReview extends GitComment {
|
|
238
242
|
reviewComments: GitPullRequestReviewComment[];
|
|
@@ -294,6 +298,14 @@ export interface SetLabelInput {
|
|
|
294
298
|
graphQLId?: string;
|
|
295
299
|
name: string;
|
|
296
300
|
}
|
|
301
|
+
export interface AddInlineCommentInput {
|
|
302
|
+
pullRequest: SetPullRequestInput;
|
|
303
|
+
comment: string;
|
|
304
|
+
path: string;
|
|
305
|
+
line: number;
|
|
306
|
+
side?: 'LEFT' | 'RIGHT';
|
|
307
|
+
threadId?: string;
|
|
308
|
+
}
|
|
297
309
|
export interface CursorPageInput {
|
|
298
310
|
cursor?: string | null;
|
|
299
311
|
}
|
|
@@ -163,6 +163,7 @@ export type GraphQLLatestReviewAuthorType = GraphQLUser | GraphQLEnterpriseUserA
|
|
|
163
163
|
export type GraphQLPullRequest = (GraphQLObjectWithDatabaseId | GraphQLObjectWithFullDatabaseId) & {
|
|
164
164
|
id: string;
|
|
165
165
|
title: string;
|
|
166
|
+
body: string;
|
|
166
167
|
number: number;
|
|
167
168
|
state: PullRequestState;
|
|
168
169
|
comments: {
|
|
@@ -298,6 +299,9 @@ export interface GraphQLReviewThread {
|
|
|
298
299
|
};
|
|
299
300
|
isOutdated: boolean;
|
|
300
301
|
isResolved: boolean;
|
|
302
|
+
line: number | null;
|
|
303
|
+
startLine: number | null;
|
|
304
|
+
diffSide: 'LEFT' | 'RIGHT' | null;
|
|
301
305
|
originalLine: number | null;
|
|
302
306
|
originalStartLine: number | null;
|
|
303
307
|
startDiffSide: 'LEFT' | 'RIGHT' | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitkraken/provider-apis",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.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",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"prettier:ci": "prettier --check src test",
|
|
31
31
|
"test": "yarn test:unit && yarn test:integration",
|
|
32
32
|
"test:unit": "mocha --require ts-node/register 'test/unit/**/*.ts'",
|
|
33
|
-
"test:integration": "mocha --require ts-node/register 'test/integration/**/*.ts'",
|
|
33
|
+
"test:integration": "mocha --require ts-node/register 'test/integration/**/*.ts' --timeout 5000",
|
|
34
34
|
"update-licenses": "node ./scripts/generateLicenses.mjs",
|
|
35
35
|
"watch": "yarn clean && node ./scripts/build.mjs --watch & tsc -w"
|
|
36
36
|
},
|