@gitkraken/provider-apis 0.41.0 → 0.43.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,11 +1,12 @@
1
1
  import { AzureGetRepoInput, AzureGetReposInput, AzureGraphAccount, AzureOrganization, AzureProject, AzureSetAccountInput, AzureSetIssueInput, AzureSetPullRequestInput, PullRequestAsyncStatus, StatusByWorkItemIdByStatusId, WorkItemType } from '../../types/exportedTypes/azureDevOps';
2
- import { CursorPageInput, EnterpriseOptions, GetRepoErrorData, GetRepoInput, GetReposInput, GitMergeStrategy, GitPullRequest, GitRepository, GitRepositoryPermissions, NumberedPageInput, SetAccountInput, SetLabelInput, SetPullRequestInput } from '../../types/exportedTypes/gitProvider';
2
+ import { CursorPageInput, EnterpriseOptions, GetMergeBaseInput, GetPRForRepoInput, GetRepoErrorData, GetRepoInput, GetReposInput, GitMergeStrategy, GitPullRequest, GitRepository, GitRepositoryPermissions, NumberedPageInput, SetAccountInput, SetLabelInput, SetPullRequestInput } from '../../types/exportedTypes/gitProvider';
3
3
  import { Issue, SetStatusInput } from '../../types/exportedTypes/issueProvider';
4
4
  import { PagedResult, Result } from '../../types/exportedTypes/types';
5
5
  import { GitProvider } from '../gitProvider';
6
6
  import { IssueProvider } from '../issueProvider';
7
7
  import { EnterpriseProvider } from '../provider';
8
8
  export declare class AzureDevOps extends EnterpriseProvider implements GitProvider, IssueProvider {
9
+ private getRepoApiUrl;
9
10
  /** Note: PATs are not supported for this function, only OAuth tokens are. */
10
11
  getCurrentUser(input?: Record<string, never>, options?: EnterpriseOptions): Promise<{
11
12
  data: {
@@ -332,4 +333,15 @@ export declare class AzureDevOps extends EnterpriseProvider implements GitProvid
332
333
  url: string;
333
334
  }[];
334
335
  }>;
336
+ getPullRequestForRepo(input: GetPRForRepoInput, options?: EnterpriseOptions): Promise<Result<GitPullRequest | null>>;
337
+ getMergeBase(input: GetMergeBaseInput, options?: EnterpriseOptions): Promise<Result<string>>;
338
+ getFileContents(input: {
339
+ repo: GetRepoInput;
340
+ path: string;
341
+ ref: string;
342
+ }, options?: EnterpriseOptions): Promise<Result<Blob>>;
343
+ getPullRequestDiff(input: {
344
+ repo: GetRepoInput;
345
+ pullRequestId: number;
346
+ }, options?: EnterpriseOptions): Promise<string>;
335
347
  }
@@ -191,4 +191,70 @@ export interface AzureIssue {
191
191
  export interface UpdatePullRequestResponse {
192
192
  status: string;
193
193
  }
194
+ export interface AzureIteration {
195
+ id: number;
196
+ sourceRefCommit: {
197
+ commitId: string;
198
+ };
199
+ targetRefCommit: {
200
+ commitId: string;
201
+ };
202
+ commonRefCommit: {
203
+ commitId: string;
204
+ };
205
+ }
206
+ export interface AzureIterationChange {
207
+ changeId: number;
208
+ item: {
209
+ path: string;
210
+ originalPath?: string;
211
+ };
212
+ changeType: number;
213
+ }
214
+ export declare enum AzureThreadStatus {
215
+ Unknown = 0,
216
+ Active = 1,
217
+ Fixed = 2,
218
+ WontFix = 3,
219
+ Closed = 4,
220
+ ByDesign = 5,
221
+ Pending = 6
222
+ }
223
+ export interface AzureComment {
224
+ id: number;
225
+ parentCommentId: number;
226
+ author: AzureUser;
227
+ content: string;
228
+ publishedDate: string;
229
+ lastUpdatedDate: string;
230
+ commentType: 'text' | 'codeChange' | 'system' | 'unknown';
231
+ isDeleted: boolean;
232
+ }
233
+ export interface AzureCommentThread {
234
+ id: number;
235
+ publishedDate: string;
236
+ lastUpdatedDate: string;
237
+ comments: AzureComment[];
238
+ threadContext?: {
239
+ filePath: string;
240
+ rightFileStart?: {
241
+ line: number;
242
+ offset: number;
243
+ };
244
+ rightFileEnd?: {
245
+ line: number;
246
+ offset: number;
247
+ };
248
+ leftFileStart?: {
249
+ line: number;
250
+ offset: number;
251
+ };
252
+ leftFileEnd?: {
253
+ line: number;
254
+ offset: number;
255
+ };
256
+ };
257
+ status: AzureThreadStatus;
258
+ isDeleted: boolean;
259
+ }
194
260
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitkraken/provider-apis",
3
- "version": "0.41.0",
3
+ "version": "0.43.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",
@@ -36,11 +36,13 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@linear/sdk": "58.1.0",
39
+ "diff": "^8.0.4",
39
40
  "js-base64": "3.7.5"
40
41
  },
41
42
  "devDependencies": {
42
43
  "@eslint/js": "^9.39.1",
43
44
  "@types/chai": "^4.3.5",
45
+ "@types/diff": "^7.0.2",
44
46
  "@types/mocha": "^10.0.1",
45
47
  "@types/node": "^20.0.0",
46
48
  "@types/sinon": "^10.0.15",