1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
12 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
13 | return new (P || (P = Promise))(function (resolve, reject) {
|
14 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
15 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
16 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
17 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
18 | });
|
19 | };
|
20 | Object.defineProperty(exports, "__esModule", { value: true });
|
21 | exports.GitApi = void 0;
|
22 | const basem = require("./ClientApiBases");
|
23 | const GitInterfaces = require("./interfaces/GitInterfaces");
|
24 | class GitApi extends basem.ClientApiBase {
|
25 | constructor(baseUrl, handlers, options) {
|
26 | super(baseUrl, handlers, 'node-Git-api', options);
|
27 | }
|
28 | |
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 | deleteEnablementStatus(allProjects, includeBillableCommitters, projectIds) {
|
36 | return __awaiter(this, void 0, void 0, function* () {
|
37 | if (allProjects == null) {
|
38 | throw new TypeError('allProjects can not be null or undefined');
|
39 | }
|
40 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
41 | let routeValues = {};
|
42 | let queryValues = {
|
43 | '$allProjects': allProjects,
|
44 | '$includeBillableCommitters': includeBillableCommitters,
|
45 | projectIds: projectIds,
|
46 | };
|
47 | try {
|
48 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "b43dd56f-a1b4-47a5-a857-73fc1b6c700c", routeValues, queryValues);
|
49 | let url = verData.requestUrl;
|
50 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
51 | let res;
|
52 | res = yield this.rest.del(url, options);
|
53 | let ret = this.formatResponse(res.result, null, false);
|
54 | resolve(ret);
|
55 | }
|
56 | catch (err) {
|
57 | reject(err);
|
58 | }
|
59 | }));
|
60 | });
|
61 | }
|
62 | |
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 | getEnablementStatus(projectIds, billingDate, skip, take) {
|
71 | return __awaiter(this, void 0, void 0, function* () {
|
72 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
73 | let routeValues = {};
|
74 | let queryValues = {
|
75 | projectIds: projectIds,
|
76 | '$billingDate': billingDate,
|
77 | '$skip': skip,
|
78 | '$take': take,
|
79 | };
|
80 | try {
|
81 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "b43dd56f-a1b4-47a5-a857-73fc1b6c700c", routeValues, queryValues);
|
82 | let url = verData.requestUrl;
|
83 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
84 | let res;
|
85 | res = yield this.rest.get(url, options);
|
86 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.AdvSecEnablementStatus, true);
|
87 | resolve(ret);
|
88 | }
|
89 | catch (err) {
|
90 | reject(err);
|
91 | }
|
92 | }));
|
93 | });
|
94 | }
|
95 | |
96 |
|
97 |
|
98 | getEnableOnCreateHost(enableOnCreateHost) {
|
99 | return __awaiter(this, void 0, void 0, function* () {
|
100 | if (enableOnCreateHost == null) {
|
101 | throw new TypeError('enableOnCreateHost can not be null or undefined');
|
102 | }
|
103 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
104 | let routeValues = {};
|
105 | let queryValues = {
|
106 | '$enableOnCreateHost': enableOnCreateHost,
|
107 | };
|
108 | try {
|
109 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "b43dd56f-a1b4-47a5-a857-73fc1b6c700c", routeValues, queryValues);
|
110 | let url = verData.requestUrl;
|
111 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
112 | let res;
|
113 | res = yield this.rest.get(url, options);
|
114 | let ret = this.formatResponse(res.result, null, false);
|
115 | resolve(ret);
|
116 | }
|
117 | catch (err) {
|
118 | reject(err);
|
119 | }
|
120 | }));
|
121 | });
|
122 | }
|
123 | |
124 |
|
125 |
|
126 | getEnableOnCreateProject(enableOnCreateProjectId) {
|
127 | return __awaiter(this, void 0, void 0, function* () {
|
128 | if (enableOnCreateProjectId == null) {
|
129 | throw new TypeError('enableOnCreateProjectId can not be null or undefined');
|
130 | }
|
131 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
132 | let routeValues = {};
|
133 | let queryValues = {
|
134 | '$enableOnCreateProjectId': enableOnCreateProjectId,
|
135 | };
|
136 | try {
|
137 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "b43dd56f-a1b4-47a5-a857-73fc1b6c700c", routeValues, queryValues);
|
138 | let url = verData.requestUrl;
|
139 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
140 | let res;
|
141 | res = yield this.rest.get(url, options);
|
142 | let ret = this.formatResponse(res.result, null, false);
|
143 | resolve(ret);
|
144 | }
|
145 | catch (err) {
|
146 | reject(err);
|
147 | }
|
148 | }));
|
149 | });
|
150 | }
|
151 | |
152 |
|
153 |
|
154 | setEnableOnCreateHost(enableOnCreateHost) {
|
155 | return __awaiter(this, void 0, void 0, function* () {
|
156 | if (enableOnCreateHost == null) {
|
157 | throw new TypeError('enableOnCreateHost can not be null or undefined');
|
158 | }
|
159 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
160 | let routeValues = {};
|
161 | let queryValues = {
|
162 | '$enableOnCreateHost': enableOnCreateHost,
|
163 | };
|
164 | try {
|
165 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "b43dd56f-a1b4-47a5-a857-73fc1b6c700c", routeValues, queryValues);
|
166 | let url = verData.requestUrl;
|
167 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
168 | let res;
|
169 | res = yield this.rest.replace(url, null, options);
|
170 | let ret = this.formatResponse(res.result, null, false);
|
171 | resolve(ret);
|
172 | }
|
173 | catch (err) {
|
174 | reject(err);
|
175 | }
|
176 | }));
|
177 | });
|
178 | }
|
179 | |
180 |
|
181 |
|
182 |
|
183 | setEnableOnCreateProject(enableOnCreateProjectId, enableOnStatus) {
|
184 | return __awaiter(this, void 0, void 0, function* () {
|
185 | if (enableOnCreateProjectId == null) {
|
186 | throw new TypeError('enableOnCreateProjectId can not be null or undefined');
|
187 | }
|
188 | if (enableOnStatus == null) {
|
189 | throw new TypeError('enableOnStatus can not be null or undefined');
|
190 | }
|
191 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
192 | let routeValues = {};
|
193 | let queryValues = {
|
194 | '$enableOnCreateProjectId': enableOnCreateProjectId,
|
195 | '$enableOnStatus': enableOnStatus,
|
196 | };
|
197 | try {
|
198 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "b43dd56f-a1b4-47a5-a857-73fc1b6c700c", routeValues, queryValues);
|
199 | let url = verData.requestUrl;
|
200 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
201 | let res;
|
202 | res = yield this.rest.replace(url, null, options);
|
203 | let ret = this.formatResponse(res.result, null, false);
|
204 | resolve(ret);
|
205 | }
|
206 | catch (err) {
|
207 | reject(err);
|
208 | }
|
209 | }));
|
210 | });
|
211 | }
|
212 | |
213 |
|
214 |
|
215 |
|
216 |
|
217 | updateEnablementStatus(enablementUpdates) {
|
218 | return __awaiter(this, void 0, void 0, function* () {
|
219 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
220 | let routeValues = {};
|
221 | try {
|
222 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "b43dd56f-a1b4-47a5-a857-73fc1b6c700c", routeValues);
|
223 | let url = verData.requestUrl;
|
224 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
225 | let res;
|
226 | res = yield this.rest.create(url, enablementUpdates, options);
|
227 | let ret = this.formatResponse(res.result, null, false);
|
228 | resolve(ret);
|
229 | }
|
230 | catch (err) {
|
231 | reject(err);
|
232 | }
|
233 | }));
|
234 | });
|
235 | }
|
236 | |
237 |
|
238 |
|
239 |
|
240 | getEstimatedBillablePushersOrg() {
|
241 | return __awaiter(this, void 0, void 0, function* () {
|
242 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
243 | let routeValues = {};
|
244 | try {
|
245 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "2277ffbe-28d4-40d6-9c26-40baf26d1408", routeValues);
|
246 | let url = verData.requestUrl;
|
247 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
248 | let res;
|
249 | res = yield this.rest.get(url, options);
|
250 | let ret = this.formatResponse(res.result, null, true);
|
251 | resolve(ret);
|
252 | }
|
253 | catch (err) {
|
254 | reject(err);
|
255 | }
|
256 | }));
|
257 | });
|
258 | }
|
259 | |
260 |
|
261 |
|
262 |
|
263 |
|
264 | getEstimatedBillablePushersProject(project) {
|
265 | return __awaiter(this, void 0, void 0, function* () {
|
266 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
267 | let routeValues = {
|
268 | project: project
|
269 | };
|
270 | try {
|
271 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "1df7833e-1eed-447b-81a3-390c74923900", routeValues);
|
272 | let url = verData.requestUrl;
|
273 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
274 | let res;
|
275 | res = yield this.rest.get(url, options);
|
276 | let ret = this.formatResponse(res.result, null, true);
|
277 | resolve(ret);
|
278 | }
|
279 | catch (err) {
|
280 | reject(err);
|
281 | }
|
282 | }));
|
283 | });
|
284 | }
|
285 | |
286 |
|
287 |
|
288 |
|
289 |
|
290 |
|
291 | getEstimatedBillableCommittersRepo(project, repositoryId) {
|
292 | return __awaiter(this, void 0, void 0, function* () {
|
293 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
294 | let routeValues = {
|
295 | project: project,
|
296 | repositoryId: repositoryId
|
297 | };
|
298 | try {
|
299 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "5dcec07b-a844-4efb-9fc1-968fd1f149db", routeValues);
|
300 | let url = verData.requestUrl;
|
301 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
302 | let res;
|
303 | res = yield this.rest.get(url, options);
|
304 | let ret = this.formatResponse(res.result, null, true);
|
305 | resolve(ret);
|
306 | }
|
307 | catch (err) {
|
308 | reject(err);
|
309 | }
|
310 | }));
|
311 | });
|
312 | }
|
313 | |
314 |
|
315 |
|
316 |
|
317 |
|
318 |
|
319 |
|
320 | getPermission(projectName, repositoryId, permission) {
|
321 | return __awaiter(this, void 0, void 0, function* () {
|
322 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
323 | let routeValues = {};
|
324 | let queryValues = {
|
325 | '$projectName': projectName,
|
326 | '$repositoryId': repositoryId,
|
327 | '$permission': permission,
|
328 | };
|
329 | try {
|
330 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "61b21a05-a60f-4910-a733-ba5347c2142d", routeValues, queryValues);
|
331 | let url = verData.requestUrl;
|
332 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
333 | let res;
|
334 | res = yield this.rest.get(url, options);
|
335 | let ret = this.formatResponse(res.result, null, false);
|
336 | resolve(ret);
|
337 | }
|
338 | catch (err) {
|
339 | reject(err);
|
340 | }
|
341 | }));
|
342 | });
|
343 | }
|
344 | |
345 |
|
346 |
|
347 |
|
348 |
|
349 |
|
350 |
|
351 | createAnnotatedTag(tagObject, project, repositoryId) {
|
352 | return __awaiter(this, void 0, void 0, function* () {
|
353 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
354 | let routeValues = {
|
355 | project: project,
|
356 | repositoryId: repositoryId
|
357 | };
|
358 | try {
|
359 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "5e8a8081-3851-4626-b677-9891cc04102e", routeValues);
|
360 | let url = verData.requestUrl;
|
361 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
362 | let res;
|
363 | res = yield this.rest.create(url, tagObject, options);
|
364 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitAnnotatedTag, false);
|
365 | resolve(ret);
|
366 | }
|
367 | catch (err) {
|
368 | reject(err);
|
369 | }
|
370 | }));
|
371 | });
|
372 | }
|
373 | |
374 |
|
375 |
|
376 |
|
377 |
|
378 |
|
379 |
|
380 | getAnnotatedTag(project, repositoryId, objectId) {
|
381 | return __awaiter(this, void 0, void 0, function* () {
|
382 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
383 | let routeValues = {
|
384 | project: project,
|
385 | repositoryId: repositoryId,
|
386 | objectId: objectId
|
387 | };
|
388 | try {
|
389 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "5e8a8081-3851-4626-b677-9891cc04102e", routeValues);
|
390 | let url = verData.requestUrl;
|
391 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
392 | let res;
|
393 | res = yield this.rest.get(url, options);
|
394 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitAnnotatedTag, false);
|
395 | resolve(ret);
|
396 | }
|
397 | catch (err) {
|
398 | reject(err);
|
399 | }
|
400 | }));
|
401 | });
|
402 | }
|
403 | |
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 |
|
410 |
|
411 | getBillableCommitters(project, billingDate, skip, take) {
|
412 | return __awaiter(this, void 0, void 0, function* () {
|
413 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
414 | let routeValues = {
|
415 | project: project
|
416 | };
|
417 | let queryValues = {
|
418 | '$billingDate': billingDate,
|
419 | '$skip': skip,
|
420 | '$take': take,
|
421 | };
|
422 | try {
|
423 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "5c5e3ebc-37b0-4547-a957-945912d44922", routeValues, queryValues);
|
424 | let url = verData.requestUrl;
|
425 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
426 | let res;
|
427 | res = yield this.rest.get(url, options);
|
428 | let ret = this.formatResponse(res.result, null, true);
|
429 | resolve(ret);
|
430 | }
|
431 | catch (err) {
|
432 | reject(err);
|
433 | }
|
434 | }));
|
435 | });
|
436 | }
|
437 | |
438 |
|
439 |
|
440 |
|
441 |
|
442 |
|
443 |
|
444 | getBillableCommittersDetail(project, includeDetails, billingDate) {
|
445 | return __awaiter(this, void 0, void 0, function* () {
|
446 | if (includeDetails == null) {
|
447 | throw new TypeError('includeDetails can not be null or undefined');
|
448 | }
|
449 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
450 | let routeValues = {
|
451 | project: project
|
452 | };
|
453 | let queryValues = {
|
454 | '$includeDetails': includeDetails,
|
455 | '$billingDate': billingDate,
|
456 | };
|
457 | try {
|
458 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "5c5e3ebc-37b0-4547-a957-945912d44922", routeValues, queryValues);
|
459 | let url = verData.requestUrl;
|
460 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
461 | let res;
|
462 | res = yield this.rest.get(url, options);
|
463 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.BillableCommitterDetail, true);
|
464 | resolve(ret);
|
465 | }
|
466 | catch (err) {
|
467 | reject(err);
|
468 | }
|
469 | }));
|
470 | });
|
471 | }
|
472 | |
473 |
|
474 |
|
475 |
|
476 |
|
477 |
|
478 |
|
479 |
|
480 |
|
481 |
|
482 | getBlob(repositoryId, sha1, project, download, fileName, resolveLfs) {
|
483 | return __awaiter(this, void 0, void 0, function* () {
|
484 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
485 | let routeValues = {
|
486 | project: project,
|
487 | repositoryId: repositoryId,
|
488 | sha1: sha1
|
489 | };
|
490 | let queryValues = {
|
491 | download: download,
|
492 | fileName: fileName,
|
493 | resolveLfs: resolveLfs,
|
494 | };
|
495 | try {
|
496 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "7b28e929-2c99-405d-9c5c-6167a06e6816", routeValues, queryValues);
|
497 | let url = verData.requestUrl;
|
498 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
499 | let res;
|
500 | res = yield this.rest.get(url, options);
|
501 | let ret = this.formatResponse(res.result, null, false);
|
502 | resolve(ret);
|
503 | }
|
504 | catch (err) {
|
505 | reject(err);
|
506 | }
|
507 | }));
|
508 | });
|
509 | }
|
510 | |
511 |
|
512 |
|
513 |
|
514 |
|
515 |
|
516 |
|
517 |
|
518 |
|
519 |
|
520 | getBlobContent(repositoryId, sha1, project, download, fileName, resolveLfs) {
|
521 | return __awaiter(this, void 0, void 0, function* () {
|
522 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
523 | let routeValues = {
|
524 | project: project,
|
525 | repositoryId: repositoryId,
|
526 | sha1: sha1
|
527 | };
|
528 | let queryValues = {
|
529 | download: download,
|
530 | fileName: fileName,
|
531 | resolveLfs: resolveLfs,
|
532 | };
|
533 | try {
|
534 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "7b28e929-2c99-405d-9c5c-6167a06e6816", routeValues, queryValues);
|
535 | let url = verData.requestUrl;
|
536 | let apiVersion = verData.apiVersion;
|
537 | let accept = this.createAcceptHeader("application/octet-stream", apiVersion);
|
538 | resolve((yield this.http.get(url, { "Accept": accept })).message);
|
539 | }
|
540 | catch (err) {
|
541 | reject(err);
|
542 | }
|
543 | }));
|
544 | });
|
545 | }
|
546 | |
547 |
|
548 |
|
549 |
|
550 |
|
551 |
|
552 |
|
553 |
|
554 | getBlobsZip(blobIds, repositoryId, project, filename) {
|
555 | return __awaiter(this, void 0, void 0, function* () {
|
556 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
557 | let routeValues = {
|
558 | project: project,
|
559 | repositoryId: repositoryId
|
560 | };
|
561 | let queryValues = {
|
562 | filename: filename,
|
563 | };
|
564 | try {
|
565 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "7b28e929-2c99-405d-9c5c-6167a06e6816", routeValues, queryValues);
|
566 | let url = verData.requestUrl;
|
567 | let apiVersion = verData.apiVersion;
|
568 | let accept = this.createAcceptHeader("application/zip", apiVersion);
|
569 | resolve((yield this.http.get(url, { "Accept": accept })).message);
|
570 | }
|
571 | catch (err) {
|
572 | reject(err);
|
573 | }
|
574 | }));
|
575 | });
|
576 | }
|
577 | |
578 |
|
579 |
|
580 |
|
581 |
|
582 |
|
583 |
|
584 |
|
585 |
|
586 |
|
587 | getBlobZip(repositoryId, sha1, project, download, fileName, resolveLfs) {
|
588 | return __awaiter(this, void 0, void 0, function* () {
|
589 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
590 | let routeValues = {
|
591 | project: project,
|
592 | repositoryId: repositoryId,
|
593 | sha1: sha1
|
594 | };
|
595 | let queryValues = {
|
596 | download: download,
|
597 | fileName: fileName,
|
598 | resolveLfs: resolveLfs,
|
599 | };
|
600 | try {
|
601 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "7b28e929-2c99-405d-9c5c-6167a06e6816", routeValues, queryValues);
|
602 | let url = verData.requestUrl;
|
603 | let apiVersion = verData.apiVersion;
|
604 | let accept = this.createAcceptHeader("application/zip", apiVersion);
|
605 | resolve((yield this.http.get(url, { "Accept": accept })).message);
|
606 | }
|
607 | catch (err) {
|
608 | reject(err);
|
609 | }
|
610 | }));
|
611 | });
|
612 | }
|
613 | |
614 |
|
615 |
|
616 |
|
617 |
|
618 |
|
619 |
|
620 |
|
621 | getBranch(repositoryId, name, project, baseVersionDescriptor) {
|
622 | return __awaiter(this, void 0, void 0, function* () {
|
623 | if (name == null) {
|
624 | throw new TypeError('name can not be null or undefined');
|
625 | }
|
626 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
627 | let routeValues = {
|
628 | project: project,
|
629 | repositoryId: repositoryId
|
630 | };
|
631 | let queryValues = {
|
632 | name: name,
|
633 | baseVersionDescriptor: baseVersionDescriptor,
|
634 | };
|
635 | try {
|
636 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "d5b216de-d8d5-4d32-ae76-51df755b16d3", routeValues, queryValues);
|
637 | let url = verData.requestUrl;
|
638 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
639 | let res;
|
640 | res = yield this.rest.get(url, options);
|
641 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitBranchStats, false);
|
642 | resolve(ret);
|
643 | }
|
644 | catch (err) {
|
645 | reject(err);
|
646 | }
|
647 | }));
|
648 | });
|
649 | }
|
650 | |
651 |
|
652 |
|
653 |
|
654 |
|
655 |
|
656 |
|
657 | getBranches(repositoryId, project, baseVersionDescriptor) {
|
658 | return __awaiter(this, void 0, void 0, function* () {
|
659 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
660 | let routeValues = {
|
661 | project: project,
|
662 | repositoryId: repositoryId
|
663 | };
|
664 | let queryValues = {
|
665 | baseVersionDescriptor: baseVersionDescriptor,
|
666 | };
|
667 | try {
|
668 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "d5b216de-d8d5-4d32-ae76-51df755b16d3", routeValues, queryValues);
|
669 | let url = verData.requestUrl;
|
670 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
671 | let res;
|
672 | res = yield this.rest.get(url, options);
|
673 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitBranchStats, true);
|
674 | resolve(ret);
|
675 | }
|
676 | catch (err) {
|
677 | reject(err);
|
678 | }
|
679 | }));
|
680 | });
|
681 | }
|
682 | |
683 |
|
684 |
|
685 |
|
686 |
|
687 |
|
688 |
|
689 | getBranchStatsBatch(searchCriteria, repositoryId, project) {
|
690 | return __awaiter(this, void 0, void 0, function* () {
|
691 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
692 | let routeValues = {
|
693 | project: project,
|
694 | repositoryId: repositoryId
|
695 | };
|
696 | try {
|
697 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "d5b216de-d8d5-4d32-ae76-51df755b16d3", routeValues);
|
698 | let url = verData.requestUrl;
|
699 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
700 | let res;
|
701 | res = yield this.rest.create(url, searchCriteria, options);
|
702 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitBranchStats, true);
|
703 | resolve(ret);
|
704 | }
|
705 | catch (err) {
|
706 | reject(err);
|
707 | }
|
708 | }));
|
709 | });
|
710 | }
|
711 | |
712 |
|
713 |
|
714 |
|
715 |
|
716 |
|
717 |
|
718 |
|
719 |
|
720 | getChanges(commitId, repositoryId, project, top, skip) {
|
721 | return __awaiter(this, void 0, void 0, function* () {
|
722 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
723 | let routeValues = {
|
724 | project: project,
|
725 | commitId: commitId,
|
726 | repositoryId: repositoryId
|
727 | };
|
728 | let queryValues = {
|
729 | top: top,
|
730 | skip: skip,
|
731 | };
|
732 | try {
|
733 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "5bf884f5-3e07-42e9-afb8-1b872267bf16", routeValues, queryValues);
|
734 | let url = verData.requestUrl;
|
735 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
736 | let res;
|
737 | res = yield this.rest.get(url, options);
|
738 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitCommitChanges, false);
|
739 | resolve(ret);
|
740 | }
|
741 | catch (err) {
|
742 | reject(err);
|
743 | }
|
744 | }));
|
745 | });
|
746 | }
|
747 | |
748 |
|
749 |
|
750 |
|
751 |
|
752 |
|
753 |
|
754 |
|
755 | getCherryPickConflict(repositoryId, cherryPickId, conflictId, project) {
|
756 | return __awaiter(this, void 0, void 0, function* () {
|
757 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
758 | let routeValues = {
|
759 | project: project,
|
760 | repositoryId: repositoryId,
|
761 | cherryPickId: cherryPickId,
|
762 | conflictId: conflictId
|
763 | };
|
764 | try {
|
765 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "1fe5aab2-d4c0-4b2f-a030-f3831e7aca26", routeValues);
|
766 | let url = verData.requestUrl;
|
767 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
768 | let res;
|
769 | res = yield this.rest.get(url, options);
|
770 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitConflict, false);
|
771 | resolve(ret);
|
772 | }
|
773 | catch (err) {
|
774 | reject(err);
|
775 | }
|
776 | }));
|
777 | });
|
778 | }
|
779 | |
780 |
|
781 |
|
782 |
|
783 |
|
784 |
|
785 |
|
786 |
|
787 |
|
788 |
|
789 |
|
790 |
|
791 | getCherryPickConflicts(repositoryId, cherryPickId, project, continuationToken, top, excludeResolved, onlyResolved, includeObsolete) {
|
792 | return __awaiter(this, void 0, void 0, function* () {
|
793 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
794 | let routeValues = {
|
795 | project: project,
|
796 | repositoryId: repositoryId,
|
797 | cherryPickId: cherryPickId
|
798 | };
|
799 | let queryValues = {
|
800 | continuationToken: continuationToken,
|
801 | '$top': top,
|
802 | excludeResolved: excludeResolved,
|
803 | onlyResolved: onlyResolved,
|
804 | includeObsolete: includeObsolete,
|
805 | };
|
806 | try {
|
807 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "1fe5aab2-d4c0-4b2f-a030-f3831e7aca26", routeValues, queryValues);
|
808 | let url = verData.requestUrl;
|
809 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
810 | let res;
|
811 | res = yield this.rest.get(url, options);
|
812 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitConflict, true);
|
813 | resolve(ret);
|
814 | }
|
815 | catch (err) {
|
816 | reject(err);
|
817 | }
|
818 | }));
|
819 | });
|
820 | }
|
821 | |
822 |
|
823 |
|
824 |
|
825 |
|
826 |
|
827 |
|
828 |
|
829 |
|
830 | updateCherryPickConflict(conflict, repositoryId, cherryPickId, conflictId, project) {
|
831 | return __awaiter(this, void 0, void 0, function* () {
|
832 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
833 | let routeValues = {
|
834 | project: project,
|
835 | repositoryId: repositoryId,
|
836 | cherryPickId: cherryPickId,
|
837 | conflictId: conflictId
|
838 | };
|
839 | try {
|
840 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "1fe5aab2-d4c0-4b2f-a030-f3831e7aca26", routeValues);
|
841 | let url = verData.requestUrl;
|
842 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
843 | let res;
|
844 | res = yield this.rest.update(url, conflict, options);
|
845 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitConflict, false);
|
846 | resolve(ret);
|
847 | }
|
848 | catch (err) {
|
849 | reject(err);
|
850 | }
|
851 | }));
|
852 | });
|
853 | }
|
854 | |
855 |
|
856 |
|
857 |
|
858 |
|
859 |
|
860 |
|
861 |
|
862 | updateCherryPickConflicts(conflictUpdates, repositoryId, cherryPickId, project) {
|
863 | return __awaiter(this, void 0, void 0, function* () {
|
864 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
865 | let routeValues = {
|
866 | project: project,
|
867 | repositoryId: repositoryId,
|
868 | cherryPickId: cherryPickId
|
869 | };
|
870 | try {
|
871 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "1fe5aab2-d4c0-4b2f-a030-f3831e7aca26", routeValues);
|
872 | let url = verData.requestUrl;
|
873 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
874 | let res;
|
875 | res = yield this.rest.update(url, conflictUpdates, options);
|
876 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitConflictUpdateResult, true);
|
877 | resolve(ret);
|
878 | }
|
879 | catch (err) {
|
880 | reject(err);
|
881 | }
|
882 | }));
|
883 | });
|
884 | }
|
885 | |
886 |
|
887 |
|
888 |
|
889 |
|
890 |
|
891 |
|
892 |
|
893 | getCherryPickRelationships(repositoryNameOrId, commitId, project, includeLinks) {
|
894 | return __awaiter(this, void 0, void 0, function* () {
|
895 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
896 | let routeValues = {
|
897 | project: project,
|
898 | repositoryNameOrId: repositoryNameOrId,
|
899 | commitId: commitId
|
900 | };
|
901 | let queryValues = {
|
902 | includeLinks: includeLinks,
|
903 | };
|
904 | try {
|
905 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "8af142a4-27c2-4168-9e82-46b8629aaa0d", routeValues, queryValues);
|
906 | let url = verData.requestUrl;
|
907 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
908 | let res;
|
909 | res = yield this.rest.get(url, options);
|
910 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitCommitRef, true);
|
911 | resolve(ret);
|
912 | }
|
913 | catch (err) {
|
914 | reject(err);
|
915 | }
|
916 | }));
|
917 | });
|
918 | }
|
919 | |
920 |
|
921 |
|
922 |
|
923 |
|
924 |
|
925 |
|
926 | createCherryPick(cherryPickToCreate, project, repositoryId) {
|
927 | return __awaiter(this, void 0, void 0, function* () {
|
928 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
929 | let routeValues = {
|
930 | project: project,
|
931 | repositoryId: repositoryId
|
932 | };
|
933 | try {
|
934 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "033bad68-9a14-43d1-90e0-59cb8856fef6", routeValues);
|
935 | let url = verData.requestUrl;
|
936 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
937 | let res;
|
938 | res = yield this.rest.create(url, cherryPickToCreate, options);
|
939 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitCherryPick, false);
|
940 | resolve(ret);
|
941 | }
|
942 | catch (err) {
|
943 | reject(err);
|
944 | }
|
945 | }));
|
946 | });
|
947 | }
|
948 | |
949 |
|
950 |
|
951 |
|
952 |
|
953 |
|
954 |
|
955 | getCherryPick(project, cherryPickId, repositoryId) {
|
956 | return __awaiter(this, void 0, void 0, function* () {
|
957 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
958 | let routeValues = {
|
959 | project: project,
|
960 | cherryPickId: cherryPickId,
|
961 | repositoryId: repositoryId
|
962 | };
|
963 | try {
|
964 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "033bad68-9a14-43d1-90e0-59cb8856fef6", routeValues);
|
965 | let url = verData.requestUrl;
|
966 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
967 | let res;
|
968 | res = yield this.rest.get(url, options);
|
969 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitCherryPick, false);
|
970 | resolve(ret);
|
971 | }
|
972 | catch (err) {
|
973 | reject(err);
|
974 | }
|
975 | }));
|
976 | });
|
977 | }
|
978 | |
979 |
|
980 |
|
981 |
|
982 |
|
983 |
|
984 |
|
985 | getCherryPickForRefName(project, repositoryId, refName) {
|
986 | return __awaiter(this, void 0, void 0, function* () {
|
987 | if (refName == null) {
|
988 | throw new TypeError('refName can not be null or undefined');
|
989 | }
|
990 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
991 | let routeValues = {
|
992 | project: project,
|
993 | repositoryId: repositoryId
|
994 | };
|
995 | let queryValues = {
|
996 | refName: refName,
|
997 | };
|
998 | try {
|
999 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "033bad68-9a14-43d1-90e0-59cb8856fef6", routeValues, queryValues);
|
1000 | let url = verData.requestUrl;
|
1001 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1002 | let res;
|
1003 | res = yield this.rest.get(url, options);
|
1004 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitCherryPick, false);
|
1005 | resolve(ret);
|
1006 | }
|
1007 | catch (err) {
|
1008 | reject(err);
|
1009 | }
|
1010 | }));
|
1011 | });
|
1012 | }
|
1013 | |
1014 |
|
1015 |
|
1016 |
|
1017 |
|
1018 |
|
1019 |
|
1020 |
|
1021 |
|
1022 |
|
1023 |
|
1024 | getCommitDiffs(repositoryId, project, diffCommonCommit, top, skip, baseVersionDescriptor, targetVersionDescriptor) {
|
1025 | return __awaiter(this, void 0, void 0, function* () {
|
1026 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1027 | let routeValues = {
|
1028 | project: project,
|
1029 | repositoryId: repositoryId
|
1030 | };
|
1031 | let queryValues = {
|
1032 | diffCommonCommit: diffCommonCommit,
|
1033 | '$top': top,
|
1034 | '$skip': skip,
|
1035 | };
|
1036 | if (baseVersionDescriptor) {
|
1037 | queryValues.baseVersionType = baseVersionDescriptor.versionType;
|
1038 | queryValues.baseVersion = baseVersionDescriptor.version;
|
1039 | queryValues.baseVersionOptions = baseVersionDescriptor.versionOptions;
|
1040 | }
|
1041 | if (targetVersionDescriptor) {
|
1042 | queryValues.targetVersionType = targetVersionDescriptor.versionType;
|
1043 | queryValues.targetVersion = targetVersionDescriptor.version;
|
1044 | queryValues.targetVersionOptions = targetVersionDescriptor.versionOptions;
|
1045 | }
|
1046 | try {
|
1047 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "615588d5-c0c7-4b88-88f8-e625306446e8", routeValues, queryValues);
|
1048 | let url = verData.requestUrl;
|
1049 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1050 | let res;
|
1051 | res = yield this.rest.get(url, options);
|
1052 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitCommitDiffs, false);
|
1053 | resolve(ret);
|
1054 | }
|
1055 | catch (err) {
|
1056 | reject(err);
|
1057 | }
|
1058 | }));
|
1059 | });
|
1060 | }
|
1061 | |
1062 |
|
1063 |
|
1064 |
|
1065 |
|
1066 |
|
1067 |
|
1068 |
|
1069 | getCommit(commitId, repositoryId, project, changeCount) {
|
1070 | return __awaiter(this, void 0, void 0, function* () {
|
1071 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1072 | let routeValues = {
|
1073 | project: project,
|
1074 | commitId: commitId,
|
1075 | repositoryId: repositoryId
|
1076 | };
|
1077 | let queryValues = {
|
1078 | changeCount: changeCount,
|
1079 | };
|
1080 | try {
|
1081 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "c2570c3b-5b3f-41b8-98bf-5407bfde8d58", routeValues, queryValues);
|
1082 | let url = verData.requestUrl;
|
1083 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1084 | let res;
|
1085 | res = yield this.rest.get(url, options);
|
1086 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitCommit, false);
|
1087 | resolve(ret);
|
1088 | }
|
1089 | catch (err) {
|
1090 | reject(err);
|
1091 | }
|
1092 | }));
|
1093 | });
|
1094 | }
|
1095 | |
1096 |
|
1097 |
|
1098 |
|
1099 |
|
1100 |
|
1101 |
|
1102 |
|
1103 |
|
1104 | getCommits(repositoryId, searchCriteria, project, skip, top) {
|
1105 | return __awaiter(this, void 0, void 0, function* () {
|
1106 | if (searchCriteria == null) {
|
1107 | throw new TypeError('searchCriteria can not be null or undefined');
|
1108 | }
|
1109 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1110 | let routeValues = {
|
1111 | project: project,
|
1112 | repositoryId: repositoryId
|
1113 | };
|
1114 | let queryValues = {
|
1115 | searchCriteria: searchCriteria,
|
1116 | '$skip': skip,
|
1117 | '$top': top,
|
1118 | };
|
1119 | try {
|
1120 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "c2570c3b-5b3f-41b8-98bf-5407bfde8d58", routeValues, queryValues);
|
1121 | let url = verData.requestUrl;
|
1122 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1123 | let res;
|
1124 | res = yield this.rest.get(url, options);
|
1125 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitCommitRef, true);
|
1126 | resolve(ret);
|
1127 | }
|
1128 | catch (err) {
|
1129 | reject(err);
|
1130 | }
|
1131 | }));
|
1132 | });
|
1133 | }
|
1134 | |
1135 |
|
1136 |
|
1137 |
|
1138 |
|
1139 |
|
1140 |
|
1141 |
|
1142 |
|
1143 |
|
1144 | getPushCommits(repositoryId, pushId, project, top, skip, includeLinks) {
|
1145 | return __awaiter(this, void 0, void 0, function* () {
|
1146 | if (pushId == null) {
|
1147 | throw new TypeError('pushId can not be null or undefined');
|
1148 | }
|
1149 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1150 | let routeValues = {
|
1151 | project: project,
|
1152 | repositoryId: repositoryId
|
1153 | };
|
1154 | let queryValues = {
|
1155 | pushId: pushId,
|
1156 | top: top,
|
1157 | skip: skip,
|
1158 | includeLinks: includeLinks,
|
1159 | };
|
1160 | try {
|
1161 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "c2570c3b-5b3f-41b8-98bf-5407bfde8d58", routeValues, queryValues);
|
1162 | let url = verData.requestUrl;
|
1163 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1164 | let res;
|
1165 | res = yield this.rest.get(url, options);
|
1166 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitCommitRef, true);
|
1167 | resolve(ret);
|
1168 | }
|
1169 | catch (err) {
|
1170 | reject(err);
|
1171 | }
|
1172 | }));
|
1173 | });
|
1174 | }
|
1175 | |
1176 |
|
1177 |
|
1178 |
|
1179 |
|
1180 |
|
1181 |
|
1182 |
|
1183 |
|
1184 |
|
1185 | getCommitsBatch(searchCriteria, repositoryId, project, skip, top, includeStatuses) {
|
1186 | return __awaiter(this, void 0, void 0, function* () {
|
1187 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1188 | let routeValues = {
|
1189 | project: project,
|
1190 | repositoryId: repositoryId
|
1191 | };
|
1192 | let queryValues = {
|
1193 | '$skip': skip,
|
1194 | '$top': top,
|
1195 | includeStatuses: includeStatuses,
|
1196 | };
|
1197 | try {
|
1198 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "6400dfb2-0bcb-462b-b992-5a57f8f1416c", routeValues, queryValues);
|
1199 | let url = verData.requestUrl;
|
1200 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1201 | let res;
|
1202 | res = yield this.rest.create(url, searchCriteria, options);
|
1203 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitCommitRef, true);
|
1204 | resolve(ret);
|
1205 | }
|
1206 | catch (err) {
|
1207 | reject(err);
|
1208 | }
|
1209 | }));
|
1210 | });
|
1211 | }
|
1212 | |
1213 |
|
1214 |
|
1215 |
|
1216 |
|
1217 | getDeletedRepositories(project) {
|
1218 | return __awaiter(this, void 0, void 0, function* () {
|
1219 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1220 | let routeValues = {
|
1221 | project: project
|
1222 | };
|
1223 | try {
|
1224 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "2b6869c4-cb25-42b5-b7a3-0d3e6be0a11a", routeValues);
|
1225 | let url = verData.requestUrl;
|
1226 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1227 | let res;
|
1228 | res = yield this.rest.get(url, options);
|
1229 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitDeletedRepository, true);
|
1230 | resolve(ret);
|
1231 | }
|
1232 | catch (err) {
|
1233 | reject(err);
|
1234 | }
|
1235 | }));
|
1236 | });
|
1237 | }
|
1238 | |
1239 |
|
1240 |
|
1241 |
|
1242 |
|
1243 |
|
1244 |
|
1245 | getFileDiffs(fileDiffsCriteria, project, repositoryId) {
|
1246 | return __awaiter(this, void 0, void 0, function* () {
|
1247 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1248 | let routeValues = {
|
1249 | project: project,
|
1250 | repositoryId: repositoryId
|
1251 | };
|
1252 | try {
|
1253 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "c4c5a7e6-e9f3-4730-a92b-84baacff694b", routeValues);
|
1254 | let url = verData.requestUrl;
|
1255 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1256 | let res;
|
1257 | res = yield this.rest.create(url, fileDiffsCriteria, options);
|
1258 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.FileDiff, true);
|
1259 | resolve(ret);
|
1260 | }
|
1261 | catch (err) {
|
1262 | reject(err);
|
1263 | }
|
1264 | }));
|
1265 | });
|
1266 | }
|
1267 | |
1268 |
|
1269 |
|
1270 |
|
1271 |
|
1272 |
|
1273 |
|
1274 |
|
1275 | getForks(repositoryNameOrId, collectionId, project, includeLinks) {
|
1276 | return __awaiter(this, void 0, void 0, function* () {
|
1277 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1278 | let routeValues = {
|
1279 | project: project,
|
1280 | repositoryNameOrId: repositoryNameOrId,
|
1281 | collectionId: collectionId
|
1282 | };
|
1283 | let queryValues = {
|
1284 | includeLinks: includeLinks,
|
1285 | };
|
1286 | try {
|
1287 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "158c0340-bf6f-489c-9625-d572a1480d57", routeValues, queryValues);
|
1288 | let url = verData.requestUrl;
|
1289 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1290 | let res;
|
1291 | res = yield this.rest.get(url, options);
|
1292 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitRepositoryRef, true);
|
1293 | resolve(ret);
|
1294 | }
|
1295 | catch (err) {
|
1296 | reject(err);
|
1297 | }
|
1298 | }));
|
1299 | });
|
1300 | }
|
1301 | |
1302 |
|
1303 |
|
1304 |
|
1305 |
|
1306 |
|
1307 |
|
1308 |
|
1309 | createForkSyncRequest(syncParams, repositoryNameOrId, project, includeLinks) {
|
1310 | return __awaiter(this, void 0, void 0, function* () {
|
1311 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1312 | let routeValues = {
|
1313 | project: project,
|
1314 | repositoryNameOrId: repositoryNameOrId
|
1315 | };
|
1316 | let queryValues = {
|
1317 | includeLinks: includeLinks,
|
1318 | };
|
1319 | try {
|
1320 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "1703f858-b9d1-46af-ab62-483e9e1055b5", routeValues, queryValues);
|
1321 | let url = verData.requestUrl;
|
1322 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1323 | let res;
|
1324 | res = yield this.rest.create(url, syncParams, options);
|
1325 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitForkSyncRequest, false);
|
1326 | resolve(ret);
|
1327 | }
|
1328 | catch (err) {
|
1329 | reject(err);
|
1330 | }
|
1331 | }));
|
1332 | });
|
1333 | }
|
1334 | |
1335 |
|
1336 |
|
1337 |
|
1338 |
|
1339 |
|
1340 |
|
1341 |
|
1342 | getForkSyncRequest(repositoryNameOrId, forkSyncOperationId, project, includeLinks) {
|
1343 | return __awaiter(this, void 0, void 0, function* () {
|
1344 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1345 | let routeValues = {
|
1346 | project: project,
|
1347 | repositoryNameOrId: repositoryNameOrId,
|
1348 | forkSyncOperationId: forkSyncOperationId
|
1349 | };
|
1350 | let queryValues = {
|
1351 | includeLinks: includeLinks,
|
1352 | };
|
1353 | try {
|
1354 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "1703f858-b9d1-46af-ab62-483e9e1055b5", routeValues, queryValues);
|
1355 | let url = verData.requestUrl;
|
1356 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1357 | let res;
|
1358 | res = yield this.rest.get(url, options);
|
1359 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitForkSyncRequest, false);
|
1360 | resolve(ret);
|
1361 | }
|
1362 | catch (err) {
|
1363 | reject(err);
|
1364 | }
|
1365 | }));
|
1366 | });
|
1367 | }
|
1368 | |
1369 |
|
1370 |
|
1371 |
|
1372 |
|
1373 |
|
1374 |
|
1375 |
|
1376 | getForkSyncRequests(repositoryNameOrId, project, includeAbandoned, includeLinks) {
|
1377 | return __awaiter(this, void 0, void 0, function* () {
|
1378 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1379 | let routeValues = {
|
1380 | project: project,
|
1381 | repositoryNameOrId: repositoryNameOrId
|
1382 | };
|
1383 | let queryValues = {
|
1384 | includeAbandoned: includeAbandoned,
|
1385 | includeLinks: includeLinks,
|
1386 | };
|
1387 | try {
|
1388 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "1703f858-b9d1-46af-ab62-483e9e1055b5", routeValues, queryValues);
|
1389 | let url = verData.requestUrl;
|
1390 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1391 | let res;
|
1392 | res = yield this.rest.get(url, options);
|
1393 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitForkSyncRequest, true);
|
1394 | resolve(ret);
|
1395 | }
|
1396 | catch (err) {
|
1397 | reject(err);
|
1398 | }
|
1399 | }));
|
1400 | });
|
1401 | }
|
1402 | |
1403 |
|
1404 |
|
1405 |
|
1406 |
|
1407 |
|
1408 |
|
1409 | createImportRequest(importRequest, project, repositoryId) {
|
1410 | return __awaiter(this, void 0, void 0, function* () {
|
1411 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1412 | let routeValues = {
|
1413 | project: project,
|
1414 | repositoryId: repositoryId
|
1415 | };
|
1416 | try {
|
1417 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "01828ddc-3600-4a41-8633-99b3a73a0eb3", routeValues);
|
1418 | let url = verData.requestUrl;
|
1419 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1420 | let res;
|
1421 | res = yield this.rest.create(url, importRequest, options);
|
1422 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitImportRequest, false);
|
1423 | resolve(ret);
|
1424 | }
|
1425 | catch (err) {
|
1426 | reject(err);
|
1427 | }
|
1428 | }));
|
1429 | });
|
1430 | }
|
1431 | |
1432 |
|
1433 |
|
1434 |
|
1435 |
|
1436 |
|
1437 |
|
1438 | getImportRequest(project, repositoryId, importRequestId) {
|
1439 | return __awaiter(this, void 0, void 0, function* () {
|
1440 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1441 | let routeValues = {
|
1442 | project: project,
|
1443 | repositoryId: repositoryId,
|
1444 | importRequestId: importRequestId
|
1445 | };
|
1446 | try {
|
1447 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "01828ddc-3600-4a41-8633-99b3a73a0eb3", routeValues);
|
1448 | let url = verData.requestUrl;
|
1449 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1450 | let res;
|
1451 | res = yield this.rest.get(url, options);
|
1452 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitImportRequest, false);
|
1453 | resolve(ret);
|
1454 | }
|
1455 | catch (err) {
|
1456 | reject(err);
|
1457 | }
|
1458 | }));
|
1459 | });
|
1460 | }
|
1461 | |
1462 |
|
1463 |
|
1464 |
|
1465 |
|
1466 |
|
1467 |
|
1468 | queryImportRequests(project, repositoryId, includeAbandoned) {
|
1469 | return __awaiter(this, void 0, void 0, function* () {
|
1470 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1471 | let routeValues = {
|
1472 | project: project,
|
1473 | repositoryId: repositoryId
|
1474 | };
|
1475 | let queryValues = {
|
1476 | includeAbandoned: includeAbandoned,
|
1477 | };
|
1478 | try {
|
1479 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "01828ddc-3600-4a41-8633-99b3a73a0eb3", routeValues, queryValues);
|
1480 | let url = verData.requestUrl;
|
1481 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1482 | let res;
|
1483 | res = yield this.rest.get(url, options);
|
1484 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitImportRequest, true);
|
1485 | resolve(ret);
|
1486 | }
|
1487 | catch (err) {
|
1488 | reject(err);
|
1489 | }
|
1490 | }));
|
1491 | });
|
1492 | }
|
1493 | |
1494 |
|
1495 |
|
1496 |
|
1497 |
|
1498 |
|
1499 |
|
1500 |
|
1501 | updateImportRequest(importRequestToUpdate, project, repositoryId, importRequestId) {
|
1502 | return __awaiter(this, void 0, void 0, function* () {
|
1503 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1504 | let routeValues = {
|
1505 | project: project,
|
1506 | repositoryId: repositoryId,
|
1507 | importRequestId: importRequestId
|
1508 | };
|
1509 | try {
|
1510 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "01828ddc-3600-4a41-8633-99b3a73a0eb3", routeValues);
|
1511 | let url = verData.requestUrl;
|
1512 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1513 | let res;
|
1514 | res = yield this.rest.update(url, importRequestToUpdate, options);
|
1515 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitImportRequest, false);
|
1516 | resolve(ret);
|
1517 | }
|
1518 | catch (err) {
|
1519 | reject(err);
|
1520 | }
|
1521 | }));
|
1522 | });
|
1523 | }
|
1524 | |
1525 |
|
1526 |
|
1527 |
|
1528 |
|
1529 |
|
1530 |
|
1531 |
|
1532 |
|
1533 |
|
1534 |
|
1535 |
|
1536 |
|
1537 |
|
1538 |
|
1539 |
|
1540 | getItem(repositoryId, path, project, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, versionDescriptor, includeContent, resolveLfs, sanitize) {
|
1541 | return __awaiter(this, void 0, void 0, function* () {
|
1542 | if (path == null) {
|
1543 | throw new TypeError('path can not be null or undefined');
|
1544 | }
|
1545 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1546 | let routeValues = {
|
1547 | project: project,
|
1548 | repositoryId: repositoryId
|
1549 | };
|
1550 | let queryValues = {
|
1551 | path: path,
|
1552 | scopePath: scopePath,
|
1553 | recursionLevel: recursionLevel,
|
1554 | includeContentMetadata: includeContentMetadata,
|
1555 | latestProcessedChange: latestProcessedChange,
|
1556 | download: download,
|
1557 | versionDescriptor: versionDescriptor,
|
1558 | includeContent: includeContent,
|
1559 | resolveLfs: resolveLfs,
|
1560 | sanitize: sanitize,
|
1561 | };
|
1562 | try {
|
1563 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "fb93c0db-47ed-4a31-8c20-47552878fb44", routeValues, queryValues);
|
1564 | let url = verData.requestUrl;
|
1565 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1566 | let res;
|
1567 | res = yield this.rest.get(url, options);
|
1568 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitItem, false);
|
1569 | resolve(ret);
|
1570 | }
|
1571 | catch (err) {
|
1572 | reject(err);
|
1573 | }
|
1574 | }));
|
1575 | });
|
1576 | }
|
1577 | |
1578 |
|
1579 |
|
1580 |
|
1581 |
|
1582 |
|
1583 |
|
1584 |
|
1585 |
|
1586 |
|
1587 |
|
1588 |
|
1589 |
|
1590 |
|
1591 |
|
1592 |
|
1593 | getItemContent(repositoryId, path, project, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, versionDescriptor, includeContent, resolveLfs, sanitize) {
|
1594 | return __awaiter(this, void 0, void 0, function* () {
|
1595 | if (path == null) {
|
1596 | throw new TypeError('path can not be null or undefined');
|
1597 | }
|
1598 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1599 | let routeValues = {
|
1600 | project: project,
|
1601 | repositoryId: repositoryId
|
1602 | };
|
1603 | let queryValues = {
|
1604 | path: path,
|
1605 | scopePath: scopePath,
|
1606 | recursionLevel: recursionLevel,
|
1607 | includeContentMetadata: includeContentMetadata,
|
1608 | latestProcessedChange: latestProcessedChange,
|
1609 | download: download,
|
1610 | versionDescriptor: versionDescriptor,
|
1611 | includeContent: includeContent,
|
1612 | resolveLfs: resolveLfs,
|
1613 | sanitize: sanitize,
|
1614 | };
|
1615 | try {
|
1616 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "fb93c0db-47ed-4a31-8c20-47552878fb44", routeValues, queryValues);
|
1617 | let url = verData.requestUrl;
|
1618 | let apiVersion = verData.apiVersion;
|
1619 | let accept = this.createAcceptHeader("application/octet-stream", apiVersion);
|
1620 | resolve((yield this.http.get(url, { "Accept": accept })).message);
|
1621 | }
|
1622 | catch (err) {
|
1623 | reject(err);
|
1624 | }
|
1625 | }));
|
1626 | });
|
1627 | }
|
1628 | |
1629 |
|
1630 |
|
1631 |
|
1632 |
|
1633 |
|
1634 |
|
1635 |
|
1636 |
|
1637 |
|
1638 |
|
1639 |
|
1640 |
|
1641 |
|
1642 | getItems(repositoryId, project, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, includeLinks, versionDescriptor, zipForUnix) {
|
1643 | return __awaiter(this, void 0, void 0, function* () {
|
1644 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1645 | let routeValues = {
|
1646 | project: project,
|
1647 | repositoryId: repositoryId
|
1648 | };
|
1649 | let queryValues = {
|
1650 | scopePath: scopePath,
|
1651 | recursionLevel: recursionLevel,
|
1652 | includeContentMetadata: includeContentMetadata,
|
1653 | latestProcessedChange: latestProcessedChange,
|
1654 | download: download,
|
1655 | includeLinks: includeLinks,
|
1656 | versionDescriptor: versionDescriptor,
|
1657 | zipForUnix: zipForUnix,
|
1658 | };
|
1659 | try {
|
1660 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "fb93c0db-47ed-4a31-8c20-47552878fb44", routeValues, queryValues);
|
1661 | let url = verData.requestUrl;
|
1662 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1663 | let res;
|
1664 | res = yield this.rest.get(url, options);
|
1665 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitItem, true);
|
1666 | resolve(ret);
|
1667 | }
|
1668 | catch (err) {
|
1669 | reject(err);
|
1670 | }
|
1671 | }));
|
1672 | });
|
1673 | }
|
1674 | |
1675 |
|
1676 |
|
1677 |
|
1678 |
|
1679 |
|
1680 |
|
1681 |
|
1682 |
|
1683 |
|
1684 |
|
1685 |
|
1686 |
|
1687 |
|
1688 |
|
1689 |
|
1690 | getItemText(repositoryId, path, project, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, versionDescriptor, includeContent, resolveLfs, sanitize) {
|
1691 | return __awaiter(this, void 0, void 0, function* () {
|
1692 | if (path == null) {
|
1693 | throw new TypeError('path can not be null or undefined');
|
1694 | }
|
1695 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1696 | let routeValues = {
|
1697 | project: project,
|
1698 | repositoryId: repositoryId
|
1699 | };
|
1700 | let queryValues = {
|
1701 | path: path,
|
1702 | scopePath: scopePath,
|
1703 | recursionLevel: recursionLevel,
|
1704 | includeContentMetadata: includeContentMetadata,
|
1705 | latestProcessedChange: latestProcessedChange,
|
1706 | download: download,
|
1707 | versionDescriptor: versionDescriptor,
|
1708 | includeContent: includeContent,
|
1709 | resolveLfs: resolveLfs,
|
1710 | sanitize: sanitize,
|
1711 | };
|
1712 | try {
|
1713 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "fb93c0db-47ed-4a31-8c20-47552878fb44", routeValues, queryValues);
|
1714 | let url = verData.requestUrl;
|
1715 | let apiVersion = verData.apiVersion;
|
1716 | let accept = this.createAcceptHeader("text/plain", apiVersion);
|
1717 | resolve((yield this.http.get(url, { "Accept": accept })).message);
|
1718 | }
|
1719 | catch (err) {
|
1720 | reject(err);
|
1721 | }
|
1722 | }));
|
1723 | });
|
1724 | }
|
1725 | |
1726 |
|
1727 |
|
1728 |
|
1729 |
|
1730 |
|
1731 |
|
1732 |
|
1733 |
|
1734 |
|
1735 |
|
1736 |
|
1737 |
|
1738 |
|
1739 |
|
1740 |
|
1741 | getItemZip(repositoryId, path, project, scopePath, recursionLevel, includeContentMetadata, latestProcessedChange, download, versionDescriptor, includeContent, resolveLfs, sanitize) {
|
1742 | return __awaiter(this, void 0, void 0, function* () {
|
1743 | if (path == null) {
|
1744 | throw new TypeError('path can not be null or undefined');
|
1745 | }
|
1746 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1747 | let routeValues = {
|
1748 | project: project,
|
1749 | repositoryId: repositoryId
|
1750 | };
|
1751 | let queryValues = {
|
1752 | path: path,
|
1753 | scopePath: scopePath,
|
1754 | recursionLevel: recursionLevel,
|
1755 | includeContentMetadata: includeContentMetadata,
|
1756 | latestProcessedChange: latestProcessedChange,
|
1757 | download: download,
|
1758 | versionDescriptor: versionDescriptor,
|
1759 | includeContent: includeContent,
|
1760 | resolveLfs: resolveLfs,
|
1761 | sanitize: sanitize,
|
1762 | };
|
1763 | try {
|
1764 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "fb93c0db-47ed-4a31-8c20-47552878fb44", routeValues, queryValues);
|
1765 | let url = verData.requestUrl;
|
1766 | let apiVersion = verData.apiVersion;
|
1767 | let accept = this.createAcceptHeader("application/zip", apiVersion);
|
1768 | resolve((yield this.http.get(url, { "Accept": accept })).message);
|
1769 | }
|
1770 | catch (err) {
|
1771 | reject(err);
|
1772 | }
|
1773 | }));
|
1774 | });
|
1775 | }
|
1776 | |
1777 |
|
1778 |
|
1779 |
|
1780 |
|
1781 |
|
1782 |
|
1783 | getItemsBatch(requestData, repositoryId, project) {
|
1784 | return __awaiter(this, void 0, void 0, function* () {
|
1785 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1786 | let routeValues = {
|
1787 | project: project,
|
1788 | repositoryId: repositoryId
|
1789 | };
|
1790 | try {
|
1791 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "630fd2e4-fb88-4f85-ad21-13f3fd1fbca9", routeValues);
|
1792 | let url = verData.requestUrl;
|
1793 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1794 | let res;
|
1795 | res = yield this.rest.create(url, requestData, options);
|
1796 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitItem, true);
|
1797 | resolve(ret);
|
1798 | }
|
1799 | catch (err) {
|
1800 | reject(err);
|
1801 | }
|
1802 | }));
|
1803 | });
|
1804 | }
|
1805 | |
1806 |
|
1807 |
|
1808 |
|
1809 |
|
1810 |
|
1811 |
|
1812 |
|
1813 |
|
1814 |
|
1815 | getMergeBases(repositoryNameOrId, commitId, otherCommitId, project, otherCollectionId, otherRepositoryId) {
|
1816 | return __awaiter(this, void 0, void 0, function* () {
|
1817 | if (otherCommitId == null) {
|
1818 | throw new TypeError('otherCommitId can not be null or undefined');
|
1819 | }
|
1820 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1821 | let routeValues = {
|
1822 | project: project,
|
1823 | repositoryNameOrId: repositoryNameOrId,
|
1824 | commitId: commitId
|
1825 | };
|
1826 | let queryValues = {
|
1827 | otherCommitId: otherCommitId,
|
1828 | otherCollectionId: otherCollectionId,
|
1829 | otherRepositoryId: otherRepositoryId,
|
1830 | };
|
1831 | try {
|
1832 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "7cf2abb6-c964-4f7e-9872-f78c66e72e9c", routeValues, queryValues);
|
1833 | let url = verData.requestUrl;
|
1834 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1835 | let res;
|
1836 | res = yield this.rest.get(url, options);
|
1837 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitCommitRef, true);
|
1838 | resolve(ret);
|
1839 | }
|
1840 | catch (err) {
|
1841 | reject(err);
|
1842 | }
|
1843 | }));
|
1844 | });
|
1845 | }
|
1846 | |
1847 |
|
1848 |
|
1849 |
|
1850 |
|
1851 |
|
1852 |
|
1853 |
|
1854 | createMergeRequest(mergeParameters, project, repositoryNameOrId, includeLinks) {
|
1855 | return __awaiter(this, void 0, void 0, function* () {
|
1856 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1857 | let routeValues = {
|
1858 | project: project,
|
1859 | repositoryNameOrId: repositoryNameOrId
|
1860 | };
|
1861 | let queryValues = {
|
1862 | includeLinks: includeLinks,
|
1863 | };
|
1864 | try {
|
1865 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "985f7ae9-844f-4906-9897-7ef41516c0e2", routeValues, queryValues);
|
1866 | let url = verData.requestUrl;
|
1867 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1868 | let res;
|
1869 | res = yield this.rest.create(url, mergeParameters, options);
|
1870 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitMerge, false);
|
1871 | resolve(ret);
|
1872 | }
|
1873 | catch (err) {
|
1874 | reject(err);
|
1875 | }
|
1876 | }));
|
1877 | });
|
1878 | }
|
1879 | |
1880 |
|
1881 |
|
1882 |
|
1883 |
|
1884 |
|
1885 |
|
1886 |
|
1887 | getMergeRequest(project, repositoryNameOrId, mergeOperationId, includeLinks) {
|
1888 | return __awaiter(this, void 0, void 0, function* () {
|
1889 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1890 | let routeValues = {
|
1891 | project: project,
|
1892 | repositoryNameOrId: repositoryNameOrId,
|
1893 | mergeOperationId: mergeOperationId
|
1894 | };
|
1895 | let queryValues = {
|
1896 | includeLinks: includeLinks,
|
1897 | };
|
1898 | try {
|
1899 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "985f7ae9-844f-4906-9897-7ef41516c0e2", routeValues, queryValues);
|
1900 | let url = verData.requestUrl;
|
1901 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1902 | let res;
|
1903 | res = yield this.rest.get(url, options);
|
1904 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitMerge, false);
|
1905 | resolve(ret);
|
1906 | }
|
1907 | catch (err) {
|
1908 | reject(err);
|
1909 | }
|
1910 | }));
|
1911 | });
|
1912 | }
|
1913 | |
1914 |
|
1915 |
|
1916 |
|
1917 |
|
1918 |
|
1919 |
|
1920 |
|
1921 |
|
1922 | createAttachment(customHeaders, contentStream, fileName, repositoryId, pullRequestId, project) {
|
1923 | return __awaiter(this, void 0, void 0, function* () {
|
1924 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1925 | let routeValues = {
|
1926 | project: project,
|
1927 | fileName: fileName,
|
1928 | repositoryId: repositoryId,
|
1929 | pullRequestId: pullRequestId
|
1930 | };
|
1931 | customHeaders = customHeaders || {};
|
1932 | customHeaders["Content-Type"] = "application/octet-stream";
|
1933 | try {
|
1934 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "965d9361-878b-413b-a494-45d5b5fd8ab7", routeValues);
|
1935 | let url = verData.requestUrl;
|
1936 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1937 | options.additionalHeaders = customHeaders;
|
1938 | let res;
|
1939 | res = yield this.rest.uploadStream("POST", url, contentStream, options);
|
1940 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.Attachment, false);
|
1941 | resolve(ret);
|
1942 | }
|
1943 | catch (err) {
|
1944 | reject(err);
|
1945 | }
|
1946 | }));
|
1947 | });
|
1948 | }
|
1949 | |
1950 |
|
1951 |
|
1952 |
|
1953 |
|
1954 |
|
1955 |
|
1956 |
|
1957 | deleteAttachment(fileName, repositoryId, pullRequestId, project) {
|
1958 | return __awaiter(this, void 0, void 0, function* () {
|
1959 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1960 | let routeValues = {
|
1961 | project: project,
|
1962 | fileName: fileName,
|
1963 | repositoryId: repositoryId,
|
1964 | pullRequestId: pullRequestId
|
1965 | };
|
1966 | try {
|
1967 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "965d9361-878b-413b-a494-45d5b5fd8ab7", routeValues);
|
1968 | let url = verData.requestUrl;
|
1969 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1970 | let res;
|
1971 | res = yield this.rest.del(url, options);
|
1972 | let ret = this.formatResponse(res.result, null, false);
|
1973 | resolve(ret);
|
1974 | }
|
1975 | catch (err) {
|
1976 | reject(err);
|
1977 | }
|
1978 | }));
|
1979 | });
|
1980 | }
|
1981 | |
1982 |
|
1983 |
|
1984 |
|
1985 |
|
1986 |
|
1987 |
|
1988 |
|
1989 | getAttachmentContent(fileName, repositoryId, pullRequestId, project) {
|
1990 | return __awaiter(this, void 0, void 0, function* () {
|
1991 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1992 | let routeValues = {
|
1993 | project: project,
|
1994 | fileName: fileName,
|
1995 | repositoryId: repositoryId,
|
1996 | pullRequestId: pullRequestId
|
1997 | };
|
1998 | try {
|
1999 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "965d9361-878b-413b-a494-45d5b5fd8ab7", routeValues);
|
2000 | let url = verData.requestUrl;
|
2001 | let apiVersion = verData.apiVersion;
|
2002 | let accept = this.createAcceptHeader("application/octet-stream", apiVersion);
|
2003 | resolve((yield this.http.get(url, { "Accept": accept })).message);
|
2004 | }
|
2005 | catch (err) {
|
2006 | reject(err);
|
2007 | }
|
2008 | }));
|
2009 | });
|
2010 | }
|
2011 | |
2012 |
|
2013 |
|
2014 |
|
2015 |
|
2016 |
|
2017 |
|
2018 | getAttachments(repositoryId, pullRequestId, project) {
|
2019 | return __awaiter(this, void 0, void 0, function* () {
|
2020 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2021 | let routeValues = {
|
2022 | project: project,
|
2023 | repositoryId: repositoryId,
|
2024 | pullRequestId: pullRequestId
|
2025 | };
|
2026 | try {
|
2027 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "965d9361-878b-413b-a494-45d5b5fd8ab7", routeValues);
|
2028 | let url = verData.requestUrl;
|
2029 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2030 | let res;
|
2031 | res = yield this.rest.get(url, options);
|
2032 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.Attachment, true);
|
2033 | resolve(ret);
|
2034 | }
|
2035 | catch (err) {
|
2036 | reject(err);
|
2037 | }
|
2038 | }));
|
2039 | });
|
2040 | }
|
2041 | |
2042 |
|
2043 |
|
2044 |
|
2045 |
|
2046 |
|
2047 |
|
2048 |
|
2049 | getAttachmentZip(fileName, repositoryId, pullRequestId, project) {
|
2050 | return __awaiter(this, void 0, void 0, function* () {
|
2051 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2052 | let routeValues = {
|
2053 | project: project,
|
2054 | fileName: fileName,
|
2055 | repositoryId: repositoryId,
|
2056 | pullRequestId: pullRequestId
|
2057 | };
|
2058 | try {
|
2059 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "965d9361-878b-413b-a494-45d5b5fd8ab7", routeValues);
|
2060 | let url = verData.requestUrl;
|
2061 | let apiVersion = verData.apiVersion;
|
2062 | let accept = this.createAcceptHeader("application/zip", apiVersion);
|
2063 | resolve((yield this.http.get(url, { "Accept": accept })).message);
|
2064 | }
|
2065 | catch (err) {
|
2066 | reject(err);
|
2067 | }
|
2068 | }));
|
2069 | });
|
2070 | }
|
2071 | |
2072 |
|
2073 |
|
2074 |
|
2075 |
|
2076 |
|
2077 |
|
2078 |
|
2079 |
|
2080 | createLike(repositoryId, pullRequestId, threadId, commentId, project) {
|
2081 | return __awaiter(this, void 0, void 0, function* () {
|
2082 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2083 | let routeValues = {
|
2084 | project: project,
|
2085 | repositoryId: repositoryId,
|
2086 | pullRequestId: pullRequestId,
|
2087 | threadId: threadId,
|
2088 | commentId: commentId
|
2089 | };
|
2090 | try {
|
2091 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "5f2e2851-1389-425b-a00b-fb2adb3ef31b", routeValues);
|
2092 | let url = verData.requestUrl;
|
2093 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2094 | let res;
|
2095 | res = yield this.rest.create(url, null, options);
|
2096 | let ret = this.formatResponse(res.result, null, false);
|
2097 | resolve(ret);
|
2098 | }
|
2099 | catch (err) {
|
2100 | reject(err);
|
2101 | }
|
2102 | }));
|
2103 | });
|
2104 | }
|
2105 | |
2106 |
|
2107 |
|
2108 |
|
2109 |
|
2110 |
|
2111 |
|
2112 |
|
2113 |
|
2114 | deleteLike(repositoryId, pullRequestId, threadId, commentId, project) {
|
2115 | return __awaiter(this, void 0, void 0, function* () {
|
2116 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2117 | let routeValues = {
|
2118 | project: project,
|
2119 | repositoryId: repositoryId,
|
2120 | pullRequestId: pullRequestId,
|
2121 | threadId: threadId,
|
2122 | commentId: commentId
|
2123 | };
|
2124 | try {
|
2125 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "5f2e2851-1389-425b-a00b-fb2adb3ef31b", routeValues);
|
2126 | let url = verData.requestUrl;
|
2127 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2128 | let res;
|
2129 | res = yield this.rest.del(url, options);
|
2130 | let ret = this.formatResponse(res.result, null, false);
|
2131 | resolve(ret);
|
2132 | }
|
2133 | catch (err) {
|
2134 | reject(err);
|
2135 | }
|
2136 | }));
|
2137 | });
|
2138 | }
|
2139 | |
2140 |
|
2141 |
|
2142 |
|
2143 |
|
2144 |
|
2145 |
|
2146 |
|
2147 |
|
2148 | getLikes(repositoryId, pullRequestId, threadId, commentId, project) {
|
2149 | return __awaiter(this, void 0, void 0, function* () {
|
2150 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2151 | let routeValues = {
|
2152 | project: project,
|
2153 | repositoryId: repositoryId,
|
2154 | pullRequestId: pullRequestId,
|
2155 | threadId: threadId,
|
2156 | commentId: commentId
|
2157 | };
|
2158 | try {
|
2159 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "5f2e2851-1389-425b-a00b-fb2adb3ef31b", routeValues);
|
2160 | let url = verData.requestUrl;
|
2161 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2162 | let res;
|
2163 | res = yield this.rest.get(url, options);
|
2164 | let ret = this.formatResponse(res.result, null, true);
|
2165 | resolve(ret);
|
2166 | }
|
2167 | catch (err) {
|
2168 | reject(err);
|
2169 | }
|
2170 | }));
|
2171 | });
|
2172 | }
|
2173 | |
2174 |
|
2175 |
|
2176 |
|
2177 |
|
2178 |
|
2179 |
|
2180 |
|
2181 |
|
2182 |
|
2183 | getPullRequestIterationCommits(repositoryId, pullRequestId, iterationId, project, top, skip) {
|
2184 | return __awaiter(this, void 0, void 0, function* () {
|
2185 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2186 | let routeValues = {
|
2187 | project: project,
|
2188 | repositoryId: repositoryId,
|
2189 | pullRequestId: pullRequestId,
|
2190 | iterationId: iterationId
|
2191 | };
|
2192 | let queryValues = {
|
2193 | top: top,
|
2194 | skip: skip,
|
2195 | };
|
2196 | try {
|
2197 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "e7ea0883-095f-4926-b5fb-f24691c26fb9", routeValues, queryValues);
|
2198 | let url = verData.requestUrl;
|
2199 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2200 | let res;
|
2201 | res = yield this.rest.get(url, options);
|
2202 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitCommitRef, true);
|
2203 | resolve(ret);
|
2204 | }
|
2205 | catch (err) {
|
2206 | reject(err);
|
2207 | }
|
2208 | }));
|
2209 | });
|
2210 | }
|
2211 | |
2212 |
|
2213 |
|
2214 |
|
2215 |
|
2216 |
|
2217 |
|
2218 | getPullRequestCommits(repositoryId, pullRequestId, project) {
|
2219 | return __awaiter(this, void 0, void 0, function* () {
|
2220 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2221 | let routeValues = {
|
2222 | project: project,
|
2223 | repositoryId: repositoryId,
|
2224 | pullRequestId: pullRequestId
|
2225 | };
|
2226 | try {
|
2227 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "52823034-34a8-4576-922c-8d8b77e9e4c4", routeValues);
|
2228 | let url = verData.requestUrl;
|
2229 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2230 | let res;
|
2231 | res = yield this.rest.get(url, options);
|
2232 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitCommitRef, true);
|
2233 | resolve(ret);
|
2234 | }
|
2235 | catch (err) {
|
2236 | reject(err);
|
2237 | }
|
2238 | }));
|
2239 | });
|
2240 | }
|
2241 | |
2242 |
|
2243 |
|
2244 |
|
2245 |
|
2246 |
|
2247 |
|
2248 |
|
2249 | getPullRequestConflict(repositoryId, pullRequestId, conflictId, project) {
|
2250 | return __awaiter(this, void 0, void 0, function* () {
|
2251 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2252 | let routeValues = {
|
2253 | project: project,
|
2254 | repositoryId: repositoryId,
|
2255 | pullRequestId: pullRequestId,
|
2256 | conflictId: conflictId
|
2257 | };
|
2258 | try {
|
2259 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "d840fb74-bbef-42d3-b250-564604c054a4", routeValues);
|
2260 | let url = verData.requestUrl;
|
2261 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2262 | let res;
|
2263 | res = yield this.rest.get(url, options);
|
2264 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitConflict, false);
|
2265 | resolve(ret);
|
2266 | }
|
2267 | catch (err) {
|
2268 | reject(err);
|
2269 | }
|
2270 | }));
|
2271 | });
|
2272 | }
|
2273 | |
2274 |
|
2275 |
|
2276 |
|
2277 |
|
2278 |
|
2279 |
|
2280 |
|
2281 |
|
2282 |
|
2283 |
|
2284 |
|
2285 | getPullRequestConflicts(repositoryId, pullRequestId, project, skip, top, includeObsolete, excludeResolved, onlyResolved) {
|
2286 | return __awaiter(this, void 0, void 0, function* () {
|
2287 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2288 | let routeValues = {
|
2289 | project: project,
|
2290 | repositoryId: repositoryId,
|
2291 | pullRequestId: pullRequestId
|
2292 | };
|
2293 | let queryValues = {
|
2294 | '$skip': skip,
|
2295 | '$top': top,
|
2296 | includeObsolete: includeObsolete,
|
2297 | excludeResolved: excludeResolved,
|
2298 | onlyResolved: onlyResolved,
|
2299 | };
|
2300 | try {
|
2301 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "d840fb74-bbef-42d3-b250-564604c054a4", routeValues, queryValues);
|
2302 | let url = verData.requestUrl;
|
2303 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2304 | let res;
|
2305 | res = yield this.rest.get(url, options);
|
2306 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitConflict, true);
|
2307 | resolve(ret);
|
2308 | }
|
2309 | catch (err) {
|
2310 | reject(err);
|
2311 | }
|
2312 | }));
|
2313 | });
|
2314 | }
|
2315 | |
2316 |
|
2317 |
|
2318 |
|
2319 |
|
2320 |
|
2321 |
|
2322 |
|
2323 |
|
2324 | updatePullRequestConflict(conflict, repositoryId, pullRequestId, conflictId, project) {
|
2325 | return __awaiter(this, void 0, void 0, function* () {
|
2326 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2327 | let routeValues = {
|
2328 | project: project,
|
2329 | repositoryId: repositoryId,
|
2330 | pullRequestId: pullRequestId,
|
2331 | conflictId: conflictId
|
2332 | };
|
2333 | try {
|
2334 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "d840fb74-bbef-42d3-b250-564604c054a4", routeValues);
|
2335 | let url = verData.requestUrl;
|
2336 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2337 | let res;
|
2338 | res = yield this.rest.update(url, conflict, options);
|
2339 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitConflict, false);
|
2340 | resolve(ret);
|
2341 | }
|
2342 | catch (err) {
|
2343 | reject(err);
|
2344 | }
|
2345 | }));
|
2346 | });
|
2347 | }
|
2348 | |
2349 |
|
2350 |
|
2351 |
|
2352 |
|
2353 |
|
2354 |
|
2355 |
|
2356 | updatePullRequestConflicts(conflictUpdates, repositoryId, pullRequestId, project) {
|
2357 | return __awaiter(this, void 0, void 0, function* () {
|
2358 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2359 | let routeValues = {
|
2360 | project: project,
|
2361 | repositoryId: repositoryId,
|
2362 | pullRequestId: pullRequestId
|
2363 | };
|
2364 | try {
|
2365 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "d840fb74-bbef-42d3-b250-564604c054a4", routeValues);
|
2366 | let url = verData.requestUrl;
|
2367 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2368 | let res;
|
2369 | res = yield this.rest.update(url, conflictUpdates, options);
|
2370 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitConflictUpdateResult, true);
|
2371 | resolve(ret);
|
2372 | }
|
2373 | catch (err) {
|
2374 | reject(err);
|
2375 | }
|
2376 | }));
|
2377 | });
|
2378 | }
|
2379 | |
2380 |
|
2381 |
|
2382 |
|
2383 |
|
2384 |
|
2385 |
|
2386 |
|
2387 |
|
2388 |
|
2389 |
|
2390 | getPullRequestIterationChanges(repositoryId, pullRequestId, iterationId, project, top, skip, compareTo) {
|
2391 | return __awaiter(this, void 0, void 0, function* () {
|
2392 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2393 | let routeValues = {
|
2394 | project: project,
|
2395 | repositoryId: repositoryId,
|
2396 | pullRequestId: pullRequestId,
|
2397 | iterationId: iterationId
|
2398 | };
|
2399 | let queryValues = {
|
2400 | '$top': top,
|
2401 | '$skip': skip,
|
2402 | '$compareTo': compareTo,
|
2403 | };
|
2404 | try {
|
2405 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "4216bdcf-b6b1-4d59-8b82-c34cc183fc8b", routeValues, queryValues);
|
2406 | let url = verData.requestUrl;
|
2407 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2408 | let res;
|
2409 | res = yield this.rest.get(url, options);
|
2410 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPullRequestIterationChanges, false);
|
2411 | resolve(ret);
|
2412 | }
|
2413 | catch (err) {
|
2414 | reject(err);
|
2415 | }
|
2416 | }));
|
2417 | });
|
2418 | }
|
2419 | |
2420 |
|
2421 |
|
2422 |
|
2423 |
|
2424 |
|
2425 |
|
2426 |
|
2427 | getPullRequestIteration(repositoryId, pullRequestId, iterationId, project) {
|
2428 | return __awaiter(this, void 0, void 0, function* () {
|
2429 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2430 | let routeValues = {
|
2431 | project: project,
|
2432 | repositoryId: repositoryId,
|
2433 | pullRequestId: pullRequestId,
|
2434 | iterationId: iterationId
|
2435 | };
|
2436 | try {
|
2437 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "d43911ee-6958-46b0-a42b-8445b8a0d004", routeValues);
|
2438 | let url = verData.requestUrl;
|
2439 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2440 | let res;
|
2441 | res = yield this.rest.get(url, options);
|
2442 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPullRequestIteration, false);
|
2443 | resolve(ret);
|
2444 | }
|
2445 | catch (err) {
|
2446 | reject(err);
|
2447 | }
|
2448 | }));
|
2449 | });
|
2450 | }
|
2451 | |
2452 |
|
2453 |
|
2454 |
|
2455 |
|
2456 |
|
2457 |
|
2458 |
|
2459 | getPullRequestIterations(repositoryId, pullRequestId, project, includeCommits) {
|
2460 | return __awaiter(this, void 0, void 0, function* () {
|
2461 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2462 | let routeValues = {
|
2463 | project: project,
|
2464 | repositoryId: repositoryId,
|
2465 | pullRequestId: pullRequestId
|
2466 | };
|
2467 | let queryValues = {
|
2468 | includeCommits: includeCommits,
|
2469 | };
|
2470 | try {
|
2471 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "d43911ee-6958-46b0-a42b-8445b8a0d004", routeValues, queryValues);
|
2472 | let url = verData.requestUrl;
|
2473 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2474 | let res;
|
2475 | res = yield this.rest.get(url, options);
|
2476 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPullRequestIteration, true);
|
2477 | resolve(ret);
|
2478 | }
|
2479 | catch (err) {
|
2480 | reject(err);
|
2481 | }
|
2482 | }));
|
2483 | });
|
2484 | }
|
2485 | |
2486 |
|
2487 |
|
2488 |
|
2489 |
|
2490 |
|
2491 |
|
2492 |
|
2493 |
|
2494 | createPullRequestIterationStatus(status, repositoryId, pullRequestId, iterationId, project) {
|
2495 | return __awaiter(this, void 0, void 0, function* () {
|
2496 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2497 | let routeValues = {
|
2498 | project: project,
|
2499 | repositoryId: repositoryId,
|
2500 | pullRequestId: pullRequestId,
|
2501 | iterationId: iterationId
|
2502 | };
|
2503 | try {
|
2504 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "75cf11c5-979f-4038-a76e-058a06adf2bf", routeValues);
|
2505 | let url = verData.requestUrl;
|
2506 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2507 | let res;
|
2508 | res = yield this.rest.create(url, status, options);
|
2509 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPullRequestStatus, false);
|
2510 | resolve(ret);
|
2511 | }
|
2512 | catch (err) {
|
2513 | reject(err);
|
2514 | }
|
2515 | }));
|
2516 | });
|
2517 | }
|
2518 | |
2519 |
|
2520 |
|
2521 |
|
2522 |
|
2523 |
|
2524 |
|
2525 |
|
2526 |
|
2527 | deletePullRequestIterationStatus(repositoryId, pullRequestId, iterationId, statusId, project) {
|
2528 | return __awaiter(this, void 0, void 0, function* () {
|
2529 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2530 | let routeValues = {
|
2531 | project: project,
|
2532 | repositoryId: repositoryId,
|
2533 | pullRequestId: pullRequestId,
|
2534 | iterationId: iterationId,
|
2535 | statusId: statusId
|
2536 | };
|
2537 | try {
|
2538 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "75cf11c5-979f-4038-a76e-058a06adf2bf", routeValues);
|
2539 | let url = verData.requestUrl;
|
2540 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2541 | let res;
|
2542 | res = yield this.rest.del(url, options);
|
2543 | let ret = this.formatResponse(res.result, null, false);
|
2544 | resolve(ret);
|
2545 | }
|
2546 | catch (err) {
|
2547 | reject(err);
|
2548 | }
|
2549 | }));
|
2550 | });
|
2551 | }
|
2552 | |
2553 |
|
2554 |
|
2555 |
|
2556 |
|
2557 |
|
2558 |
|
2559 |
|
2560 |
|
2561 | getPullRequestIterationStatus(repositoryId, pullRequestId, iterationId, statusId, project) {
|
2562 | return __awaiter(this, void 0, void 0, function* () {
|
2563 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2564 | let routeValues = {
|
2565 | project: project,
|
2566 | repositoryId: repositoryId,
|
2567 | pullRequestId: pullRequestId,
|
2568 | iterationId: iterationId,
|
2569 | statusId: statusId
|
2570 | };
|
2571 | try {
|
2572 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "75cf11c5-979f-4038-a76e-058a06adf2bf", routeValues);
|
2573 | let url = verData.requestUrl;
|
2574 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2575 | let res;
|
2576 | res = yield this.rest.get(url, options);
|
2577 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPullRequestStatus, false);
|
2578 | resolve(ret);
|
2579 | }
|
2580 | catch (err) {
|
2581 | reject(err);
|
2582 | }
|
2583 | }));
|
2584 | });
|
2585 | }
|
2586 | |
2587 |
|
2588 |
|
2589 |
|
2590 |
|
2591 |
|
2592 |
|
2593 |
|
2594 | getPullRequestIterationStatuses(repositoryId, pullRequestId, iterationId, project) {
|
2595 | return __awaiter(this, void 0, void 0, function* () {
|
2596 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2597 | let routeValues = {
|
2598 | project: project,
|
2599 | repositoryId: repositoryId,
|
2600 | pullRequestId: pullRequestId,
|
2601 | iterationId: iterationId
|
2602 | };
|
2603 | try {
|
2604 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "75cf11c5-979f-4038-a76e-058a06adf2bf", routeValues);
|
2605 | let url = verData.requestUrl;
|
2606 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2607 | let res;
|
2608 | res = yield this.rest.get(url, options);
|
2609 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPullRequestStatus, true);
|
2610 | resolve(ret);
|
2611 | }
|
2612 | catch (err) {
|
2613 | reject(err);
|
2614 | }
|
2615 | }));
|
2616 | });
|
2617 | }
|
2618 | |
2619 |
|
2620 |
|
2621 |
|
2622 |
|
2623 |
|
2624 |
|
2625 |
|
2626 |
|
2627 | updatePullRequestIterationStatuses(customHeaders, patchDocument, repositoryId, pullRequestId, iterationId, project) {
|
2628 | return __awaiter(this, void 0, void 0, function* () {
|
2629 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2630 | let routeValues = {
|
2631 | project: project,
|
2632 | repositoryId: repositoryId,
|
2633 | pullRequestId: pullRequestId,
|
2634 | iterationId: iterationId
|
2635 | };
|
2636 | customHeaders = customHeaders || {};
|
2637 | customHeaders["Content-Type"] = "application/json-patch+json";
|
2638 | try {
|
2639 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "75cf11c5-979f-4038-a76e-058a06adf2bf", routeValues);
|
2640 | let url = verData.requestUrl;
|
2641 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2642 | options.additionalHeaders = customHeaders;
|
2643 | let res;
|
2644 | res = yield this.rest.update(url, patchDocument, options);
|
2645 | let ret = this.formatResponse(res.result, null, false);
|
2646 | resolve(ret);
|
2647 | }
|
2648 | catch (err) {
|
2649 | reject(err);
|
2650 | }
|
2651 | }));
|
2652 | });
|
2653 | }
|
2654 | |
2655 |
|
2656 |
|
2657 |
|
2658 |
|
2659 |
|
2660 |
|
2661 |
|
2662 |
|
2663 | createPullRequestLabel(label, repositoryId, pullRequestId, project, projectId) {
|
2664 | return __awaiter(this, void 0, void 0, function* () {
|
2665 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2666 | let routeValues = {
|
2667 | project: project,
|
2668 | repositoryId: repositoryId,
|
2669 | pullRequestId: pullRequestId
|
2670 | };
|
2671 | let queryValues = {
|
2672 | projectId: projectId,
|
2673 | };
|
2674 | try {
|
2675 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "f22387e3-984e-4c52-9c6d-fbb8f14c812d", routeValues, queryValues);
|
2676 | let url = verData.requestUrl;
|
2677 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2678 | let res;
|
2679 | res = yield this.rest.create(url, label, options);
|
2680 | let ret = this.formatResponse(res.result, null, false);
|
2681 | resolve(ret);
|
2682 | }
|
2683 | catch (err) {
|
2684 | reject(err);
|
2685 | }
|
2686 | }));
|
2687 | });
|
2688 | }
|
2689 | |
2690 |
|
2691 |
|
2692 |
|
2693 |
|
2694 |
|
2695 |
|
2696 |
|
2697 |
|
2698 | deletePullRequestLabels(repositoryId, pullRequestId, labelIdOrName, project, projectId) {
|
2699 | return __awaiter(this, void 0, void 0, function* () {
|
2700 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2701 | let routeValues = {
|
2702 | project: project,
|
2703 | repositoryId: repositoryId,
|
2704 | pullRequestId: pullRequestId,
|
2705 | labelIdOrName: labelIdOrName
|
2706 | };
|
2707 | let queryValues = {
|
2708 | projectId: projectId,
|
2709 | };
|
2710 | try {
|
2711 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "f22387e3-984e-4c52-9c6d-fbb8f14c812d", routeValues, queryValues);
|
2712 | let url = verData.requestUrl;
|
2713 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2714 | let res;
|
2715 | res = yield this.rest.del(url, options);
|
2716 | let ret = this.formatResponse(res.result, null, false);
|
2717 | resolve(ret);
|
2718 | }
|
2719 | catch (err) {
|
2720 | reject(err);
|
2721 | }
|
2722 | }));
|
2723 | });
|
2724 | }
|
2725 | |
2726 |
|
2727 |
|
2728 |
|
2729 |
|
2730 |
|
2731 |
|
2732 |
|
2733 |
|
2734 | getPullRequestLabel(repositoryId, pullRequestId, labelIdOrName, project, projectId) {
|
2735 | return __awaiter(this, void 0, void 0, function* () {
|
2736 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2737 | let routeValues = {
|
2738 | project: project,
|
2739 | repositoryId: repositoryId,
|
2740 | pullRequestId: pullRequestId,
|
2741 | labelIdOrName: labelIdOrName
|
2742 | };
|
2743 | let queryValues = {
|
2744 | projectId: projectId,
|
2745 | };
|
2746 | try {
|
2747 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "f22387e3-984e-4c52-9c6d-fbb8f14c812d", routeValues, queryValues);
|
2748 | let url = verData.requestUrl;
|
2749 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2750 | let res;
|
2751 | res = yield this.rest.get(url, options);
|
2752 | let ret = this.formatResponse(res.result, null, false);
|
2753 | resolve(ret);
|
2754 | }
|
2755 | catch (err) {
|
2756 | reject(err);
|
2757 | }
|
2758 | }));
|
2759 | });
|
2760 | }
|
2761 | |
2762 |
|
2763 |
|
2764 |
|
2765 |
|
2766 |
|
2767 |
|
2768 |
|
2769 | getPullRequestLabels(repositoryId, pullRequestId, project, projectId) {
|
2770 | return __awaiter(this, void 0, void 0, function* () {
|
2771 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2772 | let routeValues = {
|
2773 | project: project,
|
2774 | repositoryId: repositoryId,
|
2775 | pullRequestId: pullRequestId
|
2776 | };
|
2777 | let queryValues = {
|
2778 | projectId: projectId,
|
2779 | };
|
2780 | try {
|
2781 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "f22387e3-984e-4c52-9c6d-fbb8f14c812d", routeValues, queryValues);
|
2782 | let url = verData.requestUrl;
|
2783 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2784 | let res;
|
2785 | res = yield this.rest.get(url, options);
|
2786 | let ret = this.formatResponse(res.result, null, true);
|
2787 | resolve(ret);
|
2788 | }
|
2789 | catch (err) {
|
2790 | reject(err);
|
2791 | }
|
2792 | }));
|
2793 | });
|
2794 | }
|
2795 | |
2796 |
|
2797 |
|
2798 |
|
2799 |
|
2800 |
|
2801 |
|
2802 | getPullRequestProperties(repositoryId, pullRequestId, project) {
|
2803 | return __awaiter(this, void 0, void 0, function* () {
|
2804 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2805 | let routeValues = {
|
2806 | project: project,
|
2807 | repositoryId: repositoryId,
|
2808 | pullRequestId: pullRequestId
|
2809 | };
|
2810 | try {
|
2811 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "48a52185-5b9e-4736-9dc1-bb1e2feac80b", routeValues);
|
2812 | let url = verData.requestUrl;
|
2813 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2814 | let res;
|
2815 | res = yield this.rest.get(url, options);
|
2816 | let ret = this.formatResponse(res.result, null, false);
|
2817 | resolve(ret);
|
2818 | }
|
2819 | catch (err) {
|
2820 | reject(err);
|
2821 | }
|
2822 | }));
|
2823 | });
|
2824 | }
|
2825 | |
2826 |
|
2827 |
|
2828 |
|
2829 |
|
2830 |
|
2831 |
|
2832 |
|
2833 | updatePullRequestProperties(customHeaders, patchDocument, repositoryId, pullRequestId, project) {
|
2834 | return __awaiter(this, void 0, void 0, function* () {
|
2835 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2836 | let routeValues = {
|
2837 | project: project,
|
2838 | repositoryId: repositoryId,
|
2839 | pullRequestId: pullRequestId
|
2840 | };
|
2841 | customHeaders = customHeaders || {};
|
2842 | customHeaders["Content-Type"] = "application/json-patch+json";
|
2843 | try {
|
2844 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "48a52185-5b9e-4736-9dc1-bb1e2feac80b", routeValues);
|
2845 | let url = verData.requestUrl;
|
2846 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2847 | options.additionalHeaders = customHeaders;
|
2848 | let res;
|
2849 | res = yield this.rest.update(url, patchDocument, options);
|
2850 | let ret = this.formatResponse(res.result, null, false);
|
2851 | resolve(ret);
|
2852 | }
|
2853 | catch (err) {
|
2854 | reject(err);
|
2855 | }
|
2856 | }));
|
2857 | });
|
2858 | }
|
2859 | |
2860 |
|
2861 |
|
2862 |
|
2863 |
|
2864 |
|
2865 |
|
2866 | getPullRequestQuery(queries, repositoryId, project) {
|
2867 | return __awaiter(this, void 0, void 0, function* () {
|
2868 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2869 | let routeValues = {
|
2870 | project: project,
|
2871 | repositoryId: repositoryId
|
2872 | };
|
2873 | try {
|
2874 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "b3a6eebe-9cf0-49ea-b6cb-1a4c5f5007b0", routeValues);
|
2875 | let url = verData.requestUrl;
|
2876 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2877 | let res;
|
2878 | res = yield this.rest.create(url, queries, options);
|
2879 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPullRequestQuery, false);
|
2880 | resolve(ret);
|
2881 | }
|
2882 | catch (err) {
|
2883 | reject(err);
|
2884 | }
|
2885 | }));
|
2886 | });
|
2887 | }
|
2888 | |
2889 |
|
2890 |
|
2891 |
|
2892 |
|
2893 |
|
2894 |
|
2895 |
|
2896 |
|
2897 | createPullRequestReviewer(reviewer, repositoryId, pullRequestId, reviewerId, project) {
|
2898 | return __awaiter(this, void 0, void 0, function* () {
|
2899 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2900 | let routeValues = {
|
2901 | project: project,
|
2902 | repositoryId: repositoryId,
|
2903 | pullRequestId: pullRequestId,
|
2904 | reviewerId: reviewerId
|
2905 | };
|
2906 | try {
|
2907 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues);
|
2908 | let url = verData.requestUrl;
|
2909 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2910 | let res;
|
2911 | res = yield this.rest.replace(url, reviewer, options);
|
2912 | let ret = this.formatResponse(res.result, null, false);
|
2913 | resolve(ret);
|
2914 | }
|
2915 | catch (err) {
|
2916 | reject(err);
|
2917 | }
|
2918 | }));
|
2919 | });
|
2920 | }
|
2921 | |
2922 |
|
2923 |
|
2924 |
|
2925 |
|
2926 |
|
2927 |
|
2928 |
|
2929 | createPullRequestReviewers(reviewers, repositoryId, pullRequestId, project) {
|
2930 | return __awaiter(this, void 0, void 0, function* () {
|
2931 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2932 | let routeValues = {
|
2933 | project: project,
|
2934 | repositoryId: repositoryId,
|
2935 | pullRequestId: pullRequestId
|
2936 | };
|
2937 | try {
|
2938 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues);
|
2939 | let url = verData.requestUrl;
|
2940 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2941 | let res;
|
2942 | res = yield this.rest.create(url, reviewers, options);
|
2943 | let ret = this.formatResponse(res.result, null, true);
|
2944 | resolve(ret);
|
2945 | }
|
2946 | catch (err) {
|
2947 | reject(err);
|
2948 | }
|
2949 | }));
|
2950 | });
|
2951 | }
|
2952 | |
2953 |
|
2954 |
|
2955 |
|
2956 |
|
2957 |
|
2958 |
|
2959 |
|
2960 | createUnmaterializedPullRequestReviewer(reviewer, repositoryId, pullRequestId, project) {
|
2961 | return __awaiter(this, void 0, void 0, function* () {
|
2962 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2963 | let routeValues = {
|
2964 | project: project,
|
2965 | repositoryId: repositoryId,
|
2966 | pullRequestId: pullRequestId
|
2967 | };
|
2968 | try {
|
2969 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues);
|
2970 | let url = verData.requestUrl;
|
2971 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2972 | let res;
|
2973 | res = yield this.rest.replace(url, reviewer, options);
|
2974 | let ret = this.formatResponse(res.result, null, false);
|
2975 | resolve(ret);
|
2976 | }
|
2977 | catch (err) {
|
2978 | reject(err);
|
2979 | }
|
2980 | }));
|
2981 | });
|
2982 | }
|
2983 | |
2984 |
|
2985 |
|
2986 |
|
2987 |
|
2988 |
|
2989 |
|
2990 |
|
2991 | deletePullRequestReviewer(repositoryId, pullRequestId, reviewerId, project) {
|
2992 | return __awaiter(this, void 0, void 0, function* () {
|
2993 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2994 | let routeValues = {
|
2995 | project: project,
|
2996 | repositoryId: repositoryId,
|
2997 | pullRequestId: pullRequestId,
|
2998 | reviewerId: reviewerId
|
2999 | };
|
3000 | try {
|
3001 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues);
|
3002 | let url = verData.requestUrl;
|
3003 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3004 | let res;
|
3005 | res = yield this.rest.del(url, options);
|
3006 | let ret = this.formatResponse(res.result, null, false);
|
3007 | resolve(ret);
|
3008 | }
|
3009 | catch (err) {
|
3010 | reject(err);
|
3011 | }
|
3012 | }));
|
3013 | });
|
3014 | }
|
3015 | |
3016 |
|
3017 |
|
3018 |
|
3019 |
|
3020 |
|
3021 |
|
3022 |
|
3023 | getPullRequestReviewer(repositoryId, pullRequestId, reviewerId, project) {
|
3024 | return __awaiter(this, void 0, void 0, function* () {
|
3025 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3026 | let routeValues = {
|
3027 | project: project,
|
3028 | repositoryId: repositoryId,
|
3029 | pullRequestId: pullRequestId,
|
3030 | reviewerId: reviewerId
|
3031 | };
|
3032 | try {
|
3033 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues);
|
3034 | let url = verData.requestUrl;
|
3035 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3036 | let res;
|
3037 | res = yield this.rest.get(url, options);
|
3038 | let ret = this.formatResponse(res.result, null, false);
|
3039 | resolve(ret);
|
3040 | }
|
3041 | catch (err) {
|
3042 | reject(err);
|
3043 | }
|
3044 | }));
|
3045 | });
|
3046 | }
|
3047 | |
3048 |
|
3049 |
|
3050 |
|
3051 |
|
3052 |
|
3053 |
|
3054 | getPullRequestReviewers(repositoryId, pullRequestId, project) {
|
3055 | return __awaiter(this, void 0, void 0, function* () {
|
3056 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3057 | let routeValues = {
|
3058 | project: project,
|
3059 | repositoryId: repositoryId,
|
3060 | pullRequestId: pullRequestId
|
3061 | };
|
3062 | try {
|
3063 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues);
|
3064 | let url = verData.requestUrl;
|
3065 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3066 | let res;
|
3067 | res = yield this.rest.get(url, options);
|
3068 | let ret = this.formatResponse(res.result, null, true);
|
3069 | resolve(ret);
|
3070 | }
|
3071 | catch (err) {
|
3072 | reject(err);
|
3073 | }
|
3074 | }));
|
3075 | });
|
3076 | }
|
3077 | |
3078 |
|
3079 |
|
3080 |
|
3081 |
|
3082 |
|
3083 |
|
3084 |
|
3085 |
|
3086 | updatePullRequestReviewer(reviewer, repositoryId, pullRequestId, reviewerId, project) {
|
3087 | return __awaiter(this, void 0, void 0, function* () {
|
3088 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3089 | let routeValues = {
|
3090 | project: project,
|
3091 | repositoryId: repositoryId,
|
3092 | pullRequestId: pullRequestId,
|
3093 | reviewerId: reviewerId
|
3094 | };
|
3095 | try {
|
3096 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues);
|
3097 | let url = verData.requestUrl;
|
3098 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3099 | let res;
|
3100 | res = yield this.rest.update(url, reviewer, options);
|
3101 | let ret = this.formatResponse(res.result, null, false);
|
3102 | resolve(ret);
|
3103 | }
|
3104 | catch (err) {
|
3105 | reject(err);
|
3106 | }
|
3107 | }));
|
3108 | });
|
3109 | }
|
3110 | |
3111 |
|
3112 |
|
3113 |
|
3114 |
|
3115 |
|
3116 |
|
3117 |
|
3118 | updatePullRequestReviewers(patchVotes, repositoryId, pullRequestId, project) {
|
3119 | return __awaiter(this, void 0, void 0, function* () {
|
3120 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3121 | let routeValues = {
|
3122 | project: project,
|
3123 | repositoryId: repositoryId,
|
3124 | pullRequestId: pullRequestId
|
3125 | };
|
3126 | try {
|
3127 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "4b6702c7-aa35-4b89-9c96-b9abf6d3e540", routeValues);
|
3128 | let url = verData.requestUrl;
|
3129 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3130 | let res;
|
3131 | res = yield this.rest.update(url, patchVotes, options);
|
3132 | let ret = this.formatResponse(res.result, null, false);
|
3133 | resolve(ret);
|
3134 | }
|
3135 | catch (err) {
|
3136 | reject(err);
|
3137 | }
|
3138 | }));
|
3139 | });
|
3140 | }
|
3141 | |
3142 |
|
3143 |
|
3144 |
|
3145 |
|
3146 |
|
3147 | getPullRequestById(pullRequestId, project) {
|
3148 | return __awaiter(this, void 0, void 0, function* () {
|
3149 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3150 | let routeValues = {
|
3151 | project: project,
|
3152 | pullRequestId: pullRequestId
|
3153 | };
|
3154 | try {
|
3155 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "01a46dea-7d46-4d40-bc84-319e7c260d99", routeValues);
|
3156 | let url = verData.requestUrl;
|
3157 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3158 | let res;
|
3159 | res = yield this.rest.get(url, options);
|
3160 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPullRequest, false);
|
3161 | resolve(ret);
|
3162 | }
|
3163 | catch (err) {
|
3164 | reject(err);
|
3165 | }
|
3166 | }));
|
3167 | });
|
3168 | }
|
3169 | |
3170 |
|
3171 |
|
3172 |
|
3173 |
|
3174 |
|
3175 |
|
3176 |
|
3177 |
|
3178 | getPullRequestsByProject(project, searchCriteria, maxCommentLength, skip, top) {
|
3179 | return __awaiter(this, void 0, void 0, function* () {
|
3180 | if (searchCriteria == null) {
|
3181 | throw new TypeError('searchCriteria can not be null or undefined');
|
3182 | }
|
3183 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3184 | let routeValues = {
|
3185 | project: project
|
3186 | };
|
3187 | let queryValues = {
|
3188 | searchCriteria: searchCriteria,
|
3189 | maxCommentLength: maxCommentLength,
|
3190 | '$skip': skip,
|
3191 | '$top': top,
|
3192 | };
|
3193 | try {
|
3194 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "a5d28130-9cd2-40fa-9f08-902e7daa9efb", routeValues, queryValues);
|
3195 | let url = verData.requestUrl;
|
3196 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3197 | let res;
|
3198 | res = yield this.rest.get(url, options);
|
3199 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPullRequest, true);
|
3200 | resolve(ret);
|
3201 | }
|
3202 | catch (err) {
|
3203 | reject(err);
|
3204 | }
|
3205 | }));
|
3206 | });
|
3207 | }
|
3208 | |
3209 |
|
3210 |
|
3211 |
|
3212 |
|
3213 |
|
3214 |
|
3215 |
|
3216 | createPullRequest(gitPullRequestToCreate, repositoryId, project, supportsIterations) {
|
3217 | return __awaiter(this, void 0, void 0, function* () {
|
3218 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3219 | let routeValues = {
|
3220 | project: project,
|
3221 | repositoryId: repositoryId
|
3222 | };
|
3223 | let queryValues = {
|
3224 | supportsIterations: supportsIterations,
|
3225 | };
|
3226 | try {
|
3227 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "9946fd70-0d40-406e-b686-b4744cbbcc37", routeValues, queryValues);
|
3228 | let url = verData.requestUrl;
|
3229 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3230 | let res;
|
3231 | res = yield this.rest.create(url, gitPullRequestToCreate, options);
|
3232 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPullRequest, false);
|
3233 | resolve(ret);
|
3234 | }
|
3235 | catch (err) {
|
3236 | reject(err);
|
3237 | }
|
3238 | }));
|
3239 | });
|
3240 | }
|
3241 | |
3242 |
|
3243 |
|
3244 |
|
3245 |
|
3246 |
|
3247 |
|
3248 |
|
3249 |
|
3250 |
|
3251 |
|
3252 |
|
3253 | getPullRequest(repositoryId, pullRequestId, project, maxCommentLength, skip, top, includeCommits, includeWorkItemRefs) {
|
3254 | return __awaiter(this, void 0, void 0, function* () {
|
3255 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3256 | let routeValues = {
|
3257 | project: project,
|
3258 | repositoryId: repositoryId,
|
3259 | pullRequestId: pullRequestId
|
3260 | };
|
3261 | let queryValues = {
|
3262 | maxCommentLength: maxCommentLength,
|
3263 | '$skip': skip,
|
3264 | '$top': top,
|
3265 | includeCommits: includeCommits,
|
3266 | includeWorkItemRefs: includeWorkItemRefs,
|
3267 | };
|
3268 | try {
|
3269 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "9946fd70-0d40-406e-b686-b4744cbbcc37", routeValues, queryValues);
|
3270 | let url = verData.requestUrl;
|
3271 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3272 | let res;
|
3273 | res = yield this.rest.get(url, options);
|
3274 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPullRequest, false);
|
3275 | resolve(ret);
|
3276 | }
|
3277 | catch (err) {
|
3278 | reject(err);
|
3279 | }
|
3280 | }));
|
3281 | });
|
3282 | }
|
3283 | |
3284 |
|
3285 |
|
3286 |
|
3287 |
|
3288 |
|
3289 |
|
3290 |
|
3291 |
|
3292 |
|
3293 | getPullRequests(repositoryId, searchCriteria, project, maxCommentLength, skip, top) {
|
3294 | return __awaiter(this, void 0, void 0, function* () {
|
3295 | if (searchCriteria == null) {
|
3296 | throw new TypeError('searchCriteria can not be null or undefined');
|
3297 | }
|
3298 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3299 | let routeValues = {
|
3300 | project: project,
|
3301 | repositoryId: repositoryId
|
3302 | };
|
3303 | let queryValues = {
|
3304 | searchCriteria: searchCriteria,
|
3305 | maxCommentLength: maxCommentLength,
|
3306 | '$skip': skip,
|
3307 | '$top': top,
|
3308 | };
|
3309 | try {
|
3310 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "9946fd70-0d40-406e-b686-b4744cbbcc37", routeValues, queryValues);
|
3311 | let url = verData.requestUrl;
|
3312 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3313 | let res;
|
3314 | res = yield this.rest.get(url, options);
|
3315 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPullRequest, true);
|
3316 | resolve(ret);
|
3317 | }
|
3318 | catch (err) {
|
3319 | reject(err);
|
3320 | }
|
3321 | }));
|
3322 | });
|
3323 | }
|
3324 | |
3325 |
|
3326 |
|
3327 |
|
3328 |
|
3329 |
|
3330 |
|
3331 |
|
3332 | updatePullRequest(gitPullRequestToUpdate, repositoryId, pullRequestId, project) {
|
3333 | return __awaiter(this, void 0, void 0, function* () {
|
3334 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3335 | let routeValues = {
|
3336 | project: project,
|
3337 | repositoryId: repositoryId,
|
3338 | pullRequestId: pullRequestId
|
3339 | };
|
3340 | try {
|
3341 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "9946fd70-0d40-406e-b686-b4744cbbcc37", routeValues);
|
3342 | let url = verData.requestUrl;
|
3343 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3344 | let res;
|
3345 | res = yield this.rest.update(url, gitPullRequestToUpdate, options);
|
3346 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPullRequest, false);
|
3347 | resolve(ret);
|
3348 | }
|
3349 | catch (err) {
|
3350 | reject(err);
|
3351 | }
|
3352 | }));
|
3353 | });
|
3354 | }
|
3355 | |
3356 |
|
3357 |
|
3358 |
|
3359 |
|
3360 |
|
3361 |
|
3362 |
|
3363 | sharePullRequest(userMessage, repositoryId, pullRequestId, project) {
|
3364 | return __awaiter(this, void 0, void 0, function* () {
|
3365 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3366 | let routeValues = {
|
3367 | project: project,
|
3368 | repositoryId: repositoryId,
|
3369 | pullRequestId: pullRequestId
|
3370 | };
|
3371 | try {
|
3372 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "696f3a82-47c9-487f-9117-b9d00972ca84", routeValues);
|
3373 | let url = verData.requestUrl;
|
3374 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3375 | let res;
|
3376 | res = yield this.rest.create(url, userMessage, options);
|
3377 | let ret = this.formatResponse(res.result, null, false);
|
3378 | resolve(ret);
|
3379 | }
|
3380 | catch (err) {
|
3381 | reject(err);
|
3382 | }
|
3383 | }));
|
3384 | });
|
3385 | }
|
3386 | |
3387 |
|
3388 |
|
3389 |
|
3390 |
|
3391 |
|
3392 |
|
3393 |
|
3394 | createPullRequestStatus(status, repositoryId, pullRequestId, project) {
|
3395 | return __awaiter(this, void 0, void 0, function* () {
|
3396 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3397 | let routeValues = {
|
3398 | project: project,
|
3399 | repositoryId: repositoryId,
|
3400 | pullRequestId: pullRequestId
|
3401 | };
|
3402 | try {
|
3403 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35", routeValues);
|
3404 | let url = verData.requestUrl;
|
3405 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3406 | let res;
|
3407 | res = yield this.rest.create(url, status, options);
|
3408 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPullRequestStatus, false);
|
3409 | resolve(ret);
|
3410 | }
|
3411 | catch (err) {
|
3412 | reject(err);
|
3413 | }
|
3414 | }));
|
3415 | });
|
3416 | }
|
3417 | |
3418 |
|
3419 |
|
3420 |
|
3421 |
|
3422 |
|
3423 |
|
3424 |
|
3425 | deletePullRequestStatus(repositoryId, pullRequestId, statusId, project) {
|
3426 | return __awaiter(this, void 0, void 0, function* () {
|
3427 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3428 | let routeValues = {
|
3429 | project: project,
|
3430 | repositoryId: repositoryId,
|
3431 | pullRequestId: pullRequestId,
|
3432 | statusId: statusId
|
3433 | };
|
3434 | try {
|
3435 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35", routeValues);
|
3436 | let url = verData.requestUrl;
|
3437 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3438 | let res;
|
3439 | res = yield this.rest.del(url, options);
|
3440 | let ret = this.formatResponse(res.result, null, false);
|
3441 | resolve(ret);
|
3442 | }
|
3443 | catch (err) {
|
3444 | reject(err);
|
3445 | }
|
3446 | }));
|
3447 | });
|
3448 | }
|
3449 | |
3450 |
|
3451 |
|
3452 |
|
3453 |
|
3454 |
|
3455 |
|
3456 |
|
3457 | getPullRequestStatus(repositoryId, pullRequestId, statusId, project) {
|
3458 | return __awaiter(this, void 0, void 0, function* () {
|
3459 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3460 | let routeValues = {
|
3461 | project: project,
|
3462 | repositoryId: repositoryId,
|
3463 | pullRequestId: pullRequestId,
|
3464 | statusId: statusId
|
3465 | };
|
3466 | try {
|
3467 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35", routeValues);
|
3468 | let url = verData.requestUrl;
|
3469 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3470 | let res;
|
3471 | res = yield this.rest.get(url, options);
|
3472 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPullRequestStatus, false);
|
3473 | resolve(ret);
|
3474 | }
|
3475 | catch (err) {
|
3476 | reject(err);
|
3477 | }
|
3478 | }));
|
3479 | });
|
3480 | }
|
3481 | |
3482 |
|
3483 |
|
3484 |
|
3485 |
|
3486 |
|
3487 |
|
3488 | getPullRequestStatuses(repositoryId, pullRequestId, project) {
|
3489 | return __awaiter(this, void 0, void 0, function* () {
|
3490 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3491 | let routeValues = {
|
3492 | project: project,
|
3493 | repositoryId: repositoryId,
|
3494 | pullRequestId: pullRequestId
|
3495 | };
|
3496 | try {
|
3497 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35", routeValues);
|
3498 | let url = verData.requestUrl;
|
3499 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3500 | let res;
|
3501 | res = yield this.rest.get(url, options);
|
3502 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPullRequestStatus, true);
|
3503 | resolve(ret);
|
3504 | }
|
3505 | catch (err) {
|
3506 | reject(err);
|
3507 | }
|
3508 | }));
|
3509 | });
|
3510 | }
|
3511 | |
3512 |
|
3513 |
|
3514 |
|
3515 |
|
3516 |
|
3517 |
|
3518 |
|
3519 | updatePullRequestStatuses(customHeaders, patchDocument, repositoryId, pullRequestId, project) {
|
3520 | return __awaiter(this, void 0, void 0, function* () {
|
3521 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3522 | let routeValues = {
|
3523 | project: project,
|
3524 | repositoryId: repositoryId,
|
3525 | pullRequestId: pullRequestId
|
3526 | };
|
3527 | customHeaders = customHeaders || {};
|
3528 | customHeaders["Content-Type"] = "application/json-patch+json";
|
3529 | try {
|
3530 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35", routeValues);
|
3531 | let url = verData.requestUrl;
|
3532 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3533 | options.additionalHeaders = customHeaders;
|
3534 | let res;
|
3535 | res = yield this.rest.update(url, patchDocument, options);
|
3536 | let ret = this.formatResponse(res.result, null, false);
|
3537 | resolve(ret);
|
3538 | }
|
3539 | catch (err) {
|
3540 | reject(err);
|
3541 | }
|
3542 | }));
|
3543 | });
|
3544 | }
|
3545 | |
3546 |
|
3547 |
|
3548 |
|
3549 |
|
3550 |
|
3551 |
|
3552 |
|
3553 |
|
3554 | createComment(comment, repositoryId, pullRequestId, threadId, project) {
|
3555 | return __awaiter(this, void 0, void 0, function* () {
|
3556 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3557 | let routeValues = {
|
3558 | project: project,
|
3559 | repositoryId: repositoryId,
|
3560 | pullRequestId: pullRequestId,
|
3561 | threadId: threadId
|
3562 | };
|
3563 | try {
|
3564 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b", routeValues);
|
3565 | let url = verData.requestUrl;
|
3566 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3567 | let res;
|
3568 | res = yield this.rest.create(url, comment, options);
|
3569 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.Comment, false);
|
3570 | resolve(ret);
|
3571 | }
|
3572 | catch (err) {
|
3573 | reject(err);
|
3574 | }
|
3575 | }));
|
3576 | });
|
3577 | }
|
3578 | |
3579 |
|
3580 |
|
3581 |
|
3582 |
|
3583 |
|
3584 |
|
3585 |
|
3586 |
|
3587 | deleteComment(repositoryId, pullRequestId, threadId, commentId, project) {
|
3588 | return __awaiter(this, void 0, void 0, function* () {
|
3589 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3590 | let routeValues = {
|
3591 | project: project,
|
3592 | repositoryId: repositoryId,
|
3593 | pullRequestId: pullRequestId,
|
3594 | threadId: threadId,
|
3595 | commentId: commentId
|
3596 | };
|
3597 | try {
|
3598 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b", routeValues);
|
3599 | let url = verData.requestUrl;
|
3600 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3601 | let res;
|
3602 | res = yield this.rest.del(url, options);
|
3603 | let ret = this.formatResponse(res.result, null, false);
|
3604 | resolve(ret);
|
3605 | }
|
3606 | catch (err) {
|
3607 | reject(err);
|
3608 | }
|
3609 | }));
|
3610 | });
|
3611 | }
|
3612 | |
3613 |
|
3614 |
|
3615 |
|
3616 |
|
3617 |
|
3618 |
|
3619 |
|
3620 |
|
3621 | getComment(repositoryId, pullRequestId, threadId, commentId, project) {
|
3622 | return __awaiter(this, void 0, void 0, function* () {
|
3623 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3624 | let routeValues = {
|
3625 | project: project,
|
3626 | repositoryId: repositoryId,
|
3627 | pullRequestId: pullRequestId,
|
3628 | threadId: threadId,
|
3629 | commentId: commentId
|
3630 | };
|
3631 | try {
|
3632 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b", routeValues);
|
3633 | let url = verData.requestUrl;
|
3634 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3635 | let res;
|
3636 | res = yield this.rest.get(url, options);
|
3637 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.Comment, false);
|
3638 | resolve(ret);
|
3639 | }
|
3640 | catch (err) {
|
3641 | reject(err);
|
3642 | }
|
3643 | }));
|
3644 | });
|
3645 | }
|
3646 | |
3647 |
|
3648 |
|
3649 |
|
3650 |
|
3651 |
|
3652 |
|
3653 |
|
3654 | getComments(repositoryId, pullRequestId, threadId, project) {
|
3655 | return __awaiter(this, void 0, void 0, function* () {
|
3656 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3657 | let routeValues = {
|
3658 | project: project,
|
3659 | repositoryId: repositoryId,
|
3660 | pullRequestId: pullRequestId,
|
3661 | threadId: threadId
|
3662 | };
|
3663 | try {
|
3664 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b", routeValues);
|
3665 | let url = verData.requestUrl;
|
3666 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3667 | let res;
|
3668 | res = yield this.rest.get(url, options);
|
3669 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.Comment, true);
|
3670 | resolve(ret);
|
3671 | }
|
3672 | catch (err) {
|
3673 | reject(err);
|
3674 | }
|
3675 | }));
|
3676 | });
|
3677 | }
|
3678 | |
3679 |
|
3680 |
|
3681 |
|
3682 |
|
3683 |
|
3684 |
|
3685 |
|
3686 |
|
3687 |
|
3688 | updateComment(comment, repositoryId, pullRequestId, threadId, commentId, project) {
|
3689 | return __awaiter(this, void 0, void 0, function* () {
|
3690 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3691 | let routeValues = {
|
3692 | project: project,
|
3693 | repositoryId: repositoryId,
|
3694 | pullRequestId: pullRequestId,
|
3695 | threadId: threadId,
|
3696 | commentId: commentId
|
3697 | };
|
3698 | try {
|
3699 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b", routeValues);
|
3700 | let url = verData.requestUrl;
|
3701 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3702 | let res;
|
3703 | res = yield this.rest.update(url, comment, options);
|
3704 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.Comment, false);
|
3705 | resolve(ret);
|
3706 | }
|
3707 | catch (err) {
|
3708 | reject(err);
|
3709 | }
|
3710 | }));
|
3711 | });
|
3712 | }
|
3713 | |
3714 |
|
3715 |
|
3716 |
|
3717 |
|
3718 |
|
3719 |
|
3720 |
|
3721 | createThread(commentThread, repositoryId, pullRequestId, project) {
|
3722 | return __awaiter(this, void 0, void 0, function* () {
|
3723 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3724 | let routeValues = {
|
3725 | project: project,
|
3726 | repositoryId: repositoryId,
|
3727 | pullRequestId: pullRequestId
|
3728 | };
|
3729 | try {
|
3730 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "ab6e2e5d-a0b7-4153-b64a-a4efe0d49449", routeValues);
|
3731 | let url = verData.requestUrl;
|
3732 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3733 | let res;
|
3734 | res = yield this.rest.create(url, commentThread, options);
|
3735 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPullRequestCommentThread, false);
|
3736 | resolve(ret);
|
3737 | }
|
3738 | catch (err) {
|
3739 | reject(err);
|
3740 | }
|
3741 | }));
|
3742 | });
|
3743 | }
|
3744 | |
3745 |
|
3746 |
|
3747 |
|
3748 |
|
3749 |
|
3750 |
|
3751 |
|
3752 |
|
3753 |
|
3754 | getPullRequestThread(repositoryId, pullRequestId, threadId, project, iteration, baseIteration) {
|
3755 | return __awaiter(this, void 0, void 0, function* () {
|
3756 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3757 | let routeValues = {
|
3758 | project: project,
|
3759 | repositoryId: repositoryId,
|
3760 | pullRequestId: pullRequestId,
|
3761 | threadId: threadId
|
3762 | };
|
3763 | let queryValues = {
|
3764 | '$iteration': iteration,
|
3765 | '$baseIteration': baseIteration,
|
3766 | };
|
3767 | try {
|
3768 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "ab6e2e5d-a0b7-4153-b64a-a4efe0d49449", routeValues, queryValues);
|
3769 | let url = verData.requestUrl;
|
3770 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3771 | let res;
|
3772 | res = yield this.rest.get(url, options);
|
3773 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPullRequestCommentThread, false);
|
3774 | resolve(ret);
|
3775 | }
|
3776 | catch (err) {
|
3777 | reject(err);
|
3778 | }
|
3779 | }));
|
3780 | });
|
3781 | }
|
3782 | |
3783 |
|
3784 |
|
3785 |
|
3786 |
|
3787 |
|
3788 |
|
3789 |
|
3790 |
|
3791 | getThreads(repositoryId, pullRequestId, project, iteration, baseIteration) {
|
3792 | return __awaiter(this, void 0, void 0, function* () {
|
3793 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3794 | let routeValues = {
|
3795 | project: project,
|
3796 | repositoryId: repositoryId,
|
3797 | pullRequestId: pullRequestId
|
3798 | };
|
3799 | let queryValues = {
|
3800 | '$iteration': iteration,
|
3801 | '$baseIteration': baseIteration,
|
3802 | };
|
3803 | try {
|
3804 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "ab6e2e5d-a0b7-4153-b64a-a4efe0d49449", routeValues, queryValues);
|
3805 | let url = verData.requestUrl;
|
3806 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3807 | let res;
|
3808 | res = yield this.rest.get(url, options);
|
3809 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPullRequestCommentThread, true);
|
3810 | resolve(ret);
|
3811 | }
|
3812 | catch (err) {
|
3813 | reject(err);
|
3814 | }
|
3815 | }));
|
3816 | });
|
3817 | }
|
3818 | |
3819 |
|
3820 |
|
3821 |
|
3822 |
|
3823 |
|
3824 |
|
3825 |
|
3826 |
|
3827 | updateThread(commentThread, repositoryId, pullRequestId, threadId, project) {
|
3828 | return __awaiter(this, void 0, void 0, function* () {
|
3829 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3830 | let routeValues = {
|
3831 | project: project,
|
3832 | repositoryId: repositoryId,
|
3833 | pullRequestId: pullRequestId,
|
3834 | threadId: threadId
|
3835 | };
|
3836 | try {
|
3837 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "ab6e2e5d-a0b7-4153-b64a-a4efe0d49449", routeValues);
|
3838 | let url = verData.requestUrl;
|
3839 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3840 | let res;
|
3841 | res = yield this.rest.update(url, commentThread, options);
|
3842 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPullRequestCommentThread, false);
|
3843 | resolve(ret);
|
3844 | }
|
3845 | catch (err) {
|
3846 | reject(err);
|
3847 | }
|
3848 | }));
|
3849 | });
|
3850 | }
|
3851 | |
3852 |
|
3853 |
|
3854 |
|
3855 |
|
3856 |
|
3857 |
|
3858 | getPullRequestWorkItemRefs(repositoryId, pullRequestId, project) {
|
3859 | return __awaiter(this, void 0, void 0, function* () {
|
3860 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3861 | let routeValues = {
|
3862 | project: project,
|
3863 | repositoryId: repositoryId,
|
3864 | pullRequestId: pullRequestId
|
3865 | };
|
3866 | try {
|
3867 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "0a637fcc-5370-4ce8-b0e8-98091f5f9482", routeValues);
|
3868 | let url = verData.requestUrl;
|
3869 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3870 | let res;
|
3871 | res = yield this.rest.get(url, options);
|
3872 | let ret = this.formatResponse(res.result, null, true);
|
3873 | resolve(ret);
|
3874 | }
|
3875 | catch (err) {
|
3876 | reject(err);
|
3877 | }
|
3878 | }));
|
3879 | });
|
3880 | }
|
3881 | |
3882 |
|
3883 |
|
3884 |
|
3885 |
|
3886 |
|
3887 |
|
3888 | createPush(push, repositoryId, project) {
|
3889 | return __awaiter(this, void 0, void 0, function* () {
|
3890 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3891 | let routeValues = {
|
3892 | project: project,
|
3893 | repositoryId: repositoryId
|
3894 | };
|
3895 | try {
|
3896 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "git", "ea98d07b-3c87-4971-8ede-a613694ffb55", routeValues);
|
3897 | let url = verData.requestUrl;
|
3898 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3899 | let res;
|
3900 | res = yield this.rest.create(url, push, options);
|
3901 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPush, false);
|
3902 | resolve(ret);
|
3903 | }
|
3904 | catch (err) {
|
3905 | reject(err);
|
3906 | }
|
3907 | }));
|
3908 | });
|
3909 | }
|
3910 | |
3911 |
|
3912 |
|
3913 |
|
3914 |
|
3915 |
|
3916 |
|
3917 |
|
3918 |
|
3919 | getPush(repositoryId, pushId, project, includeCommits, includeRefUpdates) {
|
3920 | return __awaiter(this, void 0, void 0, function* () {
|
3921 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3922 | let routeValues = {
|
3923 | project: project,
|
3924 | repositoryId: repositoryId,
|
3925 | pushId: pushId
|
3926 | };
|
3927 | let queryValues = {
|
3928 | includeCommits: includeCommits,
|
3929 | includeRefUpdates: includeRefUpdates,
|
3930 | };
|
3931 | try {
|
3932 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "git", "ea98d07b-3c87-4971-8ede-a613694ffb55", routeValues, queryValues);
|
3933 | let url = verData.requestUrl;
|
3934 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3935 | let res;
|
3936 | res = yield this.rest.get(url, options);
|
3937 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPush, false);
|
3938 | resolve(ret);
|
3939 | }
|
3940 | catch (err) {
|
3941 | reject(err);
|
3942 | }
|
3943 | }));
|
3944 | });
|
3945 | }
|
3946 | |
3947 |
|
3948 |
|
3949 |
|
3950 |
|
3951 |
|
3952 |
|
3953 |
|
3954 |
|
3955 | getPushes(repositoryId, project, skip, top, searchCriteria) {
|
3956 | return __awaiter(this, void 0, void 0, function* () {
|
3957 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3958 | let routeValues = {
|
3959 | project: project,
|
3960 | repositoryId: repositoryId
|
3961 | };
|
3962 | let queryValues = {
|
3963 | '$skip': skip,
|
3964 | '$top': top,
|
3965 | searchCriteria: searchCriteria,
|
3966 | };
|
3967 | try {
|
3968 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "git", "ea98d07b-3c87-4971-8ede-a613694ffb55", routeValues, queryValues);
|
3969 | let url = verData.requestUrl;
|
3970 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3971 | let res;
|
3972 | res = yield this.rest.get(url, options);
|
3973 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitPush, true);
|
3974 | resolve(ret);
|
3975 | }
|
3976 | catch (err) {
|
3977 | reject(err);
|
3978 | }
|
3979 | }));
|
3980 | });
|
3981 | }
|
3982 | |
3983 |
|
3984 |
|
3985 |
|
3986 |
|
3987 |
|
3988 | deleteRepositoryFromRecycleBin(project, repositoryId) {
|
3989 | return __awaiter(this, void 0, void 0, function* () {
|
3990 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
3991 | let routeValues = {
|
3992 | project: project,
|
3993 | repositoryId: repositoryId
|
3994 | };
|
3995 | try {
|
3996 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "a663da97-81db-4eb3-8b83-287670f63073", routeValues);
|
3997 | let url = verData.requestUrl;
|
3998 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
3999 | let res;
|
4000 | res = yield this.rest.del(url, options);
|
4001 | let ret = this.formatResponse(res.result, null, false);
|
4002 | resolve(ret);
|
4003 | }
|
4004 | catch (err) {
|
4005 | reject(err);
|
4006 | }
|
4007 | }));
|
4008 | });
|
4009 | }
|
4010 | |
4011 |
|
4012 |
|
4013 |
|
4014 |
|
4015 | getRecycleBinRepositories(project) {
|
4016 | return __awaiter(this, void 0, void 0, function* () {
|
4017 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4018 | let routeValues = {
|
4019 | project: project
|
4020 | };
|
4021 | try {
|
4022 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "a663da97-81db-4eb3-8b83-287670f63073", routeValues);
|
4023 | let url = verData.requestUrl;
|
4024 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4025 | let res;
|
4026 | res = yield this.rest.get(url, options);
|
4027 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitDeletedRepository, true);
|
4028 | resolve(ret);
|
4029 | }
|
4030 | catch (err) {
|
4031 | reject(err);
|
4032 | }
|
4033 | }));
|
4034 | });
|
4035 | }
|
4036 | |
4037 |
|
4038 |
|
4039 |
|
4040 |
|
4041 |
|
4042 |
|
4043 | restoreRepositoryFromRecycleBin(repositoryDetails, project, repositoryId) {
|
4044 | return __awaiter(this, void 0, void 0, function* () {
|
4045 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4046 | let routeValues = {
|
4047 | project: project,
|
4048 | repositoryId: repositoryId
|
4049 | };
|
4050 | try {
|
4051 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "a663da97-81db-4eb3-8b83-287670f63073", routeValues);
|
4052 | let url = verData.requestUrl;
|
4053 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4054 | let res;
|
4055 | res = yield this.rest.update(url, repositoryDetails, options);
|
4056 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitRepository, false);
|
4057 | resolve(ret);
|
4058 | }
|
4059 | catch (err) {
|
4060 | reject(err);
|
4061 | }
|
4062 | }));
|
4063 | });
|
4064 | }
|
4065 | |
4066 |
|
4067 |
|
4068 |
|
4069 |
|
4070 |
|
4071 |
|
4072 |
|
4073 |
|
4074 |
|
4075 |
|
4076 |
|
4077 |
|
4078 | getRefs(repositoryId, project, filter, includeLinks, includeStatuses, includeMyBranches, latestStatusesOnly, peelTags, filterContains) {
|
4079 | return __awaiter(this, void 0, void 0, function* () {
|
4080 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4081 | let routeValues = {
|
4082 | project: project,
|
4083 | repositoryId: repositoryId
|
4084 | };
|
4085 | let queryValues = {
|
4086 | filter: filter,
|
4087 | includeLinks: includeLinks,
|
4088 | includeStatuses: includeStatuses,
|
4089 | includeMyBranches: includeMyBranches,
|
4090 | latestStatusesOnly: latestStatusesOnly,
|
4091 | peelTags: peelTags,
|
4092 | filterContains: filterContains,
|
4093 | };
|
4094 | try {
|
4095 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "2d874a60-a811-4f62-9c9f-963a6ea0a55b", routeValues, queryValues);
|
4096 | let url = verData.requestUrl;
|
4097 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4098 | let res;
|
4099 | res = yield this.rest.get(url, options);
|
4100 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitRef, true);
|
4101 | resolve(ret);
|
4102 | }
|
4103 | catch (err) {
|
4104 | reject(err);
|
4105 | }
|
4106 | }));
|
4107 | });
|
4108 | }
|
4109 | |
4110 |
|
4111 |
|
4112 |
|
4113 |
|
4114 |
|
4115 |
|
4116 |
|
4117 |
|
4118 | updateRef(newRefInfo, repositoryId, filter, project, projectId) {
|
4119 | return __awaiter(this, void 0, void 0, function* () {
|
4120 | if (filter == null) {
|
4121 | throw new TypeError('filter can not be null or undefined');
|
4122 | }
|
4123 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4124 | let routeValues = {
|
4125 | project: project,
|
4126 | repositoryId: repositoryId
|
4127 | };
|
4128 | let queryValues = {
|
4129 | filter: filter,
|
4130 | projectId: projectId,
|
4131 | };
|
4132 | try {
|
4133 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "2d874a60-a811-4f62-9c9f-963a6ea0a55b", routeValues, queryValues);
|
4134 | let url = verData.requestUrl;
|
4135 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4136 | let res;
|
4137 | res = yield this.rest.update(url, newRefInfo, options);
|
4138 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitRef, false);
|
4139 | resolve(ret);
|
4140 | }
|
4141 | catch (err) {
|
4142 | reject(err);
|
4143 | }
|
4144 | }));
|
4145 | });
|
4146 | }
|
4147 | |
4148 |
|
4149 |
|
4150 |
|
4151 |
|
4152 |
|
4153 |
|
4154 |
|
4155 | updateRefs(refUpdates, repositoryId, project, projectId) {
|
4156 | return __awaiter(this, void 0, void 0, function* () {
|
4157 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4158 | let routeValues = {
|
4159 | project: project,
|
4160 | repositoryId: repositoryId
|
4161 | };
|
4162 | let queryValues = {
|
4163 | projectId: projectId,
|
4164 | };
|
4165 | try {
|
4166 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "2d874a60-a811-4f62-9c9f-963a6ea0a55b", routeValues, queryValues);
|
4167 | let url = verData.requestUrl;
|
4168 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4169 | let res;
|
4170 | res = yield this.rest.create(url, refUpdates, options);
|
4171 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitRefUpdateResult, true);
|
4172 | resolve(ret);
|
4173 | }
|
4174 | catch (err) {
|
4175 | reject(err);
|
4176 | }
|
4177 | }));
|
4178 | });
|
4179 | }
|
4180 | |
4181 |
|
4182 |
|
4183 |
|
4184 |
|
4185 |
|
4186 | createFavorite(favorite, project) {
|
4187 | return __awaiter(this, void 0, void 0, function* () {
|
4188 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4189 | let routeValues = {
|
4190 | project: project
|
4191 | };
|
4192 | try {
|
4193 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "876f70af-5792-485a-a1c7-d0a7b2f42bbb", routeValues);
|
4194 | let url = verData.requestUrl;
|
4195 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4196 | let res;
|
4197 | res = yield this.rest.create(url, favorite, options);
|
4198 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitRefFavorite, false);
|
4199 | resolve(ret);
|
4200 | }
|
4201 | catch (err) {
|
4202 | reject(err);
|
4203 | }
|
4204 | }));
|
4205 | });
|
4206 | }
|
4207 | |
4208 |
|
4209 |
|
4210 |
|
4211 |
|
4212 |
|
4213 | deleteRefFavorite(project, favoriteId) {
|
4214 | return __awaiter(this, void 0, void 0, function* () {
|
4215 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4216 | let routeValues = {
|
4217 | project: project,
|
4218 | favoriteId: favoriteId
|
4219 | };
|
4220 | try {
|
4221 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "876f70af-5792-485a-a1c7-d0a7b2f42bbb", routeValues);
|
4222 | let url = verData.requestUrl;
|
4223 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4224 | let res;
|
4225 | res = yield this.rest.del(url, options);
|
4226 | let ret = this.formatResponse(res.result, null, false);
|
4227 | resolve(ret);
|
4228 | }
|
4229 | catch (err) {
|
4230 | reject(err);
|
4231 | }
|
4232 | }));
|
4233 | });
|
4234 | }
|
4235 | |
4236 |
|
4237 |
|
4238 |
|
4239 |
|
4240 |
|
4241 | getRefFavorite(project, favoriteId) {
|
4242 | return __awaiter(this, void 0, void 0, function* () {
|
4243 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4244 | let routeValues = {
|
4245 | project: project,
|
4246 | favoriteId: favoriteId
|
4247 | };
|
4248 | try {
|
4249 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "876f70af-5792-485a-a1c7-d0a7b2f42bbb", routeValues);
|
4250 | let url = verData.requestUrl;
|
4251 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4252 | let res;
|
4253 | res = yield this.rest.get(url, options);
|
4254 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitRefFavorite, false);
|
4255 | resolve(ret);
|
4256 | }
|
4257 | catch (err) {
|
4258 | reject(err);
|
4259 | }
|
4260 | }));
|
4261 | });
|
4262 | }
|
4263 | |
4264 |
|
4265 |
|
4266 |
|
4267 |
|
4268 |
|
4269 |
|
4270 | getRefFavorites(project, repositoryId, identityId) {
|
4271 | return __awaiter(this, void 0, void 0, function* () {
|
4272 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4273 | let routeValues = {
|
4274 | project: project
|
4275 | };
|
4276 | let queryValues = {
|
4277 | repositoryId: repositoryId,
|
4278 | identityId: identityId,
|
4279 | };
|
4280 | try {
|
4281 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "876f70af-5792-485a-a1c7-d0a7b2f42bbb", routeValues, queryValues);
|
4282 | let url = verData.requestUrl;
|
4283 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4284 | let res;
|
4285 | res = yield this.rest.get(url, options);
|
4286 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitRefFavorite, true);
|
4287 | resolve(ret);
|
4288 | }
|
4289 | catch (err) {
|
4290 | reject(err);
|
4291 | }
|
4292 | }));
|
4293 | });
|
4294 | }
|
4295 | |
4296 |
|
4297 |
|
4298 |
|
4299 | getRefFavoritesForProject(project, identityId) {
|
4300 | return __awaiter(this, void 0, void 0, function* () {
|
4301 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4302 | let routeValues = {
|
4303 | project: project
|
4304 | };
|
4305 | let queryValues = {
|
4306 | identityId: identityId,
|
4307 | };
|
4308 | try {
|
4309 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "4720896c-594c-4a6d-b94c-12eddd80b34a", routeValues, queryValues);
|
4310 | let url = verData.requestUrl;
|
4311 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4312 | let res;
|
4313 | res = yield this.rest.get(url, options);
|
4314 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitRefFavorite, true);
|
4315 | resolve(ret);
|
4316 | }
|
4317 | catch (err) {
|
4318 | reject(err);
|
4319 | }
|
4320 | }));
|
4321 | });
|
4322 | }
|
4323 | |
4324 |
|
4325 |
|
4326 |
|
4327 |
|
4328 |
|
4329 |
|
4330 | createRepository(gitRepositoryToCreate, project, sourceRef) {
|
4331 | return __awaiter(this, void 0, void 0, function* () {
|
4332 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4333 | let routeValues = {
|
4334 | project: project
|
4335 | };
|
4336 | let queryValues = {
|
4337 | sourceRef: sourceRef,
|
4338 | };
|
4339 | try {
|
4340 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "225f7195-f9c7-4d14-ab28-a83f7ff77e1f", routeValues, queryValues);
|
4341 | let url = verData.requestUrl;
|
4342 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4343 | let res;
|
4344 | res = yield this.rest.create(url, gitRepositoryToCreate, options);
|
4345 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitRepository, false);
|
4346 | resolve(ret);
|
4347 | }
|
4348 | catch (err) {
|
4349 | reject(err);
|
4350 | }
|
4351 | }));
|
4352 | });
|
4353 | }
|
4354 | |
4355 |
|
4356 |
|
4357 |
|
4358 |
|
4359 |
|
4360 | deleteRepository(repositoryId, project) {
|
4361 | return __awaiter(this, void 0, void 0, function* () {
|
4362 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4363 | let routeValues = {
|
4364 | project: project,
|
4365 | repositoryId: repositoryId
|
4366 | };
|
4367 | try {
|
4368 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "225f7195-f9c7-4d14-ab28-a83f7ff77e1f", routeValues);
|
4369 | let url = verData.requestUrl;
|
4370 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4371 | let res;
|
4372 | res = yield this.rest.del(url, options);
|
4373 | let ret = this.formatResponse(res.result, null, false);
|
4374 | resolve(ret);
|
4375 | }
|
4376 | catch (err) {
|
4377 | reject(err);
|
4378 | }
|
4379 | }));
|
4380 | });
|
4381 | }
|
4382 | |
4383 |
|
4384 |
|
4385 |
|
4386 |
|
4387 |
|
4388 |
|
4389 |
|
4390 | getRepositories(project, includeLinks, includeAllUrls, includeHidden) {
|
4391 | return __awaiter(this, void 0, void 0, function* () {
|
4392 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4393 | let routeValues = {
|
4394 | project: project
|
4395 | };
|
4396 | let queryValues = {
|
4397 | includeLinks: includeLinks,
|
4398 | includeAllUrls: includeAllUrls,
|
4399 | includeHidden: includeHidden,
|
4400 | };
|
4401 | try {
|
4402 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "225f7195-f9c7-4d14-ab28-a83f7ff77e1f", routeValues, queryValues);
|
4403 | let url = verData.requestUrl;
|
4404 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4405 | let res;
|
4406 | res = yield this.rest.get(url, options);
|
4407 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitRepository, true);
|
4408 | resolve(ret);
|
4409 | }
|
4410 | catch (err) {
|
4411 | reject(err);
|
4412 | }
|
4413 | }));
|
4414 | });
|
4415 | }
|
4416 | |
4417 |
|
4418 |
|
4419 |
|
4420 |
|
4421 |
|
4422 | getRepository(repositoryId, project) {
|
4423 | return __awaiter(this, void 0, void 0, function* () {
|
4424 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4425 | let routeValues = {
|
4426 | project: project,
|
4427 | repositoryId: repositoryId
|
4428 | };
|
4429 | try {
|
4430 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "225f7195-f9c7-4d14-ab28-a83f7ff77e1f", routeValues);
|
4431 | let url = verData.requestUrl;
|
4432 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4433 | let res;
|
4434 | res = yield this.rest.get(url, options);
|
4435 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitRepository, false);
|
4436 | resolve(ret);
|
4437 | }
|
4438 | catch (err) {
|
4439 | reject(err);
|
4440 | }
|
4441 | }));
|
4442 | });
|
4443 | }
|
4444 | |
4445 |
|
4446 |
|
4447 |
|
4448 |
|
4449 |
|
4450 |
|
4451 | getRepositoryWithParent(repositoryId, includeParent, project) {
|
4452 | return __awaiter(this, void 0, void 0, function* () {
|
4453 | if (includeParent == null) {
|
4454 | throw new TypeError('includeParent can not be null or undefined');
|
4455 | }
|
4456 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4457 | let routeValues = {
|
4458 | project: project,
|
4459 | repositoryId: repositoryId
|
4460 | };
|
4461 | let queryValues = {
|
4462 | includeParent: includeParent,
|
4463 | };
|
4464 | try {
|
4465 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "225f7195-f9c7-4d14-ab28-a83f7ff77e1f", routeValues, queryValues);
|
4466 | let url = verData.requestUrl;
|
4467 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4468 | let res;
|
4469 | res = yield this.rest.get(url, options);
|
4470 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitRepository, false);
|
4471 | resolve(ret);
|
4472 | }
|
4473 | catch (err) {
|
4474 | reject(err);
|
4475 | }
|
4476 | }));
|
4477 | });
|
4478 | }
|
4479 | |
4480 |
|
4481 |
|
4482 |
|
4483 |
|
4484 |
|
4485 |
|
4486 | updateRepository(newRepositoryInfo, repositoryId, project) {
|
4487 | return __awaiter(this, void 0, void 0, function* () {
|
4488 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4489 | let routeValues = {
|
4490 | project: project,
|
4491 | repositoryId: repositoryId
|
4492 | };
|
4493 | try {
|
4494 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "225f7195-f9c7-4d14-ab28-a83f7ff77e1f", routeValues);
|
4495 | let url = verData.requestUrl;
|
4496 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4497 | let res;
|
4498 | res = yield this.rest.update(url, newRepositoryInfo, options);
|
4499 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitRepository, false);
|
4500 | resolve(ret);
|
4501 | }
|
4502 | catch (err) {
|
4503 | reject(err);
|
4504 | }
|
4505 | }));
|
4506 | });
|
4507 | }
|
4508 | |
4509 |
|
4510 |
|
4511 |
|
4512 |
|
4513 |
|
4514 |
|
4515 |
|
4516 | getRevertConflict(repositoryId, revertId, conflictId, project) {
|
4517 | return __awaiter(this, void 0, void 0, function* () {
|
4518 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4519 | let routeValues = {
|
4520 | project: project,
|
4521 | repositoryId: repositoryId,
|
4522 | revertId: revertId,
|
4523 | conflictId: conflictId
|
4524 | };
|
4525 | try {
|
4526 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "10d7ae6d-1050-446d-852a-bd5d99f834bf", routeValues);
|
4527 | let url = verData.requestUrl;
|
4528 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4529 | let res;
|
4530 | res = yield this.rest.get(url, options);
|
4531 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitConflict, false);
|
4532 | resolve(ret);
|
4533 | }
|
4534 | catch (err) {
|
4535 | reject(err);
|
4536 | }
|
4537 | }));
|
4538 | });
|
4539 | }
|
4540 | |
4541 |
|
4542 |
|
4543 |
|
4544 |
|
4545 |
|
4546 |
|
4547 |
|
4548 |
|
4549 |
|
4550 |
|
4551 |
|
4552 | getRevertConflicts(repositoryId, revertId, project, continuationToken, top, excludeResolved, onlyResolved, includeObsolete) {
|
4553 | return __awaiter(this, void 0, void 0, function* () {
|
4554 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4555 | let routeValues = {
|
4556 | project: project,
|
4557 | repositoryId: repositoryId,
|
4558 | revertId: revertId
|
4559 | };
|
4560 | let queryValues = {
|
4561 | continuationToken: continuationToken,
|
4562 | '$top': top,
|
4563 | excludeResolved: excludeResolved,
|
4564 | onlyResolved: onlyResolved,
|
4565 | includeObsolete: includeObsolete,
|
4566 | };
|
4567 | try {
|
4568 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "10d7ae6d-1050-446d-852a-bd5d99f834bf", routeValues, queryValues);
|
4569 | let url = verData.requestUrl;
|
4570 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4571 | let res;
|
4572 | res = yield this.rest.get(url, options);
|
4573 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitConflict, true);
|
4574 | resolve(ret);
|
4575 | }
|
4576 | catch (err) {
|
4577 | reject(err);
|
4578 | }
|
4579 | }));
|
4580 | });
|
4581 | }
|
4582 | |
4583 |
|
4584 |
|
4585 |
|
4586 |
|
4587 |
|
4588 |
|
4589 |
|
4590 |
|
4591 | updateRevertConflict(conflict, repositoryId, revertId, conflictId, project) {
|
4592 | return __awaiter(this, void 0, void 0, function* () {
|
4593 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4594 | let routeValues = {
|
4595 | project: project,
|
4596 | repositoryId: repositoryId,
|
4597 | revertId: revertId,
|
4598 | conflictId: conflictId
|
4599 | };
|
4600 | try {
|
4601 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "10d7ae6d-1050-446d-852a-bd5d99f834bf", routeValues);
|
4602 | let url = verData.requestUrl;
|
4603 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4604 | let res;
|
4605 | res = yield this.rest.update(url, conflict, options);
|
4606 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitConflict, false);
|
4607 | resolve(ret);
|
4608 | }
|
4609 | catch (err) {
|
4610 | reject(err);
|
4611 | }
|
4612 | }));
|
4613 | });
|
4614 | }
|
4615 | |
4616 |
|
4617 |
|
4618 |
|
4619 |
|
4620 |
|
4621 |
|
4622 |
|
4623 | updateRevertConflicts(conflictUpdates, repositoryId, revertId, project) {
|
4624 | return __awaiter(this, void 0, void 0, function* () {
|
4625 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4626 | let routeValues = {
|
4627 | project: project,
|
4628 | repositoryId: repositoryId,
|
4629 | revertId: revertId
|
4630 | };
|
4631 | try {
|
4632 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "10d7ae6d-1050-446d-852a-bd5d99f834bf", routeValues);
|
4633 | let url = verData.requestUrl;
|
4634 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4635 | let res;
|
4636 | res = yield this.rest.update(url, conflictUpdates, options);
|
4637 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitConflictUpdateResult, true);
|
4638 | resolve(ret);
|
4639 | }
|
4640 | catch (err) {
|
4641 | reject(err);
|
4642 | }
|
4643 | }));
|
4644 | });
|
4645 | }
|
4646 | |
4647 |
|
4648 |
|
4649 |
|
4650 |
|
4651 |
|
4652 |
|
4653 | createRevert(revertToCreate, project, repositoryId) {
|
4654 | return __awaiter(this, void 0, void 0, function* () {
|
4655 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4656 | let routeValues = {
|
4657 | project: project,
|
4658 | repositoryId: repositoryId
|
4659 | };
|
4660 | try {
|
4661 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "bc866058-5449-4715-9cf1-a510b6ff193c", routeValues);
|
4662 | let url = verData.requestUrl;
|
4663 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4664 | let res;
|
4665 | res = yield this.rest.create(url, revertToCreate, options);
|
4666 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitRevert, false);
|
4667 | resolve(ret);
|
4668 | }
|
4669 | catch (err) {
|
4670 | reject(err);
|
4671 | }
|
4672 | }));
|
4673 | });
|
4674 | }
|
4675 | |
4676 |
|
4677 |
|
4678 |
|
4679 |
|
4680 |
|
4681 |
|
4682 | getRevert(project, revertId, repositoryId) {
|
4683 | return __awaiter(this, void 0, void 0, function* () {
|
4684 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4685 | let routeValues = {
|
4686 | project: project,
|
4687 | revertId: revertId,
|
4688 | repositoryId: repositoryId
|
4689 | };
|
4690 | try {
|
4691 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "bc866058-5449-4715-9cf1-a510b6ff193c", routeValues);
|
4692 | let url = verData.requestUrl;
|
4693 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4694 | let res;
|
4695 | res = yield this.rest.get(url, options);
|
4696 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitRevert, false);
|
4697 | resolve(ret);
|
4698 | }
|
4699 | catch (err) {
|
4700 | reject(err);
|
4701 | }
|
4702 | }));
|
4703 | });
|
4704 | }
|
4705 | |
4706 |
|
4707 |
|
4708 |
|
4709 |
|
4710 |
|
4711 |
|
4712 | getRevertForRefName(project, repositoryId, refName) {
|
4713 | return __awaiter(this, void 0, void 0, function* () {
|
4714 | if (refName == null) {
|
4715 | throw new TypeError('refName can not be null or undefined');
|
4716 | }
|
4717 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4718 | let routeValues = {
|
4719 | project: project,
|
4720 | repositoryId: repositoryId
|
4721 | };
|
4722 | let queryValues = {
|
4723 | refName: refName,
|
4724 | };
|
4725 | try {
|
4726 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "bc866058-5449-4715-9cf1-a510b6ff193c", routeValues, queryValues);
|
4727 | let url = verData.requestUrl;
|
4728 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4729 | let res;
|
4730 | res = yield this.rest.get(url, options);
|
4731 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitRevert, false);
|
4732 | resolve(ret);
|
4733 | }
|
4734 | catch (err) {
|
4735 | reject(err);
|
4736 | }
|
4737 | }));
|
4738 | });
|
4739 | }
|
4740 | |
4741 |
|
4742 |
|
4743 |
|
4744 |
|
4745 |
|
4746 |
|
4747 |
|
4748 | createCommitStatus(gitCommitStatusToCreate, commitId, repositoryId, project) {
|
4749 | return __awaiter(this, void 0, void 0, function* () {
|
4750 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4751 | let routeValues = {
|
4752 | project: project,
|
4753 | commitId: commitId,
|
4754 | repositoryId: repositoryId
|
4755 | };
|
4756 | try {
|
4757 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "428dd4fb-fda5-4722-af02-9313b80305da", routeValues);
|
4758 | let url = verData.requestUrl;
|
4759 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4760 | let res;
|
4761 | res = yield this.rest.create(url, gitCommitStatusToCreate, options);
|
4762 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitStatus, false);
|
4763 | resolve(ret);
|
4764 | }
|
4765 | catch (err) {
|
4766 | reject(err);
|
4767 | }
|
4768 | }));
|
4769 | });
|
4770 | }
|
4771 | |
4772 |
|
4773 |
|
4774 |
|
4775 |
|
4776 |
|
4777 |
|
4778 |
|
4779 |
|
4780 |
|
4781 | getStatuses(commitId, repositoryId, project, top, skip, latestOnly) {
|
4782 | return __awaiter(this, void 0, void 0, function* () {
|
4783 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4784 | let routeValues = {
|
4785 | project: project,
|
4786 | commitId: commitId,
|
4787 | repositoryId: repositoryId
|
4788 | };
|
4789 | let queryValues = {
|
4790 | top: top,
|
4791 | skip: skip,
|
4792 | latestOnly: latestOnly,
|
4793 | };
|
4794 | try {
|
4795 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "git", "428dd4fb-fda5-4722-af02-9313b80305da", routeValues, queryValues);
|
4796 | let url = verData.requestUrl;
|
4797 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4798 | let res;
|
4799 | res = yield this.rest.get(url, options);
|
4800 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitStatus, true);
|
4801 | resolve(ret);
|
4802 | }
|
4803 | catch (err) {
|
4804 | reject(err);
|
4805 | }
|
4806 | }));
|
4807 | });
|
4808 | }
|
4809 | |
4810 |
|
4811 |
|
4812 |
|
4813 |
|
4814 |
|
4815 |
|
4816 | getSuggestions(repositoryId, project, preferCompareBranch) {
|
4817 | return __awaiter(this, void 0, void 0, function* () {
|
4818 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4819 | let routeValues = {
|
4820 | project: project,
|
4821 | repositoryId: repositoryId
|
4822 | };
|
4823 | let queryValues = {
|
4824 | preferCompareBranch: preferCompareBranch,
|
4825 | };
|
4826 | try {
|
4827 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "9393b4fb-4445-4919-972b-9ad16f442d83", routeValues, queryValues);
|
4828 | let url = verData.requestUrl;
|
4829 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4830 | let res;
|
4831 | res = yield this.rest.get(url, options);
|
4832 | let ret = this.formatResponse(res.result, null, true);
|
4833 | resolve(ret);
|
4834 | }
|
4835 | catch (err) {
|
4836 | reject(err);
|
4837 | }
|
4838 | }));
|
4839 | });
|
4840 | }
|
4841 | |
4842 |
|
4843 |
|
4844 |
|
4845 |
|
4846 |
|
4847 |
|
4848 |
|
4849 |
|
4850 |
|
4851 | getTree(repositoryId, sha1, project, projectId, recursive, fileName) {
|
4852 | return __awaiter(this, void 0, void 0, function* () {
|
4853 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4854 | let routeValues = {
|
4855 | project: project,
|
4856 | repositoryId: repositoryId,
|
4857 | sha1: sha1
|
4858 | };
|
4859 | let queryValues = {
|
4860 | projectId: projectId,
|
4861 | recursive: recursive,
|
4862 | fileName: fileName,
|
4863 | };
|
4864 | try {
|
4865 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "729f6437-6f92-44ec-8bee-273a7111063c", routeValues, queryValues);
|
4866 | let url = verData.requestUrl;
|
4867 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
4868 | let res;
|
4869 | res = yield this.rest.get(url, options);
|
4870 | let ret = this.formatResponse(res.result, GitInterfaces.TypeInfo.GitTreeRef, false);
|
4871 | resolve(ret);
|
4872 | }
|
4873 | catch (err) {
|
4874 | reject(err);
|
4875 | }
|
4876 | }));
|
4877 | });
|
4878 | }
|
4879 | |
4880 |
|
4881 |
|
4882 |
|
4883 |
|
4884 |
|
4885 |
|
4886 |
|
4887 |
|
4888 |
|
4889 | getTreeZip(repositoryId, sha1, project, projectId, recursive, fileName) {
|
4890 | return __awaiter(this, void 0, void 0, function* () {
|
4891 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
4892 | let routeValues = {
|
4893 | project: project,
|
4894 | repositoryId: repositoryId,
|
4895 | sha1: sha1
|
4896 | };
|
4897 | let queryValues = {
|
4898 | projectId: projectId,
|
4899 | recursive: recursive,
|
4900 | fileName: fileName,
|
4901 | };
|
4902 | try {
|
4903 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "git", "729f6437-6f92-44ec-8bee-273a7111063c", routeValues, queryValues);
|
4904 | let url = verData.requestUrl;
|
4905 | let apiVersion = verData.apiVersion;
|
4906 | let accept = this.createAcceptHeader("application/zip", apiVersion);
|
4907 | resolve((yield this.http.get(url, { "Accept": accept })).message);
|
4908 | }
|
4909 | catch (err) {
|
4910 | reject(err);
|
4911 | }
|
4912 | }));
|
4913 | });
|
4914 | }
|
4915 | }
|
4916 | exports.GitApi = GitApi;
|
4917 | GitApi.RESOURCE_AREA_ID = "4e080c62-fa21-4fbc-8fef-2a10a2b38049";
|