@gitkraken/provider-apis 0.32.0 → 0.34.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, 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;
@@ -234,6 +234,10 @@ export interface GitPullRequestReviewComment extends GitComment {
234
234
  replies: GitComment[];
235
235
  isOutdated: boolean;
236
236
  isResolved: boolean;
237
+ line: number | null;
238
+ startLine: number | null;
239
+ side: 'LEFT' | 'RIGHT' | null;
240
+ threadId?: string;
237
241
  }
238
242
  export interface GitPullRequestReview extends GitComment {
239
243
  reviewComments: GitPullRequestReviewComment[];
@@ -295,6 +299,14 @@ export interface SetLabelInput {
295
299
  graphQLId?: string;
296
300
  name: string;
297
301
  }
302
+ export interface AddInlineCommentInput {
303
+ pullRequest: SetPullRequestInput;
304
+ comment: string;
305
+ path: string;
306
+ line: number;
307
+ side?: 'LEFT' | 'RIGHT';
308
+ threadId?: string;
309
+ }
298
310
  export interface CursorPageInput {
299
311
  cursor?: string | null;
300
312
  }
@@ -294,11 +294,15 @@ export interface GraphQLMilestone {
294
294
  url: string;
295
295
  }
296
296
  export interface GraphQLReviewThread {
297
+ id: string;
297
298
  comments: {
298
299
  nodes: (GraphQLReviewComment | null)[] | null;
299
300
  };
300
301
  isOutdated: boolean;
301
302
  isResolved: boolean;
303
+ line: number | null;
304
+ startLine: number | null;
305
+ diffSide: 'LEFT' | 'RIGHT' | null;
302
306
  originalLine: number | null;
303
307
  originalStartLine: number | null;
304
308
  startDiffSide: 'LEFT' | 'RIGHT' | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitkraken/provider-apis",
3
- "version": "0.32.0",
3
+ "version": "0.34.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
  },