@gitkraken/provider-apis 0.42.0 → 0.44.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 +15 -0
- package/dist/index.js +211 -210
- package/dist/index.providers.js +213 -212
- package/dist/providers/azureDevops/azureDevOps.d.ts +36 -1
- package/dist/types/internalTypes/azureDevOps.d.ts +71 -0
- package/package.json +3 -1
|
@@ -1,11 +1,16 @@
|
|
|
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, GitPullRequestReview, 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 cachedUserIds;
|
|
10
|
+
private inflightUserIds;
|
|
11
|
+
private getCurrentUserId;
|
|
12
|
+
private fetchCurrentUserId;
|
|
13
|
+
private getRepoApiUrl;
|
|
9
14
|
/** Note: PATs are not supported for this function, only OAuth tokens are. */
|
|
10
15
|
getCurrentUser(input?: Record<string, never>, options?: EnterpriseOptions): Promise<{
|
|
11
16
|
data: {
|
|
@@ -332,4 +337,34 @@ export declare class AzureDevOps extends EnterpriseProvider implements GitProvid
|
|
|
332
337
|
url: string;
|
|
333
338
|
}[];
|
|
334
339
|
}>;
|
|
340
|
+
getPullRequestForRepo(input: GetPRForRepoInput, options?: EnterpriseOptions): Promise<Result<GitPullRequest | null>>;
|
|
341
|
+
getMergeBase(input: GetMergeBaseInput, options?: EnterpriseOptions): Promise<Result<string>>;
|
|
342
|
+
getFileContents(input: {
|
|
343
|
+
repo: GetRepoInput;
|
|
344
|
+
path: string;
|
|
345
|
+
ref: string;
|
|
346
|
+
}, options?: EnterpriseOptions): Promise<Result<Blob>>;
|
|
347
|
+
getPullRequestDiff(input: {
|
|
348
|
+
repo: GetRepoInput;
|
|
349
|
+
pullRequestId: number;
|
|
350
|
+
}, options?: EnterpriseOptions): Promise<string>;
|
|
351
|
+
private getPullRequestWriteHeaders;
|
|
352
|
+
private setReviewerVote;
|
|
353
|
+
private postPullRequestThread;
|
|
354
|
+
approvePullRequest(input: {
|
|
355
|
+
pullRequest: SetPullRequestInput;
|
|
356
|
+
comment?: string;
|
|
357
|
+
}, options?: EnterpriseOptions): Promise<void>;
|
|
358
|
+
requestPullRequestChanges(input: {
|
|
359
|
+
pullRequest: SetPullRequestInput;
|
|
360
|
+
comment: string;
|
|
361
|
+
}, options?: EnterpriseOptions): Promise<void>;
|
|
362
|
+
commentOnPullRequest(input: {
|
|
363
|
+
pullRequest: SetPullRequestInput;
|
|
364
|
+
comment: string;
|
|
365
|
+
}, options?: EnterpriseOptions): Promise<void>;
|
|
366
|
+
getReviewsForPullRequest(input: {
|
|
367
|
+
repo: GetRepoInput;
|
|
368
|
+
pullRequestId: number;
|
|
369
|
+
}, options?: EnterpriseOptions): Promise<Result<GitPullRequestReview[]>>;
|
|
335
370
|
}
|
|
@@ -191,4 +191,75 @@ 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 declare enum AzureCommentType {
|
|
224
|
+
Text = 1,
|
|
225
|
+
CodeChange = 2,
|
|
226
|
+
System = 3
|
|
227
|
+
}
|
|
228
|
+
export interface AzureComment {
|
|
229
|
+
id: number;
|
|
230
|
+
parentCommentId: number;
|
|
231
|
+
author: AzureUser;
|
|
232
|
+
content: string;
|
|
233
|
+
publishedDate: string;
|
|
234
|
+
lastUpdatedDate: string;
|
|
235
|
+
commentType: 'text' | 'codeChange' | 'system' | 'unknown';
|
|
236
|
+
isDeleted: boolean;
|
|
237
|
+
}
|
|
238
|
+
export interface AzureCommentThread {
|
|
239
|
+
id: number;
|
|
240
|
+
publishedDate: string;
|
|
241
|
+
lastUpdatedDate: string;
|
|
242
|
+
comments: AzureComment[];
|
|
243
|
+
threadContext?: {
|
|
244
|
+
filePath: string;
|
|
245
|
+
rightFileStart?: {
|
|
246
|
+
line: number;
|
|
247
|
+
offset: number;
|
|
248
|
+
};
|
|
249
|
+
rightFileEnd?: {
|
|
250
|
+
line: number;
|
|
251
|
+
offset: number;
|
|
252
|
+
};
|
|
253
|
+
leftFileStart?: {
|
|
254
|
+
line: number;
|
|
255
|
+
offset: number;
|
|
256
|
+
};
|
|
257
|
+
leftFileEnd?: {
|
|
258
|
+
line: number;
|
|
259
|
+
offset: number;
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
status: AzureThreadStatus;
|
|
263
|
+
isDeleted: boolean;
|
|
264
|
+
}
|
|
194
265
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitkraken/provider-apis",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.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",
|