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.TfvcApi = void 0;
|
22 | const basem = require("./ClientApiBases");
|
23 | const TfvcInterfaces = require("./interfaces/TfvcInterfaces");
|
24 | class TfvcApi extends basem.ClientApiBase {
|
25 | constructor(baseUrl, handlers, options) {
|
26 | super(baseUrl, handlers, 'node-Tfvc-api', options);
|
27 | }
|
28 | |
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | getBranch(path, project, includeParent, includeChildren) {
|
37 | return __awaiter(this, void 0, void 0, function* () {
|
38 | if (path == null) {
|
39 | throw new TypeError('path can not be null or undefined');
|
40 | }
|
41 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
42 | let routeValues = {
|
43 | project: project
|
44 | };
|
45 | let queryValues = {
|
46 | path: path,
|
47 | includeParent: includeParent,
|
48 | includeChildren: includeChildren,
|
49 | };
|
50 | try {
|
51 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "bc1f417e-239d-42e7-85e1-76e80cb2d6eb", routeValues, queryValues);
|
52 | let url = verData.requestUrl;
|
53 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
54 | let res;
|
55 | res = yield this.rest.get(url, options);
|
56 | let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcBranch, false);
|
57 | resolve(ret);
|
58 | }
|
59 | catch (err) {
|
60 | reject(err);
|
61 | }
|
62 | }));
|
63 | });
|
64 | }
|
65 | |
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 | getBranches(project, includeParent, includeChildren, includeDeleted, includeLinks) {
|
75 | return __awaiter(this, void 0, void 0, function* () {
|
76 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
77 | let routeValues = {
|
78 | project: project
|
79 | };
|
80 | let queryValues = {
|
81 | includeParent: includeParent,
|
82 | includeChildren: includeChildren,
|
83 | includeDeleted: includeDeleted,
|
84 | includeLinks: includeLinks,
|
85 | };
|
86 | try {
|
87 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "bc1f417e-239d-42e7-85e1-76e80cb2d6eb", routeValues, queryValues);
|
88 | let url = verData.requestUrl;
|
89 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
90 | let res;
|
91 | res = yield this.rest.get(url, options);
|
92 | let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcBranch, true);
|
93 | resolve(ret);
|
94 | }
|
95 | catch (err) {
|
96 | reject(err);
|
97 | }
|
98 | }));
|
99 | });
|
100 | }
|
101 | |
102 |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 | getBranchRefs(scopePath, project, includeDeleted, includeLinks) {
|
110 | return __awaiter(this, void 0, void 0, function* () {
|
111 | if (scopePath == null) {
|
112 | throw new TypeError('scopePath can not be null or undefined');
|
113 | }
|
114 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
115 | let routeValues = {
|
116 | project: project
|
117 | };
|
118 | let queryValues = {
|
119 | scopePath: scopePath,
|
120 | includeDeleted: includeDeleted,
|
121 | includeLinks: includeLinks,
|
122 | };
|
123 | try {
|
124 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "bc1f417e-239d-42e7-85e1-76e80cb2d6eb", routeValues, queryValues);
|
125 | let url = verData.requestUrl;
|
126 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
127 | let res;
|
128 | res = yield this.rest.get(url, options);
|
129 | let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcBranchRef, true);
|
130 | resolve(ret);
|
131 | }
|
132 | catch (err) {
|
133 | reject(err);
|
134 | }
|
135 | }));
|
136 | });
|
137 | }
|
138 | |
139 |
|
140 |
|
141 |
|
142 |
|
143 |
|
144 |
|
145 | getChangesetChanges(id, skip, top) {
|
146 | return __awaiter(this, void 0, void 0, function* () {
|
147 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
148 | let routeValues = {
|
149 | id: id
|
150 | };
|
151 | let queryValues = {
|
152 | '$skip': skip,
|
153 | '$top': top,
|
154 | };
|
155 | try {
|
156 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "f32b86f2-15b9-4fe6-81b1-6f8938617ee5", routeValues, queryValues);
|
157 | let url = verData.requestUrl;
|
158 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
159 | let res;
|
160 | res = yield this.rest.get(url, options);
|
161 | let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcChange, true);
|
162 | resolve(ret);
|
163 | }
|
164 | catch (err) {
|
165 | reject(err);
|
166 | }
|
167 | }));
|
168 | });
|
169 | }
|
170 | |
171 |
|
172 |
|
173 |
|
174 |
|
175 |
|
176 | createChangeset(changeset, project) {
|
177 | return __awaiter(this, void 0, void 0, function* () {
|
178 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
179 | let routeValues = {
|
180 | project: project
|
181 | };
|
182 | try {
|
183 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "tfvc", "0bc8f0a4-6bfb-42a9-ba84-139da7b99c49", routeValues);
|
184 | let url = verData.requestUrl;
|
185 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
186 | let res;
|
187 | res = yield this.rest.create(url, changeset, options);
|
188 | let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcChangesetRef, false);
|
189 | resolve(ret);
|
190 | }
|
191 | catch (err) {
|
192 | reject(err);
|
193 | }
|
194 | }));
|
195 | });
|
196 | }
|
197 | |
198 |
|
199 |
|
200 |
|
201 |
|
202 |
|
203 |
|
204 |
|
205 |
|
206 |
|
207 |
|
208 |
|
209 |
|
210 |
|
211 |
|
212 | getChangeset(id, project, maxChangeCount, includeDetails, includeWorkItems, maxCommentLength, includeSourceRename, skip, top, orderby, searchCriteria) {
|
213 | return __awaiter(this, void 0, void 0, function* () {
|
214 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
215 | let routeValues = {
|
216 | project: project,
|
217 | id: id
|
218 | };
|
219 | let queryValues = {
|
220 | maxChangeCount: maxChangeCount,
|
221 | includeDetails: includeDetails,
|
222 | includeWorkItems: includeWorkItems,
|
223 | maxCommentLength: maxCommentLength,
|
224 | includeSourceRename: includeSourceRename,
|
225 | '$skip': skip,
|
226 | '$top': top,
|
227 | '$orderby': orderby,
|
228 | searchCriteria: searchCriteria,
|
229 | };
|
230 | try {
|
231 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "tfvc", "0bc8f0a4-6bfb-42a9-ba84-139da7b99c49", routeValues, queryValues);
|
232 | let url = verData.requestUrl;
|
233 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
234 | let res;
|
235 | res = yield this.rest.get(url, options);
|
236 | let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcChangeset, false);
|
237 | resolve(ret);
|
238 | }
|
239 | catch (err) {
|
240 | reject(err);
|
241 | }
|
242 | }));
|
243 | });
|
244 | }
|
245 | |
246 |
|
247 |
|
248 |
|
249 |
|
250 |
|
251 |
|
252 |
|
253 |
|
254 |
|
255 | getChangesets(project, maxCommentLength, skip, top, orderby, searchCriteria) {
|
256 | return __awaiter(this, void 0, void 0, function* () {
|
257 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
258 | let routeValues = {
|
259 | project: project
|
260 | };
|
261 | let queryValues = {
|
262 | maxCommentLength: maxCommentLength,
|
263 | '$skip': skip,
|
264 | '$top': top,
|
265 | '$orderby': orderby,
|
266 | searchCriteria: searchCriteria,
|
267 | };
|
268 | try {
|
269 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.3", "tfvc", "0bc8f0a4-6bfb-42a9-ba84-139da7b99c49", routeValues, queryValues);
|
270 | let url = verData.requestUrl;
|
271 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
272 | let res;
|
273 | res = yield this.rest.get(url, options);
|
274 | let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcChangesetRef, true);
|
275 | resolve(ret);
|
276 | }
|
277 | catch (err) {
|
278 | reject(err);
|
279 | }
|
280 | }));
|
281 | });
|
282 | }
|
283 | |
284 |
|
285 |
|
286 |
|
287 |
|
288 | getBatchedChangesets(changesetsRequestData) {
|
289 | return __awaiter(this, void 0, void 0, function* () {
|
290 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
291 | let routeValues = {};
|
292 | try {
|
293 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "b7e7c173-803c-4fea-9ec8-31ee35c5502a", routeValues);
|
294 | let url = verData.requestUrl;
|
295 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
296 | let res;
|
297 | res = yield this.rest.create(url, changesetsRequestData, options);
|
298 | let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcChangesetRef, true);
|
299 | resolve(ret);
|
300 | }
|
301 | catch (err) {
|
302 | reject(err);
|
303 | }
|
304 | }));
|
305 | });
|
306 | }
|
307 | |
308 |
|
309 |
|
310 |
|
311 |
|
312 | getChangesetWorkItems(id) {
|
313 | return __awaiter(this, void 0, void 0, function* () {
|
314 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
315 | let routeValues = {
|
316 | id: id
|
317 | };
|
318 | try {
|
319 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "64ae0bea-1d71-47c9-a9e5-fe73f5ea0ff4", routeValues);
|
320 | let url = verData.requestUrl;
|
321 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
322 | let res;
|
323 | res = yield this.rest.get(url, options);
|
324 | let ret = this.formatResponse(res.result, null, true);
|
325 | resolve(ret);
|
326 | }
|
327 | catch (err) {
|
328 | reject(err);
|
329 | }
|
330 | }));
|
331 | });
|
332 | }
|
333 | |
334 |
|
335 |
|
336 |
|
337 |
|
338 |
|
339 | getItemsBatch(itemRequestData, project) {
|
340 | return __awaiter(this, void 0, void 0, function* () {
|
341 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
342 | let routeValues = {
|
343 | project: project
|
344 | };
|
345 | try {
|
346 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "fe6f827b-5f64-480f-b8af-1eca3b80e833", routeValues);
|
347 | let url = verData.requestUrl;
|
348 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
349 | let res;
|
350 | res = yield this.rest.create(url, itemRequestData, options);
|
351 | let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcItem, true);
|
352 | resolve(ret);
|
353 | }
|
354 | catch (err) {
|
355 | reject(err);
|
356 | }
|
357 | }));
|
358 | });
|
359 | }
|
360 | |
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 | getItemsBatchZip(itemRequestData, project) {
|
367 | return __awaiter(this, void 0, void 0, function* () {
|
368 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
369 | let routeValues = {
|
370 | project: project
|
371 | };
|
372 | try {
|
373 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "fe6f827b-5f64-480f-b8af-1eca3b80e833", routeValues);
|
374 | let url = verData.requestUrl;
|
375 | let apiVersion = verData.apiVersion;
|
376 | let accept = this.createAcceptHeader("application/zip", apiVersion);
|
377 | resolve((yield this.http.get(url, { "Accept": accept })).message);
|
378 | }
|
379 | catch (err) {
|
380 | reject(err);
|
381 | }
|
382 | }));
|
383 | });
|
384 | }
|
385 | |
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 |
|
392 |
|
393 |
|
394 |
|
395 |
|
396 |
|
397 | getItem(path, project, fileName, download, scopePath, recursionLevel, versionDescriptor, includeContent) {
|
398 | return __awaiter(this, void 0, void 0, function* () {
|
399 | if (path == null) {
|
400 | throw new TypeError('path can not be null or undefined');
|
401 | }
|
402 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
403 | let routeValues = {
|
404 | project: project
|
405 | };
|
406 | let queryValues = {
|
407 | path: path,
|
408 | fileName: fileName,
|
409 | download: download,
|
410 | scopePath: scopePath,
|
411 | recursionLevel: recursionLevel,
|
412 | versionDescriptor: versionDescriptor,
|
413 | includeContent: includeContent,
|
414 | };
|
415 | try {
|
416 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "ba9fc436-9a38-4578-89d6-e4f3241f5040", routeValues, queryValues);
|
417 | let url = verData.requestUrl;
|
418 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
419 | let res;
|
420 | res = yield this.rest.get(url, options);
|
421 | let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcItem, false);
|
422 | resolve(ret);
|
423 | }
|
424 | catch (err) {
|
425 | reject(err);
|
426 | }
|
427 | }));
|
428 | });
|
429 | }
|
430 | |
431 |
|
432 |
|
433 |
|
434 |
|
435 |
|
436 |
|
437 |
|
438 |
|
439 |
|
440 |
|
441 |
|
442 | getItemContent(path, project, fileName, download, scopePath, recursionLevel, versionDescriptor, includeContent) {
|
443 | return __awaiter(this, void 0, void 0, function* () {
|
444 | if (path == null) {
|
445 | throw new TypeError('path can not be null or undefined');
|
446 | }
|
447 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
448 | let routeValues = {
|
449 | project: project
|
450 | };
|
451 | let queryValues = {
|
452 | path: path,
|
453 | fileName: fileName,
|
454 | download: download,
|
455 | scopePath: scopePath,
|
456 | recursionLevel: recursionLevel,
|
457 | versionDescriptor: versionDescriptor,
|
458 | includeContent: includeContent,
|
459 | };
|
460 | try {
|
461 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "ba9fc436-9a38-4578-89d6-e4f3241f5040", routeValues, queryValues);
|
462 | let url = verData.requestUrl;
|
463 | let apiVersion = verData.apiVersion;
|
464 | let accept = this.createAcceptHeader("application/octet-stream", apiVersion);
|
465 | resolve((yield this.http.get(url, { "Accept": accept })).message);
|
466 | }
|
467 | catch (err) {
|
468 | reject(err);
|
469 | }
|
470 | }));
|
471 | });
|
472 | }
|
473 | |
474 |
|
475 |
|
476 |
|
477 |
|
478 |
|
479 |
|
480 |
|
481 |
|
482 | getItems(project, scopePath, recursionLevel, includeLinks, versionDescriptor) {
|
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 | };
|
488 | let queryValues = {
|
489 | scopePath: scopePath,
|
490 | recursionLevel: recursionLevel,
|
491 | includeLinks: includeLinks,
|
492 | versionDescriptor: versionDescriptor,
|
493 | };
|
494 | try {
|
495 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "ba9fc436-9a38-4578-89d6-e4f3241f5040", routeValues, queryValues);
|
496 | let url = verData.requestUrl;
|
497 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
498 | let res;
|
499 | res = yield this.rest.get(url, options);
|
500 | let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcItem, true);
|
501 | resolve(ret);
|
502 | }
|
503 | catch (err) {
|
504 | reject(err);
|
505 | }
|
506 | }));
|
507 | });
|
508 | }
|
509 | |
510 |
|
511 |
|
512 |
|
513 |
|
514 |
|
515 |
|
516 |
|
517 |
|
518 |
|
519 |
|
520 |
|
521 | getItemText(path, project, fileName, download, scopePath, recursionLevel, versionDescriptor, includeContent) {
|
522 | return __awaiter(this, void 0, void 0, function* () {
|
523 | if (path == null) {
|
524 | throw new TypeError('path can not be null or undefined');
|
525 | }
|
526 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
527 | let routeValues = {
|
528 | project: project
|
529 | };
|
530 | let queryValues = {
|
531 | path: path,
|
532 | fileName: fileName,
|
533 | download: download,
|
534 | scopePath: scopePath,
|
535 | recursionLevel: recursionLevel,
|
536 | versionDescriptor: versionDescriptor,
|
537 | includeContent: includeContent,
|
538 | };
|
539 | try {
|
540 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "ba9fc436-9a38-4578-89d6-e4f3241f5040", routeValues, queryValues);
|
541 | let url = verData.requestUrl;
|
542 | let apiVersion = verData.apiVersion;
|
543 | let accept = this.createAcceptHeader("text/plain", apiVersion);
|
544 | resolve((yield this.http.get(url, { "Accept": accept })).message);
|
545 | }
|
546 | catch (err) {
|
547 | reject(err);
|
548 | }
|
549 | }));
|
550 | });
|
551 | }
|
552 | |
553 |
|
554 |
|
555 |
|
556 |
|
557 |
|
558 |
|
559 |
|
560 |
|
561 |
|
562 |
|
563 |
|
564 | getItemZip(path, project, fileName, download, scopePath, recursionLevel, versionDescriptor, includeContent) {
|
565 | return __awaiter(this, void 0, void 0, function* () {
|
566 | if (path == null) {
|
567 | throw new TypeError('path can not be null or undefined');
|
568 | }
|
569 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
570 | let routeValues = {
|
571 | project: project
|
572 | };
|
573 | let queryValues = {
|
574 | path: path,
|
575 | fileName: fileName,
|
576 | download: download,
|
577 | scopePath: scopePath,
|
578 | recursionLevel: recursionLevel,
|
579 | versionDescriptor: versionDescriptor,
|
580 | includeContent: includeContent,
|
581 | };
|
582 | try {
|
583 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "ba9fc436-9a38-4578-89d6-e4f3241f5040", routeValues, queryValues);
|
584 | let url = verData.requestUrl;
|
585 | let apiVersion = verData.apiVersion;
|
586 | let accept = this.createAcceptHeader("application/zip", apiVersion);
|
587 | resolve((yield this.http.get(url, { "Accept": accept })).message);
|
588 | }
|
589 | catch (err) {
|
590 | reject(err);
|
591 | }
|
592 | }));
|
593 | });
|
594 | }
|
595 | |
596 |
|
597 |
|
598 |
|
599 |
|
600 |
|
601 |
|
602 | getLabelItems(labelId, top, skip) {
|
603 | return __awaiter(this, void 0, void 0, function* () {
|
604 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
605 | let routeValues = {
|
606 | labelId: labelId
|
607 | };
|
608 | let queryValues = {
|
609 | '$top': top,
|
610 | '$skip': skip,
|
611 | };
|
612 | try {
|
613 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "06166e34-de17-4b60-8cd1-23182a346fda", routeValues, queryValues);
|
614 | let url = verData.requestUrl;
|
615 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
616 | let res;
|
617 | res = yield this.rest.get(url, options);
|
618 | let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcItem, true);
|
619 | resolve(ret);
|
620 | }
|
621 | catch (err) {
|
622 | reject(err);
|
623 | }
|
624 | }));
|
625 | });
|
626 | }
|
627 | |
628 |
|
629 |
|
630 |
|
631 |
|
632 |
|
633 |
|
634 | getLabel(labelId, requestData, project) {
|
635 | return __awaiter(this, void 0, void 0, function* () {
|
636 | if (requestData == null) {
|
637 | throw new TypeError('requestData can not be null or undefined');
|
638 | }
|
639 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
640 | let routeValues = {
|
641 | project: project,
|
642 | labelId: labelId
|
643 | };
|
644 | let queryValues = {
|
645 | requestData: requestData,
|
646 | };
|
647 | try {
|
648 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "a5d9bd7f-b661-4d0e-b9be-d9c16affae54", routeValues, queryValues);
|
649 | let url = verData.requestUrl;
|
650 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
651 | let res;
|
652 | res = yield this.rest.get(url, options);
|
653 | let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcLabel, false);
|
654 | resolve(ret);
|
655 | }
|
656 | catch (err) {
|
657 | reject(err);
|
658 | }
|
659 | }));
|
660 | });
|
661 | }
|
662 | |
663 |
|
664 |
|
665 |
|
666 |
|
667 |
|
668 |
|
669 |
|
670 | getLabels(requestData, project, top, skip) {
|
671 | return __awaiter(this, void 0, void 0, function* () {
|
672 | if (requestData == null) {
|
673 | throw new TypeError('requestData can not be null or undefined');
|
674 | }
|
675 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
676 | let routeValues = {
|
677 | project: project
|
678 | };
|
679 | let queryValues = {
|
680 | requestData: requestData,
|
681 | '$top': top,
|
682 | '$skip': skip,
|
683 | };
|
684 | try {
|
685 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "a5d9bd7f-b661-4d0e-b9be-d9c16affae54", routeValues, queryValues);
|
686 | let url = verData.requestUrl;
|
687 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
688 | let res;
|
689 | res = yield this.rest.get(url, options);
|
690 | let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcLabelRef, true);
|
691 | resolve(ret);
|
692 | }
|
693 | catch (err) {
|
694 | reject(err);
|
695 | }
|
696 | }));
|
697 | });
|
698 | }
|
699 | |
700 |
|
701 |
|
702 |
|
703 |
|
704 |
|
705 |
|
706 | getShelvesetChanges(shelvesetId, top, skip) {
|
707 | return __awaiter(this, void 0, void 0, function* () {
|
708 | if (shelvesetId == null) {
|
709 | throw new TypeError('shelvesetId can not be null or undefined');
|
710 | }
|
711 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
712 | let routeValues = {};
|
713 | let queryValues = {
|
714 | shelvesetId: shelvesetId,
|
715 | '$top': top,
|
716 | '$skip': skip,
|
717 | };
|
718 | try {
|
719 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "dbaf075b-0445-4c34-9e5b-82292f856522", routeValues, queryValues);
|
720 | let url = verData.requestUrl;
|
721 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
722 | let res;
|
723 | res = yield this.rest.get(url, options);
|
724 | let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcChange, true);
|
725 | resolve(ret);
|
726 | }
|
727 | catch (err) {
|
728 | reject(err);
|
729 | }
|
730 | }));
|
731 | });
|
732 | }
|
733 | |
734 |
|
735 |
|
736 |
|
737 |
|
738 |
|
739 | getShelveset(shelvesetId, requestData) {
|
740 | return __awaiter(this, void 0, void 0, function* () {
|
741 | if (shelvesetId == null) {
|
742 | throw new TypeError('shelvesetId can not be null or undefined');
|
743 | }
|
744 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
745 | let routeValues = {};
|
746 | let queryValues = {
|
747 | shelvesetId: shelvesetId,
|
748 | requestData: requestData,
|
749 | };
|
750 | try {
|
751 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "e36d44fb-e907-4b0a-b194-f83f1ed32ad3", routeValues, queryValues);
|
752 | let url = verData.requestUrl;
|
753 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
754 | let res;
|
755 | res = yield this.rest.get(url, options);
|
756 | let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcShelveset, false);
|
757 | resolve(ret);
|
758 | }
|
759 | catch (err) {
|
760 | reject(err);
|
761 | }
|
762 | }));
|
763 | });
|
764 | }
|
765 | |
766 |
|
767 |
|
768 |
|
769 |
|
770 |
|
771 |
|
772 | getShelvesets(requestData, top, skip) {
|
773 | return __awaiter(this, void 0, void 0, function* () {
|
774 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
775 | let routeValues = {};
|
776 | let queryValues = {
|
777 | requestData: requestData,
|
778 | '$top': top,
|
779 | '$skip': skip,
|
780 | };
|
781 | try {
|
782 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "e36d44fb-e907-4b0a-b194-f83f1ed32ad3", routeValues, queryValues);
|
783 | let url = verData.requestUrl;
|
784 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
785 | let res;
|
786 | res = yield this.rest.get(url, options);
|
787 | let ret = this.formatResponse(res.result, TfvcInterfaces.TypeInfo.TfvcShelvesetRef, true);
|
788 | resolve(ret);
|
789 | }
|
790 | catch (err) {
|
791 | reject(err);
|
792 | }
|
793 | }));
|
794 | });
|
795 | }
|
796 | |
797 |
|
798 |
|
799 |
|
800 |
|
801 | getShelvesetWorkItems(shelvesetId) {
|
802 | return __awaiter(this, void 0, void 0, function* () {
|
803 | if (shelvesetId == null) {
|
804 | throw new TypeError('shelvesetId can not be null or undefined');
|
805 | }
|
806 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
807 | let routeValues = {};
|
808 | let queryValues = {
|
809 | shelvesetId: shelvesetId,
|
810 | };
|
811 | try {
|
812 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "a7a0c1c1-373e-425a-b031-a519474d743d", routeValues, queryValues);
|
813 | let url = verData.requestUrl;
|
814 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
815 | let res;
|
816 | res = yield this.rest.get(url, options);
|
817 | let ret = this.formatResponse(res.result, null, true);
|
818 | resolve(ret);
|
819 | }
|
820 | catch (err) {
|
821 | reject(err);
|
822 | }
|
823 | }));
|
824 | });
|
825 | }
|
826 | |
827 |
|
828 |
|
829 |
|
830 |
|
831 |
|
832 | getTfvcStatistics(project, scopePath) {
|
833 | return __awaiter(this, void 0, void 0, function* () {
|
834 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
835 | let routeValues = {
|
836 | project: project
|
837 | };
|
838 | let queryValues = {
|
839 | scopePath: scopePath,
|
840 | };
|
841 | try {
|
842 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "tfvc", "e15c74c0-3605-40e0-aed4-4cc61e549ed8", routeValues, queryValues);
|
843 | let url = verData.requestUrl;
|
844 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
845 | let res;
|
846 | res = yield this.rest.get(url, options);
|
847 | let ret = this.formatResponse(res.result, null, false);
|
848 | resolve(ret);
|
849 | }
|
850 | catch (err) {
|
851 | reject(err);
|
852 | }
|
853 | }));
|
854 | });
|
855 | }
|
856 | }
|
857 | exports.TfvcApi = TfvcApi;
|
858 | TfvcApi.RESOURCE_AREA_ID = "8aa40520-446d-40e6-89f6-9c9f9ce44c48";
|